21 #include "ns3/config.h"
22 #include "ns3/simulator.h"
23 #include "ns3/pointer.h"
25 #include "ns3/packet.h"
26 #include "ns3/node-container.h"
27 #include "ns3/net-device-container.h"
28 #include "ns3/error-model.h"
29 #include "ns3/rng-seed-manager.h"
30 #include "ns3/radio-bearer-stats-calculator.h"
31 #include "ns3/lte-rlc-header.h"
32 #include "ns3/lte-rlc-um.h"
57 double losses[] = {0.0, 0.10, 0.25, 0.50, 0.75, 0.90, 1.00};
58 uint32_t seeds[] = {1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 10101};
60 for ( uint32_t l = 0 ; l < (
sizeof (losses) /
sizeof (
double)) ; l++ )
62 for ( uint32_t
s = 0 ;
s < (
sizeof (seeds) /
sizeof (uint32_t)) ;
s++ )
64 std::ostringstream name;
65 name <<
" Losses = " << losses[l] <<
"%. Seed = " << seeds[
s];
121 uint16_t numberOfNodes = 1;
142 lteSimpleHelper->SetAttribute (
"RlcEntity",
StringValue (
"RlcUm"));
147 enbNodes.
Create (numberOfNodes);
148 ueNodes.
Create (numberOfNodes);
167 dlEm->SetAttribute (
"ErrorUnit",
StringValue (
"ERROR_UNIT_PACKET"));
171 ulEm->SetAttribute (
"ErrorUnit",
StringValue (
"ERROR_UNIT_PACKET"));
174 ueLteDevs.
Get (0)->SetAttribute (
"ReceiveErrorModel",
PointerValue (dlEm));
176 enbLteDevs.
Get (0)->SetAttribute (
"ReceiveErrorModel",
PointerValue (ulEm));
180 lteSimpleHelper->m_enbRrc->SetArrivalTime (Seconds (0.010));
181 lteSimpleHelper->m_enbRrc->SetPduSize (100);
184 lteSimpleHelper->m_enbMac->SetTxOppSize (150);
185 lteSimpleHelper->m_enbMac->SetTxOppTime (Seconds (0.005));
189 lteSimpleHelper->m_ueRrc->SetArrivalTime (Seconds (0.010));
190 lteSimpleHelper->m_ueRrc->SetPduSize (100);
193 lteSimpleHelper->m_ueMac->SetTxOppSize (150);
194 lteSimpleHelper->m_ueMac->SetTxOppTime (Seconds (0.005));
209 uint32_t txEnbRrcPdus = lteSimpleHelper->m_enbRrc->GetTxPdus ();
210 uint32_t rxUeRrcPdus = lteSimpleHelper->m_ueRrc->GetRxPdus ();
212 uint32_t txUeRrcPdus = lteSimpleHelper->m_ueRrc->GetTxPdus ();
213 uint32_t rxEnbRrcPdus = lteSimpleHelper->m_enbRrc->GetRxPdus ();
230 "Downlink: TX PDUs (" << txEnbRrcPdus <<
") != RX PDUs (" << rxUeRrcPdus <<
") + DROPS (" <<
m_dlDrops <<
")");
232 "Uplink: TX PDUs (" << txUeRrcPdus <<
") != RX PDUs (" << rxEnbRrcPdus <<
") + DROPS (" <<
m_ulDrops <<
")");
hold variables of type string
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
static void Run(void)
Run the simulation until one of:
Test x.x.x RLC UM: End-to-end flow.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
void UlDropEvent(Ptr< const Packet > p)
LteRlcUmE2eTestSuite()
Test x.x.x RLC UM: End-to-end flow.
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
static LteRlcUmE2eTestSuite lteRlcUmE2eTestSuite
TestDuration
How long the test takes to execute.
keep track of a set of node pointers.
void DlDropEvent(Ptr< const Packet > p)
NS_LOG_COMPONENT_DEFINE("LteRlcUmE2eTest")
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
static void SetSeed(uint32_t seed)
set the seed it will duplicate the seed value 6 times
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
virtual ~LteRlcUmE2eTestCase()
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Hold a floating point type.
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.