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