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 {
54 public:
55  LteRlc ();
56  virtual ~LteRlc ();
57  static TypeId GetTypeId (void);
58  virtual void DoDispose ();
59 
65  void SetRnti (uint16_t rnti);
66 
72  void SetLcId (uint8_t lcId);
73 
80 
87 
94 
101 
102 
111  typedef void (* NotifyTxTracedCallback)
112  (const uint16_t rnti, const uint8_t lcid, const uint32_t bytes);
113 
123  typedef void (* ReceiveTracedCallback)
124  (const uint16_t rnti, const uint8_t lcid,
125  const uint32_t bytes, const uint64_t delay);
126 
128  // NB to avoid the use of multiple inheritance
129 
130 protected:
131  // Interface forwarded by LteRlcSapProvider
132  virtual void DoTransmitPdcpPdu (Ptr<Packet> p) = 0;
133 
136 
137  // Interface forwarded by LteMacSapUser
138  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId) = 0;
139  virtual void DoNotifyHarqDeliveryFailure () = 0;
140  virtual void DoReceivePdu (Ptr<Packet> p) = 0;
141 
144 
145  uint16_t m_rnti;
146  uint8_t m_lcid;
147 
156 
157 };
158 
159 
160 
169 class LteRlcSm : public LteRlc
170 {
171 public:
172  LteRlcSm ();
173  virtual ~LteRlcSm ();
174  static TypeId GetTypeId (void);
175  virtual void DoInitialize ();
176  virtual void DoDispose ();
177 
178  virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
179  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId);
180  virtual void DoNotifyHarqDeliveryFailure ();
181  virtual void DoReceivePdu (Ptr<Packet> p);
182 
183 
184 
185 private:
186  void ReportBufferStatus ();
187 
188 };
189 
190 
191 
192 
193 // /**
194 // * Implements LTE_RLC Transparent Mode (TM), see 3GPP TS 36.322
195 // *
196 // */
197 // class LteRlcTm : public LteRlc
198 // {
199 // public:
200 // virtual ~LteRlcTm ();
201 
202 // };
203 
204 
205 // /**
206 // * Implements LTE_RLC Unacknowledged Mode (UM), see 3GPP TS 36.322
207 // *
208 // */
209 // class LteRlcUm : public LteRlc
210 // {
211 // public:
212 // virtual ~LteRlcUm ();
213 
214 // };
215 
216 // /**
217 // * Implements LTE_RLC Acknowledged Mode (AM), see 3GPP TS 36.322
218 // *
219 // */
220 
221 // class LteRlcAm : public LteRlc
222 // {
223 // public:
224 // virtual ~LteRlcAm ();
225 // };
226 
227 
228 
229 
230 
231 } // namespace ns3
232 
233 #endif // LTE_RLC_H
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:66
LteMacSapUser * m_macSapUser
Definition: lte-rlc.h:142
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:151
virtual ~LteRlcSm()
Definition: lte-rlc.cc:178
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 void DoReceivePdu(Ptr< Packet > p)
Definition: lte-rlc.cc:214
virtual ~LteRlc()
Definition: lte-rlc.cc:96
static TypeId GetTypeId(void)
Definition: lte-rlc.cc:184
virtual void DoDispose()
Destructor implementation.
Definition: lte-rlc.cc:201
uint16_t m_rnti
Definition: lte-rlc.h:145
uint8_t m_lcid
Definition: lte-rlc.h:146
virtual void DoNotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId)
Definition: lte-rlc.cc:232
virtual void DoNotifyHarqDeliveryFailure()
Definition: lte-rlc.cc:255
void SetRnti(uint16_t rnti)
Definition: lte-rlc.cc:126
LteRlcSapUser * m_rlcSapUser
Definition: lte-rlc.h:134
Ptr< SampleEmitter > s
void(* NotifyTxTracedCallback)(const uint16_t rnti, const uint8_t lcid, const uint32_t bytes)
TracedCallback signature for NotifyTxOpportunity events.
Definition: lte-rlc.h:112
virtual void DoDispose()
Destructor implementation.
Definition: lte-rlc.cc:118
virtual void DoTransmitPdcpPdu(Ptr< Packet > p)
Definition: lte-rlc.cc:208
LteMacSapUser * GetLteMacSapUser()
Definition: lte-rlc.cc:161
LteMacSapProvider * m_macSapProvider
Definition: lte-rlc.h:143
void ReportBufferStatus()
Definition: lte-rlc.cc:261
void(* ReceiveTracedCallback)(const uint16_t rnti, const uint8_t lcid, const uint32_t bytes, const uint64_t delay)
TracedCallback signature for.
Definition: lte-rlc.h:124
virtual void DoNotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId)=0
Every class exported by the ns3 library is enclosed in the ns3 namespace.
LteRlcSapProvider * m_rlcSapProvider
Definition: lte-rlc.h:135
void SetLteRlcSapUser(LteRlcSapUser *s)
Definition: lte-rlc.cc:140
void SetLcId(uint8_t lcId)
Definition: lte-rlc.cc:133
virtual void DoReceivePdu(Ptr< Packet > p)=0
virtual void DoNotifyHarqDeliveryFailure()=0
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:94
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:147
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:155
A base class which provides memory management and object aggregation.
Definition: object.h:87
virtual void DoTransmitPdcpPdu(Ptr< Packet > p)=0
virtual void DoInitialize()
Initialize() implementation.
Definition: lte-rlc.cc:194
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:51
LTE_RLC Saturation Mode (SM): simulation-specific mode used for experiments that do not need to consi...
Definition: lte-rlc.h:169
void SetLteMacSapProvider(LteMacSapProvider *s)
Definition: lte-rlc.cc:154
static TypeId GetTypeId(void)
Definition: lte-rlc.cc:101