A Discrete-Event Network Simulator
API
lte-rlc.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 #ifndef LTE_RLC_H
22 #define LTE_RLC_H
23 
24 #include <ns3/simple-ref-count.h>
25 #include <ns3/packet.h>
26 #include "ns3/uinteger.h"
27 #include "ns3/traced-value.h"
28 #include "ns3/trace-source-accessor.h"
29 #include "ns3/nstime.h"
30 
31 #include "ns3/object.h"
32 
33 #include "ns3/lte-rlc-sap.h"
34 #include "ns3/lte-mac-sap.h"
35 
36 namespace ns3 {
37 
38 
39 // class LteRlcSapProvider;
40 // class LteRlcSapUser;
41 //
42 // class LteMacSapProvider;
43 // class LteMacSapUser;
44 
50 class LteRlc : public Object // SimpleRefCount<LteRlc>
51 {
56 public:
57  LteRlc ();
58  virtual ~LteRlc ();
63  static TypeId GetTypeId (void);
64  virtual void DoDispose ();
65 
71  void SetRnti (uint16_t rnti);
72 
78  void SetLcId (uint8_t lcId);
79 
86 
93 
100 
107 
108 
117  typedef void (* NotifyTxTracedCallback)
118  (uint16_t rnti, uint8_t lcid, uint32_t bytes);
119 
129  typedef void (* ReceiveTracedCallback)
130  (uint16_t rnti, uint8_t lcid, uint32_t bytes, uint64_t delay);
131 
133  // NB to avoid the use of multiple inheritance
134 
135 protected:
136  // Interface forwarded by LteRlcSapProvider
142  virtual void DoTransmitPdcpPdu (Ptr<Packet> p) = 0;
143 
146 
147  // Interface forwarded by LteMacSapUser
158  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid) = 0;
162  virtual void DoNotifyHarqDeliveryFailure () = 0;
170  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) = 0;
171 
174 
175  uint16_t m_rnti;
176  uint8_t m_lcid;
177 
186 
187 };
188 
189 
190 
199 class LteRlcSm : public LteRlc
200 {
201 public:
202  LteRlcSm ();
203  virtual ~LteRlcSm ();
208  static TypeId GetTypeId (void);
209  virtual void DoInitialize ();
210  virtual void DoDispose ();
211 
212  virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
213  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
214  virtual void DoNotifyHarqDeliveryFailure ();
215  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
216 
217 
218 
219 private:
221  void ReportBufferStatus ();
222 
223 };
224 
225 
226 
227 
228 // /**
229 // * Implements LTE_RLC Transparent Mode (TM), see 3GPP TS 36.322
230 // *
231 // */
232 // class LteRlcTm : public LteRlc
233 // {
234 // public:
235 // virtual ~LteRlcTm ();
236 
237 // };
238 
239 
240 // /**
241 // * Implements LTE_RLC Unacknowledged Mode (UM), see 3GPP TS 36.322
242 // *
243 // */
244 // class LteRlcUm : public LteRlc
245 // {
246 // public:
247 // virtual ~LteRlcUm ();
248 
249 // };
250 
251 // /**
252 // * Implements LTE_RLC Acknowledged Mode (AM), see 3GPP TS 36.322
253 // *
254 // */
255 
256 // class LteRlcAm : public LteRlc
257 // {
258 // public:
259 // virtual ~LteRlcAm ();
260 // };
261 
262 
263 
264 
265 
266 } // namespace ns3
267 
268 #endif // LTE_RLC_H
virtual void DoReceivePdu(Ptr< Packet > p, uint16_t rnti, uint8_t lcid)
Receive PDU function.
Definition: lte-rlc.cc:220
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
LteMacSapUser * m_macSapUser
MAC SAP user.
Definition: lte-rlc.h:172
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:181
virtual ~LteRlcSm()
Definition: lte-rlc.cc:183
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:35
virtual ~LteRlc()
Definition: lte-rlc.cc:100
LteRlcSpecificLteMacSapUser class.
Definition: lte-rlc.cc:37
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc.cc:189
virtual void DoDispose()
Destructor implementation.
Definition: lte-rlc.cc:207
uint16_t m_rnti
RNTI.
Definition: lte-rlc.h:175
uint8_t m_lcid
LCID.
Definition: lte-rlc.h:176
virtual void DoNotifyHarqDeliveryFailure()
Notify HARQ delivery failure.
Definition: lte-rlc.cc:261
void SetRnti(uint16_t rnti)
Definition: lte-rlc.cc:131
LteRlcSpecificLteRlcSapProvider.
Definition: lte-rlc-sap.h:83
virtual void DoNotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)=0
Notify transmit opportunity.
LteRlcSapUser * m_rlcSapUser
RLC SAP user.
Definition: lte-rlc.h:144
virtual void DoDispose()
Destructor implementation.
Definition: lte-rlc.cc:123
virtual void DoTransmitPdcpPdu(Ptr< Packet > p)
Transmit PDCP PDU.
Definition: lte-rlc.cc:214
LteMacSapUser * GetLteMacSapUser()
Definition: lte-rlc.cc:166
virtual void DoReceivePdu(Ptr< Packet > p, uint16_t rnti, uint8_t lcid)=0
Receive PDU function.
LteMacSapProvider * m_macSapProvider
MAC SAP provider.
Definition: lte-rlc.h:173
void ReportBufferStatus()
Report buffer status.
Definition: lte-rlc.cc:267
Every class exported by the ns3 library is enclosed in the ns3 namespace.
LteRlcSapProvider * m_rlcSapProvider
RLC SAP provider.
Definition: lte-rlc.h:145
void SetLteRlcSapUser(LteRlcSapUser *s)
Definition: lte-rlc.cc:145
void SetLcId(uint8_t lcId)
Definition: lte-rlc.cc:138
virtual void DoNotifyHarqDeliveryFailure()=0
Notify HARQ delivery failure.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:95
void(* NotifyTxTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t bytes)
TracedCallback signature for NotifyTxOpportunity events.
Definition: lte-rlc.h:118
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
LteRlcSapProvider * GetLteRlcSapProvider()
Definition: lte-rlc.cc:152
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:185
A base class which provides memory management and object aggregation.
Definition: object.h:87
virtual void DoTransmitPdcpPdu(Ptr< Packet > p)=0
Transmit PDCP PDU.
virtual void DoNotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
Notify transmit opportunity.
Definition: lte-rlc.cc:237
virtual void DoInitialize()
Initialize() implementation.
Definition: lte-rlc.cc:200
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE...
Definition: lte-rlc.h:50
a unique identifier for an interface.
Definition: type-id.h:58
LTE_RLC Saturation Mode (SM): simulation-specific mode used for experiments that do not need to consi...
Definition: lte-rlc.h:199
void SetLteMacSapProvider(LteMacSapProvider *s)
Definition: lte-rlc.cc:159
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc.cc:105
void(* ReceiveTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t bytes, uint64_t delay)
TracedCallback signature for.
Definition: lte-rlc.h:130