22 #include <ns3/core-module.h>
23 #include <ns3/network-module.h>
24 #include <ns3/mobility-module.h>
25 #include <ns3/lte-module.h>
44 LteRrcConnectionEstablishmentTestCase (uint32_t nUes, uint32_t nBearers, uint32_t tc, uint32_t tConnIncrPerUe, uint32_t delayDiscStart,
bool useIdealRrc,
bool admitRrcConnectionRequest);
47 static std::string BuildNameString (uint32_t nUes, uint32_t nBearers, uint32_t tc, uint32_t tConnIncrPerUe, uint32_t delayDiscStart,
bool useIdealRrc,
bool admitRrcConnectionRequest);
48 virtual void DoRun (
void);
69 std::ostringstream oss;
70 oss <<
"nUes=" << nUes
71 <<
", nBearers=" << nBearers
72 <<
", tConnBase=" << tConnBase
73 <<
", tConnIncrPerUe=" << tConnIncrPerUe
74 <<
", delayDiscStart=" << delayDiscStart;
83 if (admitRrcConnectionRequest)
85 oss <<
", admitRrcConnectionRequest = true";
89 oss <<
", admitRrcConnectionRequest = false";
95 :
TestCase (BuildNameString (nUes, nBearers, tConnBase, tConnIncrPerUe, delayDiscStart, useIdealRrc, admitRrcConnectionRequest)),
97 m_nBearers (nBearers),
98 m_tConnBase (tConnBase),
99 m_tConnIncrPerUe (tConnIncrPerUe),
101 m_delayDiscStart (delayDiscStart),
103 m_useIdealRrc (useIdealRrc),
104 m_admitRrcConnectionRequest (admitRrcConnectionRequest)
108 double nRaAttempts = 0;
118 nRaAttempts += std::ceil (nUes / 4.0);
119 double dra = nRaAttempts * 7;
120 double dce = 10.0 + (2.0 * nUes) / 4.0;
142 double dcr = (10.0 + (2.0 * nUes) / 4.0) * (
m_nBearers + nCrs);
197 it != enbDevs.
End ();
217 tmax = std::max (tmax, tcd);
232 Simulator::Stop (MilliSeconds (tmax + 1));
236 Simulator::Destroy ();
268 uint16_t rnti = ueRrc->GetRnti ();
274 uint16_t ueCellId = ueRrc->GetCellId ();
275 uint16_t enbCellId = enbLteDevice->GetCellId ();
276 uint16_t ueImsi = ueLteDevice->
GetImsi ();
277 uint16_t enbImsi = ueManager->
GetImsi ();
278 uint8_t ueDlBandwidth = ueRrc->GetDlBandwidth ();
279 uint8_t enbDlBandwidth = enbLteDevice->GetDlBandwidth ();
280 uint8_t ueUlBandwidth = ueRrc->GetUlBandwidth ();
281 uint8_t enbUlBandwidth = enbLteDevice->GetUlBandwidth ();
282 uint8_t ueDlEarfcn = ueRrc->GetDlEarfcn ();
283 uint8_t enbDlEarfcn = enbLteDevice->GetDlEarfcn ();
284 uint8_t ueUlEarfcn = ueRrc->GetUlEarfcn ();
285 uint8_t enbUlEarfcn = enbLteDevice->GetUlEarfcn ();
296 ueManager->
GetAttribute (
"DataRadioBearerMap", enbDataRadioBearerMapValue);
300 ueRrc->GetAttribute (
"DataRadioBearerMap", ueDataRadioBearerMapValue);
305 while (enbBearerIt != enbDataRadioBearerMapValue.
End ()
306 && ueBearerIt != ueDataRadioBearerMapValue.End ())
320 NS_ASSERT_MSG (enbBearerIt == enbDataRadioBearerMapValue.
End (),
"too many bearers at eNB");
321 NS_ASSERT_MSG (ueBearerIt == ueDataRadioBearerMapValue.End (),
"too many bearers at UE");
339 for (uint32_t useIdealRrc = 0; useIdealRrc <= 1; ++useIdealRrc)
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
uint32_t m_tConnIncrPerUe
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void CheckConnected(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice)
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
Ptr< LteUeRrc > GetRrc() const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void Connect(std::string path, const CallbackBase &cb)
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Call ActivateDataRadioBearer (ueDevice, bearer) for each UE device in a given set.
std::map< uint32_t, Ptr< Object > >::const_iterator Iterator
This class contains the specification of EPS Bearers.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
store information on active data radio bearer instance
uint8_t m_logicalChannelIdentity
Ptr< LteHelper > m_lteHelper
Hold an unsigned integer type.
#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.
holds a vector of ns3::NetDevice pointers
bool m_admitRrcConnectionRequest
static std::string BuildNameString(uint32_t nUes, uint32_t nBearers, uint32_t tc, uint32_t tConnIncrPerUe, uint32_t delayDiscStart, bool useIdealRrc, bool admitRrcConnectionRequest)
uint32_t m_delayDiscStart
LteRrcConnectionEstablishmentTestCase(uint32_t nUes, uint32_t nBearers, uint32_t tc, uint32_t tConnIncrPerUe, uint32_t delayDiscStart, bool useIdealRrc, bool admitRrcConnectionRequest)
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
void SetDefault(std::string name, const AttributeValue &value)
keep track of a set of node pointers.
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
Iterator Begin(void) const
void GetAttribute(std::string name, AttributeValue &value) const
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
uint64_t GetImsi(void) const
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
NetDeviceContainer InstallUeDevice(NodeContainer c)
create a set of UE devices
Helper class used to assign positions and mobility models to nodes.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not...
static LteRrcTestSuite g_lteRrcTestSuiteInstance
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
void Connect(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice)
std::string GetName(void) const
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
uint32_t GetN(void) const
contain a set of ns3::Object pointers.
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
void SetAttribute(std::string name, const AttributeValue &value)
The eNodeB device implementation.
Ptr< T > GetObject(void) const
uint8_t m_epsBearerIdentity
virtual void DoRun(void)
Implementation to actually run this TestCase.
The LteUeNetDevice class implements the UE net device.