A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-rlc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Nicola Baldo <nbaldo@cttc.es>
18 */
19
20#ifndef LTE_RLC_H
21#define LTE_RLC_H
22
23#include "lte-mac-sap.h"
24#include "lte-rlc-sap.h"
25
26#include "ns3/nstime.h"
27#include "ns3/object.h"
28#include "ns3/trace-source-accessor.h"
29#include "ns3/traced-value.h"
30#include "ns3/uinteger.h"
31#include <ns3/packet.h>
32#include <ns3/simple-ref-count.h>
33
34namespace ns3
35{
36
37// class LteRlcSapProvider;
38// class LteRlcSapUser;
39//
40// class LteMacSapProvider;
41// class LteMacSapUser;
42
43/**
44 * This abstract base class defines the API to interact with the Radio Link Control
45 * (LTE_RLC) in LTE, see 3GPP TS 36.322
46 *
47 */
48class LteRlc : public Object // SimpleRefCount<LteRlc>
49{
50 /// allow LteRlcSpecificLteMacSapUser class friend access
52 /// allow LteRlcSpecificLteRlcSapProvider<LteRlc> class friend access
54
55 public:
56 LteRlc();
57 ~LteRlc() override;
58 /**
59 * \brief Get the type ID.
60 * \return the object TypeId
61 */
62 static TypeId GetTypeId();
63 void DoDispose() override;
64
65 /**
66 *
67 *
68 * \param rnti
69 */
70 void SetRnti(uint16_t rnti);
71
72 /**
73 *
74 *
75 * \param lcId
76 */
77 void SetLcId(uint8_t lcId);
78
79 /**
80 * \param packetDelayBudget
81 */
82 void SetPacketDelayBudgetMs(uint16_t packetDelayBudget);
83
84 /**
85 *
86 *
87 * \param s the RLC SAP user to be used by this LTE_RLC
88 */
90
91 /**
92 *
93 *
94 * \return the RLC SAP Provider interface offered to the PDCP by this LTE_RLC
95 */
97
98 /**
99 *
100 *
101 * \param s the MAC SAP Provider to be used by this LTE_RLC
102 */
104
105 /**
106 *
107 *
108 * \return the MAC SAP User interface offered to the MAC by this LTE_RLC
109 */
111
112 /**
113 * TracedCallback signature for NotifyTxOpportunity events.
114 *
115 * \param [in] rnti C-RNTI scheduled.
116 * \param [in] lcid The logical channel id corresponding to
117 * the sending RLC instance.
118 * \param [in] bytes The number of bytes to transmit
119 */
120 typedef void (*NotifyTxTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t bytes);
121
122 /**
123 * TracedCallback signature for
124 *
125 * \param [in] rnti C-RNTI scheduled.
126 * \param [in] lcid The logical channel id corresponding to
127 * the sending RLC instance.
128 * \param [in] bytes The packet size.
129 * \param [in] delay Delay since sender timestamp, in ns.
130 */
131 typedef void (*ReceiveTracedCallback)(uint16_t rnti,
132 uint8_t lcid,
133 uint32_t bytes,
134 uint64_t delay);
135
136 /// \todo MRE What is the sense to duplicate all the interfaces here???
137 // NB to avoid the use of multiple inheritance
138
139 protected:
140 // Interface forwarded by LteRlcSapProvider
141 /**
142 * Transmit PDCP PDU
143 *
144 * \param p packet
145 */
146 virtual void DoTransmitPdcpPdu(Ptr<Packet> p) = 0;
147
148 LteRlcSapUser* m_rlcSapUser; ///< RLC SAP user
149 LteRlcSapProvider* m_rlcSapProvider; ///< RLC SAP provider
150
151 // Interface forwarded by LteMacSapUser
152 /**
153 * Notify transmit opportunity
154 *
155 * \param params LteMacSapUser::TxOpportunityParameters
156 */
158 /**
159 * Notify HARQ delivery failure
160 */
161 virtual void DoNotifyHarqDeliveryFailure() = 0;
162 /**
163 * Receive PDU function
164 *
165 * \param params the LteMacSapUser::ReceivePduParameters
166 */
168
169 LteMacSapUser* m_macSapUser; ///< MAC SAP user
170 LteMacSapProvider* m_macSapProvider; ///< MAC SAP provider
171
172 uint16_t m_rnti; ///< RNTI
173 uint8_t m_lcid; ///< LCID
175 UINT16_MAX}; //!< the packet delay budget in ms of the corresponding logical channel
176
177 /**
178 * Used to inform of a PDU delivery to the MAC SAP provider
179 */
181 /**
182 * Used to inform of a PDU reception from the MAC SAP user
183 */
185 /**
186 * The trace source fired when the RLC drops a packet before
187 * transmission.
188 */
190};
191
192/**
193 * LTE_RLC Saturation Mode (SM): simulation-specific mode used for
194 * experiments that do not need to consider the layers above the LTE_RLC.
195 * The LTE_RLC SM, unlike the standard LTE_RLC modes, it does not provide
196 * data delivery services to upper layers; rather, it just generates a
197 * new LTE_RLC PDU whenever the MAC notifies a transmission opportunity.
198 *
199 */
200class LteRlcSm : public LteRlc
201{
202 public:
203 LteRlcSm();
204 ~LteRlcSm() override;
205 /**
206 * \brief Get the type ID.
207 * \return the object TypeId
208 */
209 static TypeId GetTypeId();
210 void DoInitialize() override;
211 void DoDispose() override;
212
213 void DoTransmitPdcpPdu(Ptr<Packet> p) override;
215 void DoNotifyHarqDeliveryFailure() override;
216 void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override;
217
218 private:
219 /// Report buffer status
220 void ReportBufferStatus();
221};
222
223// /**
224// * Implements LTE_RLC Transparent Mode (TM), see 3GPP TS 36.322
225// *
226// */
227// class LteRlcTm : public LteRlc
228// {
229// public:
230// virtual ~LteRlcTm ();
231
232// };
233
234// /**
235// * Implements LTE_RLC Unacknowledged Mode (UM), see 3GPP TS 36.322
236// *
237// */
238// class LteRlcUm : public LteRlc
239// {
240// public:
241// virtual ~LteRlcUm ();
242
243// };
244
245// /**
246// * Implements LTE_RLC Acknowledged Mode (AM), see 3GPP TS 36.322
247// *
248// */
249
250// class LteRlcAm : public LteRlc
251// {
252// public:
253// virtual ~LteRlcAm ();
254// };
255
256} // namespace ns3
257
258#endif // LTE_RLC_H
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:96
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
Definition: lte-rlc.h:49
LteRlcSapUser * m_rlcSapUser
RLC SAP user.
Definition: lte-rlc.h:148
uint8_t m_lcid
LCID.
Definition: lte-rlc.h:173
void SetPacketDelayBudgetMs(uint16_t packetDelayBudget)
Definition: lte-rlc.cc:148
virtual void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters params)=0
Notify transmit opportunity.
TracedCallback< Ptr< const Packet > > m_txDropTrace
The trace source fired when the RLC drops a packet before transmission.
Definition: lte-rlc.h:189
void(* ReceiveTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t bytes, uint64_t delay)
TracedCallback signature for.
Definition: lte-rlc.h:131
void(* NotifyTxTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t bytes)
TracedCallback signature for NotifyTxOpportunity events.
Definition: lte-rlc.h:120
uint16_t m_rnti
RNTI.
Definition: lte-rlc.h:172
TracedCallback< uint16_t, uint8_t, uint32_t, uint64_t > m_rxPdu
Used to inform of a PDU reception from the MAC SAP user.
Definition: lte-rlc.h:184
void DoDispose() override
Destructor implementation.
Definition: lte-rlc.cc:126
LteRlcSapProvider * m_rlcSapProvider
RLC SAP provider.
Definition: lte-rlc.h:149
LteMacSapUser * m_macSapUser
MAC SAP user.
Definition: lte-rlc.h:169
LteMacSapProvider * m_macSapProvider
MAC SAP provider.
Definition: lte-rlc.h:170
void SetLteRlcSapUser(LteRlcSapUser *s)
Definition: lte-rlc.cc:155
uint16_t m_packetDelayBudgetMs
the packet delay budget in ms of the corresponding logical channel
Definition: lte-rlc.h:174
TracedCallback< uint16_t, uint8_t, uint32_t > m_txPdu
Used to inform of a PDU delivery to the MAC SAP provider.
Definition: lte-rlc.h:180
void SetRnti(uint16_t rnti)
Definition: lte-rlc.cc:134
virtual void DoNotifyHarqDeliveryFailure()=0
Notify HARQ delivery failure.
void SetLteMacSapProvider(LteMacSapProvider *s)
Definition: lte-rlc.cc:169
virtual void DoReceivePdu(LteMacSapUser::ReceivePduParameters params)=0
Receive PDU function.
~LteRlc() override
Definition: lte-rlc.cc:98
LteMacSapUser * GetLteMacSapUser()
Definition: lte-rlc.cc:176
void SetLcId(uint8_t lcId)
Definition: lte-rlc.cc:141
static TypeId GetTypeId()
Get the type ID.
Definition: lte-rlc.cc:104
virtual void DoTransmitPdcpPdu(Ptr< Packet > p)=0
Transmit PDCP PDU.
LteRlcSapProvider * GetLteRlcSapProvider()
Definition: lte-rlc.cc:162
Service Access Point (SAP) offered by the UM-RLC and AM-RLC entities to the PDCP entity See 3GPP 36....
Definition: lte-rlc-sap.h:36
Service Access Point (SAP) offered by the UM-RLC and AM-RLC entities to the PDCP entity See 3GPP 36....
Definition: lte-rlc-sap.h:67
LTE_RLC Saturation Mode (SM): simulation-specific mode used for experiments that do not need to consi...
Definition: lte-rlc.h:201
void DoDispose() override
Destructor implementation.
Definition: lte-rlc.cc:212
void DoInitialize() override
Initialize() implementation.
Definition: lte-rlc.cc:205
static TypeId GetTypeId()
Get the type ID.
Definition: lte-rlc.cc:197
~LteRlcSm() override
Definition: lte-rlc.cc:191
void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override
Receive PDU function.
Definition: lte-rlc.cc:225
void DoTransmitPdcpPdu(Ptr< Packet > p) override
Transmit PDCP PDU.
Definition: lte-rlc.cc:219
void DoNotifyHarqDeliveryFailure() override
Notify HARQ delivery failure.
Definition: lte-rlc.cc:270
void ReportBufferStatus()
Report buffer status.
Definition: lte-rlc.cc:276
void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters txOpParams) override
Notify transmit opportunity.
Definition: lte-rlc.cc:240
LteRlcSpecificLteMacSapUser class.
Definition: lte-rlc.cc:37
LteRlcSpecificLteRlcSapProvider.
Definition: lte-rlc-sap.h:82
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters for LteMacSapUser::ReceivePdu.
Definition: lte-mac-sap.h:166
Parameters for LteMacSapUser::NotifyTxOpportunity.
Definition: lte-mac-sap.h:105