A Discrete-Event Network Simulator
API
lte-test-entities.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: Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 #ifndef LTE_TEST_ENTITIES_H
22 #define LTE_TEST_ENTITIES_H
23 
24 #include "ns3/simulator.h"
25 #include "ns3/test.h"
26 
27 #include "ns3/lte-mac-sap.h"
28 #include "ns3/lte-rlc-sap.h"
29 #include "ns3/lte-pdcp-sap.h"
30 
31 #include "ns3/net-device.h"
32 #include <ns3/epc-enb-s1-sap.h>
33 
34 namespace ns3 {
35 
39 class LteTestRrc : public Object
40 {
42 // friend class EnbMacMemberLteEnbCmacSapProvider;
43 // friend class EnbMacMemberLteMacSapProvider<LteTestMac>;
44 // friend class EnbMacMemberFfMacSchedSapUser;
45 // friend class EnbMacMemberFfMacCschedSapUser;
46 // friend class EnbMacMemberLteEnbPhySapUser;
47 
48  public:
49  static TypeId GetTypeId (void);
50 
51  LteTestRrc (void);
52  virtual ~LteTestRrc (void);
53  virtual void DoDispose (void);
54 
55 
66 
67  void Start ();
68  void Stop ();
69 
70  void SendData (Time at, std::string dataToSend);
71  std::string GetDataReceived (void);
72 
73  // Stats
74  uint32_t GetTxPdus (void);
75  uint32_t GetTxBytes (void);
76  uint32_t GetRxPdus (void);
77  uint32_t GetRxBytes (void);
78 
79  Time GetTxLastTime (void);
80  Time GetRxLastTime (void);
81 
82  void SetArrivalTime (Time arrivalTime);
83  void SetPduSize (uint32_t pduSize);
84 
85  void SetDevice (Ptr<NetDevice> device);
86 
87  private:
88  // Interface forwarded by LtePdcpSapUser
90 
93 
94  std::string m_receivedData;
95 
96  uint32_t m_txPdus;
97  uint32_t m_txBytes;
98  uint32_t m_rxPdus;
99  uint32_t m_rxBytes;
102 
105  uint32_t m_pduSize;
106 
108 };
109 
111 
115 class LteTestPdcp : public Object
116 {
118 
119  public:
120  static TypeId GetTypeId (void);
121 
122  LteTestPdcp (void);
123  virtual ~LteTestPdcp (void);
124  virtual void DoDispose (void);
125 
126 
137 
138  void Start ();
139 
140  void SendData (Time time, std::string dataToSend);
141  std::string GetDataReceived (void);
142 
143  private:
144  // Interface forwarded by LteRlcSapUser
145  virtual void DoReceivePdcpPdu (Ptr<Packet> p);
146 
149 
150  std::string m_receivedData;
151 };
152 
154 
158 class LteTestMac : public Object
159 {
160 // friend class EnbMacMemberLteEnbCmacSapProvider;
162 // friend class EnbMacMemberFfMacSchedSapUser;
163 // friend class EnbMacMemberFfMacCschedSapUser;
164 // friend class EnbMacMemberLteEnbPhySapUser;
165 
166  public:
167  static TypeId GetTypeId (void);
168 
169  LteTestMac (void);
170  virtual ~LteTestMac (void);
171  virtual void DoDispose (void);
172 
173  void SetDevice (Ptr<NetDevice> device);
174 
175  void SendTxOpportunity (Time, uint32_t);
176  std::string GetDataReceived (void);
177 
178  bool Receive (Ptr<NetDevice> nd, Ptr<const Packet> p, uint16_t protocol, const Address& addr);
179 
190 
196 
200  void SetPdcpHeaderPresent (bool present);
201 
205  void SetRlcHeaderType (uint8_t rlcHeaderType);
206 
207  typedef enum {
210  } RlcHeaderType_t;
211 
215  void SetTxOpportunityMode (uint8_t mode);
216 
217  typedef enum {
222 
223  void SetTxOppTime (Time txOppTime);
224  void SetTxOppSize (uint32_t txOppSize);
225 
226  // Stats
227  uint32_t GetTxPdus (void);
228  uint32_t GetTxBytes (void);
229  uint32_t GetRxPdus (void);
230  uint32_t GetRxBytes (void);
231 
232  private:
233  // forwarded from LteMacSapProvider
236 
240 
241  std::string m_receivedData;
242 
246 
248 
249  // TxOpportunity configuration
252  uint32_t m_txOppSize;
253  std::list<EventId> m_nextTxOppList;
254 
255  // Stats
256  uint32_t m_txPdus;
257  uint32_t m_txBytes;
258  uint32_t m_rxPdus;
259  uint32_t m_rxBytes;
260 
261 };
262 
263 
264 
269 class EpcTestRrc : public Object
270 {
272 
273 public:
274  EpcTestRrc ();
275  virtual ~EpcTestRrc ();
276 
277  // inherited from Object
278  virtual void DoDispose (void);
279  static TypeId GetTypeId (void);
280 
287 
293 
294 private:
295 
296  // S1 SAP methods
299 
302 
303 
304 };
305 
306 
307 } // namespace ns3
308 
309 #endif /* LTE_TEST_MAC_H */
Time GetTxLastTime(void)
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
Time GetRxLastTime(void)
Parameters passed to DataRadioBearerSetupRequest ()
Template for the implementation of the EpcEnbS1SapUser as a member of an owner class of type C to whi...
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication...
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
LteRlcSapUser * m_rlcSapUser
uint32_t GetTxBytes(void)
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void SetPduSize(uint32_t pduSize)
std::string m_receivedData
static TypeId GetTypeId(void)
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication...
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
static TypeId GetTypeId(void)
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters)
virtual void DoDispose(void)
Destructor implementation.
LteMacSapProvider * m_macSapProvider
virtual void DoDispose(void)
Destructor implementation.
void SetTxOpportunityMode(uint8_t mode)
void SetLteMacLoopback(Ptr< LteTestMac > s)
Set the other side of the MAC Loopback.
virtual void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
PDCP SAP.
EpcEnbS1SapUser * m_s1SapUser
a polymophic address class
Definition: address.h:90
virtual ~LteTestPdcp(void)
EpcEnbS1SapProvider * m_s1SapProvider
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:66
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Definition: lte-pdcp-sap.h:76
void SetLteMacSapUser(LteMacSapUser *s)
Set the MAC SAP user.
LtePdcpSapUser * m_pdcpSapUser
LtePdcpSapProvider * m_pdcpSapProvider
static TypeId GetTypeId(void)
LtePdcpSapUser * GetLtePdcpSapUser(void)
Get the PDCP SAP user.
void Start()
START.
void SendData(Time at, std::string dataToSend)
void SetLteRlcSapProvider(LteRlcSapProvider *s)
Set the RLC SAP provider.
Ptr< NetDevice > m_device
uint32_t GetTxBytes(void)
void SetS1SapProvider(EpcEnbS1SapProvider *s)
Set the S1 SAP Provider.
uint32_t GetRxPdus(void)
void SetTxOppTime(Time txOppTime)
uint32_t GetRxPdus(void)
EpcEnbS1SapUser * GetS1SapUser()
LteRlcSapProvider * m_rlcSapProvider
RRC stub providing a testing S1 SAP user to be used with the EpcEnbApplication.
uint32_t GetTxPdus(void)
virtual ~LteTestRrc(void)
LteMacSapProvider * GetLteMacSapProvider(void)
Get the MAC SAP provider.
virtual void DoDispose(void)
Destructor implementation.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
This class implements a testing PDCP entity.
std::string m_receivedData
void SetArrivalTime(Time arrivalTime)
uint32_t GetTxPdus(void)
std::string m_receivedData
std::string GetDataReceived(void)
void SetTxOppSize(uint32_t txOppSize)
virtual void DoDispose(void)
Destructor implementation.
Ptr< NetDevice > m_device
void DoPathSwitchRequestAcknowledge(EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params)
void SendTxOpportunity(Time, uint32_t)
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36.323 Packet Data Convergence Protocol (PDCP) specification.
Definition: lte-pdcp-sap.h:35
An identifier for simulation events.
Definition: event-id.h:53
std::string GetDataReceived(void)
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 PDCP entity to the RRC entity See 3GPP 36.323 Packet Data Convergence Protocol (PDCP) specification.
Definition: lte-pdcp-sap.h:68
void SetDevice(Ptr< NetDevice > device)
std::list< EventId > m_nextTxOppList
void SendData(Time time, std::string dataToSend)
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
std::string GetDataReceived(void)
uint32_t GetRxBytes(void)
This class implements a testing loopback MAC layer.
uint32_t GetRxBytes(void)
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters)
MAC SAP.
A base class which provides memory management and object aggregation.
Definition: object.h:87
void DoDataRadioBearerSetupRequest(EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters params)
virtual ~LteTestMac(void)
void SetPdcpHeaderPresent(bool present)
Ptr< LteTestMac > m_macLoopback
a unique identifier for an interface.
Definition: type-id.h:58
void SetDevice(Ptr< NetDevice > device)
LteMacSapUser * m_macSapUser
virtual void DoReceivePdcpPdu(Ptr< Packet > p)
RLC SAP.
void SetLtePdcpSapProvider(LtePdcpSapProvider *s)
Set the PDCP SAP provider.
static TypeId GetTypeId(void)
void SetRlcHeaderType(uint8_t rlcHeaderType)
This class implements a testing RRC entity.
bool Receive(Ptr< NetDevice > nd, Ptr< const Packet > p, uint16_t protocol, const Address &addr)
LteRlcSapUser * GetLteRlcSapUser(void)
Get the RLC SAP user.
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45