From 70970ce41826ca7685dceb81521b9325e6208255 Mon Sep 17 00:00:00 2001 From: Budiarto Herman Date: Sun, 15 Sep 2013 20:54:03 +0300 Subject: [PATCH] Revamped lte-cell-selection test suite with better success probability --- doc/models/Makefile | 6 +- src/lte/doc/Makefile | 3 +- .../lte-cell-selection-closed-access.dia | Bin 2187 -> 0 bytes .../lte-cell-selection-open-access.dia | Bin 2006 -> 0 bytes .../figures/lte-cell-selection-scenario.dia | Bin 0 -> 3869 bytes src/lte/doc/source/lte-references.rst | 2 - src/lte/doc/source/lte-testing.rst | 61 +-- src/lte/test/lte-test-cell-selection.cc | 348 ++++++++---------- src/lte/test/lte-test-cell-selection.h | 70 ++-- 9 files changed, 194 insertions(+), 296 deletions(-) delete mode 100644 src/lte/doc/source/figures/lte-cell-selection-closed-access.dia delete mode 100644 src/lte/doc/source/figures/lte-cell-selection-open-access.dia create mode 100644 src/lte/doc/source/figures/lte-cell-selection-scenario.dia diff --git a/doc/models/Makefile b/doc/models/Makefile index a25dc919e..19319ded0 100644 --- a/doc/models/Makefile +++ b/doc/models/Makefile @@ -117,8 +117,7 @@ SOURCEFIGS = \ $(SRC)/lte/doc/source/figures/ue-meas-piecewise-a1.dia \ $(SRC)/lte/doc/source/figures/ue-meas-piecewise-a1-hys.dia \ $(SRC)/lte/doc/source/figures/lte-cell-selection.dia \ - $(SRC)/lte/doc/source/figures/lte-cell-selection-open-access.dia \ - $(SRC)/lte/doc/source/figures/lte-cell-selection-closed-access.dia \ + $(SRC)/lte/doc/source/figures/lte-cell-selection-scenario.dia \ $(SRC)/lte/doc/source/figures/lte-handover-target-scenario.dia \ $(SRC)/lte/doc/source/figures/lena-dual-stripe.eps \ $(SRC)/lte/doc/source/figures/lte-mcs-index.eps \ @@ -259,8 +258,7 @@ IMAGES_EPS = \ $(FIGURES)/ue-meas-piecewise-a1.eps \ $(FIGURES)/ue-meas-piecewise-a1-hys.eps \ $(FIGURES)/lte-cell-selection.eps \ - $(FIGURES)/lte-cell-selection-open-access.eps \ - $(FIGURES)/lte-cell-selection-closed-access.eps \ + $(FIGURES)/lte-cell-selection-scenario.eps \ $(FIGURES)/lte-handover-target-scenario.eps \ $(FIGURES)/lena-dual-stripe.eps \ $(FIGURES)/lte-mcs-index.eps \ diff --git a/src/lte/doc/Makefile b/src/lte/doc/Makefile index 894819d9a..7ddc3aae6 100644 --- a/src/lte/doc/Makefile +++ b/src/lte/doc/Makefile @@ -38,8 +38,7 @@ IMAGES_DIA = \ $(FIGURES)/ue-meas-piecewise-a1.dia \ $(FIGURES)/ue-meas-piecewise-a1-hys.dia \ $(FIGURES)/lte-cell-selection.dia \ - $(FIGURES)/lte-cell-selection-open-access.dia \ - $(FIGURES)/lte-cell-selection-closed-access.dia \ + $(FIGURES)/lte-cell-selection-scenario.dia \ $(FIGURES)/lte-handover-target-scenario.dia diff --git a/src/lte/doc/source/figures/lte-cell-selection-closed-access.dia b/src/lte/doc/source/figures/lte-cell-selection-closed-access.dia deleted file mode 100644 index 52b593607f5bd11fc97bbb50ab603bbc101afe55..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2187 zcmV;62z2)!iwFP!000021MOW~bE7sCe$TI9ysr+H5Ry>cWM_A$m#4PVZl5!R&0vyLSz61~(ykaI7+u|Ha*7qIp=?H#&|8)^qk0MU|D7@=I8}uv@j-!bm z&hC1DfByN_>%G6f`Ela&ALP$0<_k-n5hm)@U2mSI%O3`Vr>7@7SSLJS!mF^zp<>B1|~e^>b>G!o~E%sTBX7Y`9j?FMtuBb7Duaa(#uN~<;GDE#nvMa z?t1U0+0h#mW(GTUPS{@ZnHa@_e>rX%$b+#erk5h#H@jFyi7$(!>*Ya_BX-p97iEf4 zi7XV(?%#cI-{n;*-q_kItLRZD>4L{IKRom!`zFXc!m&Naab#y;<}pBB3O9Z7dUvCC z-39Hsi`#YQClAXgPGjz;hb~7^6bK&XUekCbs{2XCJdi`|RI_TdV(O=9bf*4O9we7E zAb0I5mgYsV!MR@FFL!Cj&!*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9 ze2&lD%rkYocINn(0sac+_|S%s%Bd9dj*uUFu{gPx(?@ zq_(mWB{0yA(9y3Fxi_-2L_8I-kXImvnOb0`-9c&Yl=w}VDSsXCwTSO;@)z=F7W2jZ N&Hs>6PU=OL001AtI2Ql_ diff --git a/src/lte/doc/source/figures/lte-cell-selection-open-access.dia b/src/lte/doc/source/figures/lte-cell-selection-open-access.dia deleted file mode 100644 index c3f851cdf1a495c3d24ca8edcc5301a9e4fa1a85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2006 zcmV;{2Pya;iwFP!000021MQt#bJ{o*$KUfQJoGg&mSo+UCY`pk``F#tZJ#p&6wub# zjBS##5Bu3yGIy}K_|`(jOxnT7=SV{T-;s}H@$UWiap1hjI8jmf&;hR3ab(z!1}Ypr zbiRK1{f>3sKi<3>DDhVR4P!BO^ci7d-aT|iX*zk^?Y_Rgy1^_FX%xGGn!1VX{wIP! zbakO_=kdmIHVq6!D$KFPQIV#x>P=JWgkmfoIz7? zJZG;?cVVWxW#@qHi5SXWEXB8C)1H2DUdHr9#=B<6lPFQTNIIMB6)CV|{@p0ED3$0! z;qdXz2mj5yN{a()TX_{NbdrumJXGPnAKf>>yd$8?AcVRzFlXGOJ_XA@Ip1BcU3Wpd z?&5acspM%A#c3>5y6>_VMS&FI+-n+7WqChIUj%xH9cosERy?aTjgHj+Sp>-`4VWKZ zsqI|l4r4VqEZnUU1y)|wARRq@Z>YQG)@Kb_e^H6*1v0PpDokrLKdZ<5?zfZCdwqJv z(J;4G7#;>pVu{ZW55uV%$mGZ{+b&aJX|yQTJ=W{H@IbV}nB8R1<{U4MPu}Zpf zC4H9ZYZQOeLi#8Y>1bi4DpyT@&>K0KFs+b_R@vyoK8QCjTHcPZa`v5IV& z9#rDILFHULs~|YR#rDmE^IW9zdwOhu?UX6PMwYYXS| z^W2%^&a)V+V5Vy&WA)r|l5}R$IT|DLbHAvuOz!@Q#vMqE)y zbveh?{OpFAlLmMhM_fIXTrsS=G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A9RRg!3Yx**+w zjQs23OA{jte@5n^8JU@1V{W-vbmroA%X^NFOF?0efRY?~PgE!b{i^gU)A53_T7Kc~^t!pvJK_ma#)35!)tS0|BDnpQh7v zxx9VK9UhIA#x8Ji1c0Q_kfb95kTh&a(*BUdfQDr=yVSv(aNtUNG0HmV> z5(7XQG$3*RIzVH_1nr4u#upBhh&B(#Wy5kHsKfz*LL<-`_W=eS6@xCNbwN*9>fb;* zY&OOWUwNGN@D7WlL-9E=0BLX_W#C)_j-CgO`nPG;QAm^23}0EKw6;ixVvsVx(cp~{ zS6B~l6max(IO<*Ei&@xqCwBZg2U1(4cqk?*0VoaLop6==080T&Plu&F6gCqQw6d90 zNc!s94+Tgm0BL9-U1dGMQNYpD;i!M-Y#sItCOdxR-Q(K3Cqr@X1wd(Vn^dnIk_A`_ zSb8cf_1-fUJ8@XLheC)FM7EAd+uv7w;2KVt-xeu@uu=I3T>fhntfSU+OD080T&Plu)6Tb?M5Lb~{7_{zhlwTG{uOdo)>iS+`_ diff --git a/src/lte/doc/source/lte-testing.rst b/src/lte/doc/source/lte-testing.rst index 385a93311..2a45d7241 100644 --- a/src/lte/doc/source/lte-testing.rst +++ b/src/lte/doc/source/lte-testing.rst @@ -1019,67 +1019,30 @@ Initial cell selection ---------------------- The test suite `lte-cell-selection` is responsible for verifying the -:ref:`sec-initial-cell-selection` procedure. Included in the suite are 3 short -test cases using ideal RRC protocol and the same test cases but using real RRC -protocol. +:ref:`sec-initial-cell-selection` procedure. The test is a simulation of a small +etwork of 4 non-CSG cells and 2 non-CSG cells. Several static UEs are then +placed at predefined locations and with initial cell selection procedure +enabled. Thus the UEs enters the simulation without being attached to any cell. -Each test case is a simulation of a small network of 4 cells. Each eNodeB is -equipped with directional antenna (parabolic model) and is arranged so that some -of their coverage are overlapping with other eNodeB. They are configured using -the same Tx Power. Several static UEs are then placed at predefined locations -and with initial cell selection procedure enabled. Thus the UEs enters the -simulation without being attached to any cell. +At predefined check point times during the simulation, the test verifies that +every UE is attached to the right cell. Moreover, the test also ensures that the +UE is properly connected, i.e., its final state is `CONNECTED_NORMALLY`. Figure +:ref:`fig-lte-cell-selection-scenario` depicts the network layout and the +expected result. -At the end of the simulation, the test verifies that every UE is attached to the -right cell. Moreover, the test also ensures that the UE is properly connected -(i.e. its final state is `CONNECTED_NORMALLY`). +.. _fig-lte-cell-selection-scenario: -The first test case is a scenario with open access cells, i.e. without Closed -Subscriber Group (CSG). The result shows that the UEs are attaching to the -expected cells, as shown in Figure :ref:`fig-lte-cell-selection-open-access` -below. Note that the grey area below each eNodeB only indicates the rough -directivity of the antenna, while the actual cell coverage is much wider and -larger. - -.. _fig-lte-cell-selection-open-access: - -.. figure:: figures/lte-cell-selection-open-access.* +.. figure:: figures/lte-cell-selection-scenario.* :scale: 80 % :align: center - Sample result of cell selection in open access scenario - -The second and third cases incorporate CSG into the simulation. 2 out of 4 cells -become a single CSG and implement closed access, while the other 2 cells stay -open. In a similar way, half of the UEs are configured as members of the CSG, -while the rest are not. The resulting simulation is depicted in Figure -:ref:`fig-lte-cell-selection-closed-access` below. - -.. _fig-lte-cell-selection-closed-access: - -.. figure:: figures/lte-cell-selection-closed-access.* - :scale: 80 % - :align: center - - Sample result of cell selection in closed access scenario + Sample result of cell selection test It shows that CSG members may attach to either CSG or non-CSG cells, and simply choose the stronger one. On the other hand, non-members can only attach to non-CSG cells, even when they are actually receiving stronger signal from a CSG cell. -The CSG scenario reveals an interference issue experienced by the UE highlighted -in the figure above. The UE is positioned within the coverage of a CSG cell but -it is not a member of the CSG. The CSG cell becomes a source of major -interference to the UE and causing difficulties (i.e. low SINR) to the UE in its -attempt to attach (i.e. receiving MIB and SIB1) to the closest non-CSG cell. - -A real life CSG deployment typically implements interference coordination to -remedy such issue. Section 5.1 of [TS36922]_ describes frequency, time, and -spatial partitioning as possible approaches to interference coordination. -However, none of these approaches are implemented in this test suite. - - GTP-U protocol -------------- diff --git a/src/lte/test/lte-test-cell-selection.cc b/src/lte/test/lte-test-cell-selection.cc index 246da7910..7d0472f71 100644 --- a/src/lte/test/lte-test-cell-selection.cc +++ b/src/lte/test/lte-test-cell-selection.cc @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -55,92 +56,50 @@ namespace ns3 { LteCellSelectionTestSuite::LteCellSelectionTestSuite () : TestSuite ("lte-cell-selection", SYSTEM) { - // LogComponentEnable ("LteCellSelectionTest", LOG_PREFIX_ALL); - // LogComponentEnable ("LteCellSelectionTest", LOG_FUNCTION); - // LogComponentEnable ("LteSpectrumPhy", LOG_PREFIX_ALL); - // LogComponentEnable ("LteSpectrumPhy", LOG_DEBUG); + //LogComponentEnable ("LteCellSelectionTest", LOG_PREFIX_ALL); + //LogComponentEnable ("LteCellSelectionTest", LOG_FUNCTION); + //LogComponentEnable ("LteCellSelectionTest", LOG_INFO); + //LogComponentEnable ("LteSpectrumPhy", LOG_PREFIX_ALL); + //LogComponentEnable ("LteSpectrumPhy", LOG_DEBUG); - std::vector x; + std::ostringstream oss; + std::vector w; - /* - * <-- <-- - * ue1---CELL3 ue2---CELL4 ue3 - * / / - * / / - * / --> --> / - * ue4 CELL1---ue5 CELL2---ue6 - */ - x.clear (); // position x y z, csg expectedCellId - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (-80, 20, 0), 0, 3)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector ( 80, 20, 0), 0, 4)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (240, 20, 0), 0, 2)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (-80, 10, 0), 0, 3)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector ( 80, 10, 0), 0, 1)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (240, 10, 0), 0, 2)); - AddTestCase (new LteCellSelectionTestCase ("[EPC, ideal RRC] Open access", - true, true, false, x, - MilliSeconds (261)), - TestCase::QUICK); - AddTestCase (new LteCellSelectionTestCase ("[EPC, real RRC] Open access", - true, false, false, x, - MilliSeconds (279)), + w.clear (); + // x y csgMember + // checkPoint cell1, cell2 + w.push_back (LteCellSelectionTestCase::UeSetup_t (0.0, 1.55, false, + MilliSeconds (266), 1, 0)); + w.push_back (LteCellSelectionTestCase::UeSetup_t (0.0, 1.45, false, + MilliSeconds (266), 1, 0)); + w.push_back (LteCellSelectionTestCase::UeSetup_t (0.5, 2.0, false, + MilliSeconds (266), 1, 4)); + w.push_back (LteCellSelectionTestCase::UeSetup_t (0.5, 1.45, false, + MilliSeconds (341), 1, 4)); + w.push_back (LteCellSelectionTestCase::UeSetup_t (0.5, 0.55, true, + MilliSeconds (266), 2, 5)); + w.push_back (LteCellSelectionTestCase::UeSetup_t (0.5, 0.0, true, + MilliSeconds (266), 3, 6)); + w.push_back (LteCellSelectionTestCase::UeSetup_t (1.0, 0.55, true, + MilliSeconds (266), 5, 0)); + w.push_back (LteCellSelectionTestCase::UeSetup_t (1.0, 0.45, true, + MilliSeconds (266), 6, 0)); + + AddTestCase (new LteCellSelectionTestCase ("EPC, ideal RRC, RngNum=1", + true, true, + 60.0, 20.0, w, 1), + // isd txpow rngrun TestCase::QUICK); - /* - * <-- <-- - * ue1---CELL3 ue2---CELL4 ue3 - * (1) (1) (1) / (0) /(1) - * / / - * --> / --> / - * ue4 CELL1 ue5 CELL2---ue6 - * (0) (1) (0) (0) (0) - * - * DL error rate of ue4 when attached to CELL3 = 0 - * when attached to CELL4 = 0.734758 - */ - x.clear (); // position x y z, csg expectedCellId - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (-80, 20, 0), 1, 3)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector ( 80, 20, 0), 1, 4)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (240, 20, 0), 1, 2)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (-80, 10, 0), 0, 0)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector ( 80, 10, 0), 0, 4)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (240, 10, 0), 0, 2)); - AddTestCase (new LteCellSelectionTestCase ("[EPC, ideal RRC] Some CSG 1", - true, true, true, x, - MilliSeconds (261)), - TestCase::EXTENSIVE); - AddTestCase (new LteCellSelectionTestCase ("[EPC, real RRC] Some CSG 1", - true, false, true, x, - MilliSeconds (279)), - TestCase::EXTENSIVE); - - /* - * <-- <-- - * ue1 CELL3 ue2---CELL4 ue3 - * (0) / (1) (0) (0) /(0) - * / / - * / --> --> / - * ue4 CELL1---ue5 CELL2---ue6 - * (1) (1) (1) (0) (1) - * - * DL error rate of ue1 when attached to CELL3 = 0 - * when attached to CELL4 = 0.777789 - */ - x.clear (); // position x y z, csg expectedCellId - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (-80, 20, 0), 0, 0)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector ( 80, 20, 0), 0, 4)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (240, 20, 0), 0, 2)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (-80, 10, 0), 1, 3)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector ( 80, 10, 0), 1, 1)); - x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (240, 10, 0), 1, 2)); - AddTestCase (new LteCellSelectionTestCase ("[EPC, ideal RRC] Some CSG 2", - true, true, true, x, - MilliSeconds (261)), - TestCase::EXTENSIVE); - AddTestCase (new LteCellSelectionTestCase ("[EPC, real RRC] Some CSG 2", - true, false, true, x, - MilliSeconds (279)), - TestCase::EXTENSIVE); + for (int64_t i = 2; i <= 4; i++) + { + oss.str (""); + oss << "EPC, ideal RRC, RngNum=" << i; + AddTestCase (new LteCellSelectionTestCase (oss.str (), true, true, + 60.0, 20.0, w, 1), + // isd txpow rngrun + TestCase::TAKES_FOREVER); + } } // end of LteCellSelectionTestSuite::LteCellSelectionTestSuite () @@ -150,29 +109,33 @@ static LteCellSelectionTestSuite g_lteCellSelectionTestSuite; /* - * Test Case + * 6-cell Test Case */ -LteCellSelectionTestCase::UeSetup_t::UeSetup_t (Vector position, - uint32_t csgIdentity, - uint16_t expectedCellId) - : position (position), - csgIdentity (csgIdentity), - expectedCellId (expectedCellId) +LteCellSelectionTestCase::UeSetup_t::UeSetup_t ( + double relPosX, double relPosY, bool isCsgMember, Time checkPoint, + uint16_t expectedCellId1, uint16_t expectedCellId2) + : position (Vector (relPosX, relPosY, 0.0)), + isCsgMember (isCsgMember), + checkPoint (checkPoint), + expectedCellId1 (expectedCellId1), + expectedCellId2 (expectedCellId2) { } LteCellSelectionTestCase::LteCellSelectionTestCase ( - std::string name, bool isEpcMode, bool isIdealRrc, bool hasCsgDiversity, - std::vector ueSetupList, Time duration) + std::string name, bool isEpcMode, bool isIdealRrc, + double interSiteDistance, double enbTxPower, + std::vector ueSetupList, int64_t rngRun) : TestCase (name), m_isEpcMode (isEpcMode), m_isIdealRrc (isIdealRrc), - m_hasCsgDiversity (hasCsgDiversity), + m_interSiteDistance (interSiteDistance), + m_enbTxPower (enbTxPower), m_ueSetupList (ueSetupList), - m_duration (duration) + m_rngRun (rngRun) { NS_LOG_FUNCTION (this << GetName ()); m_lastState.resize (m_ueSetupList.size (), LteUeRrc::NUM_STATES); @@ -190,6 +153,8 @@ LteCellSelectionTestCase::DoRun () { NS_LOG_FUNCTION (this << GetName ()); + Config::SetGlobal ("RngRun", IntegerValue (m_rngRun)); + Ptr lteHelper = CreateObject (); lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel")); @@ -206,34 +171,35 @@ LteCellSelectionTestCase::DoRun () /* * The topology is the following: * - * + <--x <--x - Parabolic antenna model is used - * | Cell3 Cell4 - eNodeB 1 at ( 0, 10, 0), facing east - * 10 m | - eNodeB 2 at (160, 10, 0), facing east - * | - eNodeB 3 at ( 0, 20, 0), facing west - * + x--> x--> - eNodeB 4 at (160, 20, 0), facing west - * Cell1 Cell2 - UEs are placed according to input - * - UEs do not move during simulation - * +------ 160 m ------+ + * TODO */ // Create Nodes NodeContainer enbNodes; - enbNodes.Create (4); + enbNodes.Create (6); NodeContainer ueNodes; uint16_t nUe = m_ueSetupList.size (); ueNodes.Create (nUe); // Assign nodes to position Ptr positionAlloc = CreateObject (); - positionAlloc->Add (Vector ( 0.0, 10.0, 0.0)); - positionAlloc->Add (Vector (160.0, 10.0, 0.0)); - positionAlloc->Add (Vector ( 0.0, 20.0, 0.0)); - positionAlloc->Add (Vector (160.0, 20.0, 0.0)); - + // eNodeB + positionAlloc->Add (Vector ( 0.0, 2 * m_interSiteDistance, 0.0)); + positionAlloc->Add (Vector ( 0.0, m_interSiteDistance, 0.0)); + positionAlloc->Add (Vector ( 0.0, 0.0, 0.0)); + positionAlloc->Add (Vector (m_interSiteDistance, 2 * m_interSiteDistance, 0.0)); + positionAlloc->Add (Vector (m_interSiteDistance, m_interSiteDistance, 0.0)); + positionAlloc->Add (Vector (m_interSiteDistance, 0.0, 0.0)); + // UE std::vector::const_iterator itSetup; - for (itSetup = m_ueSetupList.begin (); itSetup != m_ueSetupList.end (); itSetup++) + for (itSetup = m_ueSetupList.begin (); + itSetup != m_ueSetupList.end (); itSetup++) { - positionAlloc->Add (itSetup->position); + Vector uePos (m_interSiteDistance * itSetup->position.x, + m_interSiteDistance * itSetup->position.y, + m_interSiteDistance * itSetup->position.z); + NS_LOG_INFO ("UE position " << uePos); + positionAlloc->Add (uePos); } MobilityHelper mobility; @@ -243,34 +209,50 @@ LteCellSelectionTestCase::DoRun () mobility.Install (ueNodes); // Create Devices and install them in the Nodes (eNB and UE) - lteHelper->SetEnbAntennaModelType ("ns3::ParabolicAntennaModel"); - lteHelper->SetEnbAntennaModelAttribute ("Beamwidth", DoubleValue (70)); - lteHelper->SetEnbAntennaModelAttribute ("MaxAttenuation", DoubleValue (20.0)); + int64_t stream = 1; NetDeviceContainer enbDevs; - lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (0)); - enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0))); - enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1))); - lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (180)); - enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (2))); - enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (3))); + enbDevs = lteHelper->InstallEnbDevice (enbNodes); + stream += lteHelper->AssignStreams (enbDevs, stream); + + lteHelper->SetEnbCsgId (enbDevs.Get (1), 1, true); // cell ID 2 + lteHelper->SetEnbCsgId (enbDevs.Get (4), 1, true); // cell ID 5 NetDeviceContainer ueDevs; ueDevs = lteHelper->InstallUeDevice (ueNodes); + stream += lteHelper->AssignStreams (ueDevs, stream); - // Set the CSG ID - if (m_hasCsgDiversity) - { - lteHelper->SetEnbCsgId (enbDevs.Get (0), 1, true); - lteHelper->SetEnbCsgId (enbDevs.Get (2), 1, true); - } - + Time lastCheckPoint = MilliSeconds (0); NS_ASSERT (m_ueSetupList.size () == ueDevs.GetN ()); NetDeviceContainer::Iterator itDev; for (itSetup = m_ueSetupList.begin (), itDev = ueDevs.Begin (); itSetup != m_ueSetupList.end () || itDev != ueDevs.End (); itSetup++, itDev++) { - lteHelper->SetUeCsgId (*itDev, itSetup->csgIdentity); + if (itSetup->isCsgMember) + { + lteHelper->SetUeCsgId (*itDev, 1); + } + + Ptr ueDev = (*itDev)->GetObject (); + NS_ASSERT (ueDev != 0); + Simulator::Schedule (itSetup->checkPoint, + &LteCellSelectionTestCase::CheckPoint, + this, ueDev, + itSetup->expectedCellId1, itSetup->expectedCellId2); + + if (lastCheckPoint < itSetup->checkPoint) + { + lastCheckPoint = itSetup->checkPoint; + } + } + + // Tests + NS_ASSERT (m_ueSetupList.size () == ueDevs.GetN ()); + for (itSetup = m_ueSetupList.begin (), itDev = ueDevs.Begin (); + itSetup != m_ueSetupList.end () || itDev != ueDevs.End (); + itSetup++, itDev++) + { + Ptr ueDev = (*itDev)->GetObject (); } if (m_isEpcMode) @@ -321,89 +303,71 @@ LteCellSelectionTestCase::DoRun () } // Connect to trace sources in UEs - Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/MibReceived", - MakeCallback (&LteCellSelectionTestCase::MibReceivedCallback, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/Sib1Received", - MakeCallback (&LteCellSelectionTestCase::Sib1ReceivedCallback, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/Sib2Received", - MakeCallback (&LteCellSelectionTestCase::Sib2ReceivedCallback, this)); Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/StateTransition", - MakeCallback (&LteCellSelectionTestCase::StateTransitionCallback, this)); + MakeCallback (&LteCellSelectionTestCase::StateTransitionCallback, + this)); Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/InitialCellSelectionEndOk", - MakeCallback (&LteCellSelectionTestCase::InitialCellSelectionEndOkCallback, this)); + MakeCallback (&LteCellSelectionTestCase::InitialCellSelectionEndOkCallback, + this)); Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/InitialCellSelectionEndError", - MakeCallback (&LteCellSelectionTestCase::InitialCellSelectionEndErrorCallback, this)); + MakeCallback (&LteCellSelectionTestCase::InitialCellSelectionEndErrorCallback, + this)); Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionEstablished", - MakeCallback (&LteCellSelectionTestCase::ConnectionEstablishedCallback, this)); + MakeCallback (&LteCellSelectionTestCase::ConnectionEstablishedCallback, + this)); // Enable Idle mode cell selection lteHelper->Attach (ueDevs); // Run simulation - Simulator::Stop (m_duration); + Simulator::Stop (lastCheckPoint); Simulator::Run (); - // Tests - NS_ASSERT (m_ueSetupList.size () == ueDevs.GetN ()); - for (itSetup = m_ueSetupList.begin (), itDev = ueDevs.Begin (); - itSetup != m_ueSetupList.end () || itDev != ueDevs.End (); - itSetup++, itDev++) - { - Ptr ueDev = (*itDev)->GetObject (); - NS_ASSERT (ueDev != 0); - uint16_t actualCellId = ueDev->GetRrc ()->GetCellId (); - uint16_t expectedCellId = itSetup->expectedCellId; - NS_TEST_ASSERT_MSG_EQ (actualCellId, expectedCellId, - "IMSI " << ueDev->GetImsi () - << " has attached to an unexpected cell"); - if (expectedCellId > 0) - { - NS_TEST_ASSERT_MSG_EQ (m_lastState.at (ueDev->GetImsi () - 1), - LteUeRrc::CONNECTED_NORMALLY, - "UE " << ueDev->GetImsi () - << " is not at CONNECTED_NORMALLY state"); - } - } - + NS_LOG_INFO ("Simulation ends"); Simulator::Destroy (); -} // end of void LteCellSelectionTestCase::DoRun () - +} // end of void LteCellSelection6CellTestCase::DoRun () void -LteCellSelectionTestCase::MibReceivedCallback ( +LteCellSelectionTestCase::CheckPoint (Ptr ueDev, + uint16_t expectedCellId1, + uint16_t expectedCellId2) +{ + uint16_t actualCellId = ueDev->GetRrc ()->GetCellId (); + + if (expectedCellId2 == 0) + { + NS_TEST_ASSERT_MSG_EQ (actualCellId, expectedCellId1, + "IMSI " << ueDev->GetImsi () + << " has attached to an unexpected cell"); + } + else + { + bool pass = (actualCellId == expectedCellId1) || + (actualCellId == expectedCellId2); + NS_TEST_ASSERT_MSG_EQ (pass, true, + "IMSI " << ueDev->GetImsi () + << " has attached to an unexpected cell" + << " (actual: " << actualCellId << "," + << " expected: " << expectedCellId1 + << " or " << expectedCellId2 << ")"); + } + + if (expectedCellId1 > 0) + { + NS_TEST_ASSERT_MSG_EQ (m_lastState.at (ueDev->GetImsi () - 1), + LteUeRrc::CONNECTED_NORMALLY, + "UE " << ueDev->GetImsi () + << " is not at CONNECTED_NORMALLY state"); + } +} + + +void +LteCellSelectionTestCase::StateTransitionCallback ( std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, - uint16_t sourceCellId) -{ - NS_LOG_FUNCTION (this << imsi << cellId << rnti << sourceCellId); -} - - -void -LteCellSelectionTestCase::Sib1ReceivedCallback ( - std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, - uint16_t sourceCellId) -{ - NS_LOG_FUNCTION (this << imsi << cellId << rnti << sourceCellId); -} - - -void -LteCellSelectionTestCase::Sib2ReceivedCallback ( - std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) -{ - NS_LOG_FUNCTION (this << imsi << cellId << rnti); -} - - -void -LteCellSelectionTestCase::StateTransitionCallback (std::string context, - uint64_t imsi, - uint16_t cellId, - uint16_t rnti, - LteUeRrc::State oldState, - LteUeRrc::State newState) + LteUeRrc::State oldState, LteUeRrc::State newState) { NS_LOG_FUNCTION (this << imsi << cellId << rnti << oldState << newState); m_lastState.at (imsi - 1) = newState; diff --git a/src/lte/test/lte-test-cell-selection.h b/src/lte/test/lte-test-cell-selection.h index 3c763d366..65c029b76 100644 --- a/src/lte/test/lte-test-cell-selection.h +++ b/src/lte/test/lte-test-cell-selection.h @@ -46,6 +46,8 @@ public: +class LteUeNetDevice; + /** * \brief Testing the initial cell selection procedure by UE at IDLE state in * the beginning of simulation. @@ -58,22 +60,27 @@ public: */ struct UeSetup_t { - Vector position; ///< The position where the UE will be spawned in the simulation. - uint32_t csgIdentity; ///< Closed Subscriber Group identity of the UE. - uint16_t expectedCellId; ///< The cell ID that the UE is expected to attach to (0 means that the UE should not attach to any cell). - UeSetup_t (Vector position, uint32_t csgIdentity, uint16_t expectedCellId); + Vector position; ///< The position, relative to the inter site distance, where the UE will be spawned in the simulation. + bool isCsgMember; ///< Whether UE is allowed access to CSG cell. + Time checkPoint; ///< The time in simulation when the UE is verified by the test script. + uint16_t expectedCellId1; ///< The cell ID that the UE is expected to attach to (0 means that the UE should not attach to any cell). + uint16_t expectedCellId2; ///< An alternative cell ID that the UE is expected to attach to (0 means that this no alternative cell is expected). + UeSetup_t (double relPosX, double relPosY, bool isCsgMember, Time checkPoint, + uint16_t expectedCellId1, uint16_t expectedCellId2); }; /** * \brief Creates an instance of the initial cell selection test case. * \param name name of this test * \param isEpcMode set to true for setting up simulation with EPC enabled - * \param ueSetupList an array of UE setup parameters - * \param duration length of simulation + * \param isIdealRrc if true, simulation uses Ideal RRC protocol, otherwise + * simulation uses Real RRC protocol + * TODO */ - LteCellSelectionTestCase (std::string name, bool isEpcMode, - bool isIdealRrc, bool hasCsgDiversity, - std::vector ueSetupList, Time duration); + LteCellSelectionTestCase (std::string name, bool isEpcMode, bool isIdealRrc, + double interSiteDistance, double enbTxPower, + std::vector ueSetupList, + int64_t rngRun); virtual ~LteCellSelectionTestCase (); @@ -84,14 +91,9 @@ private: */ virtual void DoRun (); - void MibReceivedCallback (std::string context, uint64_t imsi, - uint16_t cellId, uint16_t rnti, - uint16_t sourceCellId); - void Sib1ReceivedCallback (std::string context, uint64_t imsi, - uint16_t cellId, uint16_t rnti, - uint16_t sourceCellId); - void Sib2ReceivedCallback (std::string context, uint64_t imsi, - uint16_t cellId, uint16_t rnti); + void CheckPoint (Ptr ueDev, uint16_t expectedCellId1, + uint16_t expectedCellId2); + void StateTransitionCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteUeRrc::State oldState, LteUeRrc::State newState); @@ -102,39 +104,12 @@ private: void ConnectionEstablishedCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti); - /** - * \brief If true, then the simulation should be set up with EPC enabled. - */ bool m_isEpcMode; - - /** - * \brief If true, then the simulation should be set up with ideal RRC - * protocol, otherwise real RRC protocol is used. - */ bool m_isIdealRrc; - - /** - * \brief If true, then the west cells in the simulation will be CSG cell, - * while the east cells will be non-CSG cells. - */ - bool m_hasCsgDiversity; - - /** - * \brief The list of UE setups to be used during the test execution. - */ + double m_interSiteDistance; + double m_enbTxPower; std::vector m_ueSetupList; - - /** - * \brief The length of the simulation. - * - * The shortest possible simulation length for testing initial cell selection - * is 206 milliseconds. If RRC_CONNECTED state is required, then the length - * should be extended to 261 milliseconds in ideal RRC protocol, or at least - * 278 milliseconds in real RRC protocol. Moreover, scenarios which expect - * failure in initial cell selection procedure might want to extend this even - * further to give the UE the chance to retry the procedure. - */ - Time m_duration; + int64_t m_rngRun; /// The current UE RRC state. std::vector m_lastState; @@ -142,6 +117,7 @@ private: }; // end of class LteCellSelectionTestCase + } // end of namespace ns3