|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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"
56 double losses[] = {0.0, 0.10, 0.25, 0.50, 0.75, 0.90, 1.00};
57 uint32_t seeds[] = {1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 10101};
59 for ( uint32_t l = 0 ; l < (
sizeof (losses) /
sizeof (
double)) ; l++ )
61 for ( uint32_t s = 0 ; s < (
sizeof (seeds) /
sizeof (uint32_t)) ; s++ )
63 std::ostringstream name;
64 name <<
" Losses = " << losses[l] <<
"%. Seed = " << seeds[s];
68 testDuration = TestCase::QUICK;
72 testDuration = TestCase::EXTENSIVE;
120 uint16_t numberOfNodes = 1;
135 RngSeedManager::SetSeed (
m_seed);
146 enbNodes.
Create (numberOfNodes);
147 ueNodes.
Create (numberOfNodes);
180 lteSimpleHelper->
m_enbRrc->SetPduSize (100);
189 lteSimpleHelper->
m_ueRrc->SetPduSize (100);
197 Simulator::Schedule (
Seconds (0.100), &LteTestRrc::Start, lteSimpleHelper->
m_enbRrc);
198 Simulator::Schedule (
Seconds (10.100), &LteTestRrc::Stop, lteSimpleHelper->
m_enbRrc);
201 Simulator::Schedule (
Seconds (20.100), &LteTestRrc::Start, lteSimpleHelper->
m_ueRrc);
202 Simulator::Schedule (
Seconds (30.100), &LteTestRrc::Stop, lteSimpleHelper->
m_ueRrc);
205 Simulator::Stop (
Seconds (31.000));
208 uint32_t txEnbRrcPdus = lteSimpleHelper->
m_enbRrc->GetTxPdus ();
209 uint32_t rxUeRrcPdus = lteSimpleHelper->
m_ueRrc->GetRxPdus ();
211 uint32_t txUeRrcPdus = lteSimpleHelper->
m_ueRrc->GetTxPdus ();
212 uint32_t rxEnbRrcPdus = lteSimpleHelper->
m_enbRrc->GetRxPdus ();
229 "Downlink: TX PDUs (" << txEnbRrcPdus <<
") != RX PDUs (" << rxUeRrcPdus <<
") + DROPS (" <<
m_dlDrops <<
")");
231 "Uplink: TX PDUs (" << txUeRrcPdus <<
") != RX PDUs (" << rxEnbRrcPdus <<
") + DROPS (" <<
m_ulDrops <<
")");
233 Simulator::Destroy ();
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
void SetTxOppTime(Time txOppTime)
Set transmit opportunity time.
Ptr< LteTestRrc > m_enbRrc
ENB RRC.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetTxOpportunityMode(uint8_t mode)
Set transmit opportunity mode.
static LteRlcUmE2eTestSuite lteRlcUmE2eTestSuite
Hold objects of type Ptr<T>.
Test suite for RlcUmE2eTestCase.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
uint32_t m_ulDrops
number of UL drops
Test end-to-end flow when RLC UM is being used.
void DlDropEvent(Ptr< const Packet > p)
DL drop event.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
TestDuration
How long the test takes to execute.
Ptr< LteTestMac > m_enbMac
ENB MAC.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< LteTestRrc > m_ueRrc
UE RRC.
virtual void DoRun(void)
Implementation to actually run this TestCase.
NetDeviceContainer InstallUeDevice(NodeContainer c)
create a set of UE devices
uint32_t m_seed
random number seed
virtual ~LteRlcUmE2eTestCase()
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Hold variables of type string.
#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.
void UlDropEvent(Ptr< const Packet > p)
UL drop event.
Time Seconds(double value)
Construct a Time in the indicated unit.
keep track of a set of node pointers.
Ptr< LteTestMac > m_ueMac
UE MAC.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
void SetTxOppSize(uint32_t txOppSize)
Set transmit opportunity time.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
double m_losses
error rate
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
LteRlcUmE2eTestSuite()
Test x.x.x RLC UM: End-to-end flow.
uint32_t m_dlDrops
number of Dl drops