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);
187 enbDevs =
m_lteHelper->InstallEnbDevice (enbNodes);
197 it != enbDevs.
End ();
217 tmax = std::max (tmax, tcd);
249 m_lteHelper->ActivateDataRadioBearer (ueDevice, bearer);
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 ())
311 NS_TEST_ASSERT_MSG_EQ ((uint32_t) enbDrbInfo->m_epsBearerIdentity, (uint32_t) ueDrbInfo->m_epsBearerIdentity,
"epsBearerIdentity differs");
312 NS_TEST_ASSERT_MSG_EQ ((uint32_t) enbDrbInfo->m_drbIdentity, (uint32_t) ueDrbInfo->m_drbIdentity,
"drbIdentity differs");
314 NS_TEST_ASSERT_MSG_EQ ((uint32_t) enbDrbInfo->m_logicalChannelIdentity, (uint32_t) ueDrbInfo->m_logicalChannelIdentity,
"logicalChannelIdentity differs");
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.
virtual void DoRun(void)
Implementation to actually run this TestCase.
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
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.
uint32_t m_delayDiscStart
#define NS_ASSERT(condition)
static void Run(void)
Run the simulation until one of:
#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 EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
NS_LOG_COMPONENT_DEFINE("LteRrcTest")
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
Hold an unsigned integer type.
Ptr< LteHelper > m_lteHelper
holds a vector of ns3::NetDevice pointers
void Connect(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice)
#define NS_LOG_LOGIC(msg)
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
void SetDefault(std::string name, const AttributeValue &value)
keep track of a set of node pointers.
static LteRrcTestSuite g_lteRrcTestSuiteInstance
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 AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
#define NS_ASSERT_MSG(condition, message)
Helper class used to assign positions and mobility models to nodes.
bool m_admitRrcConnectionRequest
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
std::vector< Ptr< NetDevice > >::const_iterator Iterator
std::string GetName(void) const
LteRrcConnectionEstablishmentTestCase(uint32_t nUes, uint32_t nBearers, uint32_t tc, uint32_t tConnIncrPerUe, uint32_t delayDiscStart, bool useIdealRrc, bool admitRrcConnectionRequest)
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.
uint32_t m_tConnIncrPerUe
static std::string BuildNameString(uint32_t nUes, uint32_t nBearers, uint32_t tc, uint32_t tConnIncrPerUe, uint32_t delayDiscStart, bool useIdealRrc, bool admitRrcConnectionRequest)
The eNodeB device implementation.
void CheckConnected(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice)
#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.
The LteUeNetDevice class implements the UE net device.