OLD | NEW |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include <ns3/core-module.h> | 23 #include <ns3/core-module.h> |
24 #include <ns3/network-module.h> | 24 #include <ns3/network-module.h> |
25 #include <ns3/mobility-module.h> | 25 #include <ns3/mobility-module.h> |
26 #include <ns3/lte-module.h> | 26 #include <ns3/lte-module.h> |
27 #include <cmath> | 27 #include <cmath> |
28 | 28 |
29 using namespace ns3; | 29 using namespace ns3; |
30 | 30 |
31 NS_LOG_COMPONENT_DEFINE ("LteRrcTest"); | 31 NS_LOG_COMPONENT_DEFINE ("LteRrcTest"); |
32 | 32 |
| 33 /** |
| 34 * \ingroup lte-test |
| 35 * \ingroup tests |
| 36 * |
| 37 * \brief Lte Rrc Connection Establishment Test Case |
| 38 */· |
33 class LteRrcConnectionEstablishmentTestCase : public TestCase | 39 class LteRrcConnectionEstablishmentTestCase : public TestCase |
34 { | 40 { |
35 public: | 41 public: |
36 /** | 42 /** |
37 * | 43 * |
38 *· | 44 *· |
39 * \param nUes number of UEs in the test | 45 * \param nUes number of UEs in the test |
40 * \param nBearers number of bearers to be setup in each connection | 46 * \param nBearers number of bearers to be setup in each connection |
41 * \param tConnBase connection time base value for all UEs in ms | 47 * \param tConnBase connection time base value for all UEs in ms |
42 * \param tConnIncrPerUe additional connection time increment for each UE inde
x (0...nUes-1) in ms | 48 * \param tConnIncrPerUe additional connection time increment for each UE inde
x (0...nUes-1) in ms |
43 * \param delayDiscStart expected duration to perform connection establishment
in ms | 49 * \param delayDiscStart expected duration to perform connection establishment
in ms |
44 * \param errorExpected if true, test case will wait a bit longer to accomodat
e for transmission error | 50 * \param errorExpected if true, test case will wait a bit longer to accomodat
e for transmission error |
45 * \param useIdealRrc If set to false, real RRC protocol model will be used | 51 * \param useIdealRrc If set to false, real RRC protocol model will be used |
46 * \param admitRrcConnectionRequest If set to false, eNb will not allow UE con
nections | 52 * \param admitRrcConnectionRequest If set to false, eNb will not allow UE con
nections |
47 * \param description additional description of the test case | 53 * \param description additional description of the test case |
48 */ | 54 */ |
49 LteRrcConnectionEstablishmentTestCase (uint32_t nUes, | 55 LteRrcConnectionEstablishmentTestCase (uint32_t nUes, |
50 uint32_t nBearers, | 56 uint32_t nBearers, |
51 uint32_t tConnBase, | 57 uint32_t tConnBase, |
52 uint32_t tConnIncrPerUe, | 58 uint32_t tConnIncrPerUe, |
53 uint32_t delayDiscStart, | 59 uint32_t delayDiscStart, |
54 bool errorExpected, | 60 bool errorExpected, |
55 bool useIdealRrc, | 61 bool useIdealRrc, |
56 bool admitRrcConnectionRequest, | 62 bool admitRrcConnectionRequest, |
57 std::string description = ""); | 63 std::string description = ""); |
58 | 64 |
59 protected: | 65 protected: |
60 | 66 |
61 virtual void DoRun (void); | 67 virtual void DoRun (void); |
62 uint32_t m_nUes; // number of UEs in the test | 68 uint32_t m_nUes; ///< number of UEs in the test |
63 | 69 |
| 70 /** |
| 71 * Build name string function |
| 72 *· |
| 73 * \param nUes number of UEs in the test |
| 74 * \param nBearers number of bearers to be setup in each connection |
| 75 * \param tConnBase connection time base value for all UEs in ms |
| 76 * \param tConnIncrPerUe additional connection time increment for each UE inde
x (0...nUes-1) in ms |
| 77 * \param delayDiscStart expected duration to perform connection establishment
in ms |
| 78 * \param useIdealRrc If set to false, real RRC protocol model will be used |
| 79 * \param admitRrcConnectionRequest If set to false, eNb will not allow UE con
nections |
| 80 * \param description additional description of the test case |
| 81 * \returns the name string |
| 82 */ |
64 static std::string BuildNameString (uint32_t nUes, | 83 static std::string BuildNameString (uint32_t nUes, |
65 uint32_t nBearers, | 84 uint32_t nBearers, |
66 uint32_t tConnBase, | 85 uint32_t tConnBase, |
67 uint32_t tConnIncrPerUe, | 86 uint32_t tConnIncrPerUe, |
68 uint32_t delayDiscStart, | 87 uint32_t delayDiscStart, |
69 bool useIdealRrc, | 88 bool useIdealRrc, |
70 bool admitRrcConnectionRequest, | 89 bool admitRrcConnectionRequest, |
71 std::string description = ""); | 90 std::string description = ""); |
| 91 /** |
| 92 * Connect function |
| 93 * \param ueDevice the UE device |
| 94 * \param enbDevice the ENB device |
| 95 */ |
72 void Connect (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice); | 96 void Connect (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice); |
| 97 /** |
| 98 * Check connected function |
| 99 * \param ueDevice the UE device |
| 100 * \param enbDevice the ENB device |
| 101 */ |
73 void CheckConnected (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice); | 102 void CheckConnected (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice); |
| 103 /** |
| 104 * Check not connected function |
| 105 * \param ueDevice the UE device |
| 106 * \param enbDevice the ENB device |
| 107 */ |
74 void CheckNotConnected (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice); | 108 void CheckNotConnected (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice); |
| 109 /** |
| 110 * Connection established callback function |
| 111 * \param context the context string |
| 112 * \param imsi the IMSI |
| 113 * \param cellId the cell ID |
| 114 * \param rnti the RNTI |
| 115 */ |
75 void ConnectionEstablishedCallback (std::string context, uint64_t imsi, | 116 void ConnectionEstablishedCallback (std::string context, uint64_t imsi, |
76 uint16_t cellId, uint16_t rnti); | 117 uint16_t cellId, uint16_t rnti); |
| 118 /** |
| 119 * Connection timeout callback function |
| 120 * \param context the context string |
| 121 * \param imsi the IMSI |
| 122 * \param cellId the cell ID |
| 123 * \param rnti the RNTI |
| 124 */ |
77 void ConnectionTimeoutCallback (std::string context, uint64_t imsi, | 125 void ConnectionTimeoutCallback (std::string context, uint64_t imsi, |
78 uint16_t cellId, uint16_t rnti); | 126 uint16_t cellId, uint16_t rnti); |
79 | 127 |
80 uint32_t m_nBearers; // number of bearers to be setup in each connection | 128 uint32_t m_nBearers; ///< number of bearers to be setup in each connection |
81 uint32_t m_tConnBase; // connection time base value for all UEs in ms | 129 uint32_t m_tConnBase; ///< connection time base value for all UEs in ms |
82 uint32_t m_tConnIncrPerUe; // additional connection time increment for each UE
index (0...nUes-1) in ms | 130 uint32_t m_tConnIncrPerUe; ///< additional connection time increment for each
UE index (0...nUes-1) in ms |
83 uint32_t m_delayConnEnd; // expected duration to perform connection establish
ment in ms | 131 uint32_t m_delayConnEnd; ///< expected duration to perform connection establi
shment in ms |
84 uint32_t m_delayDiscStart; // delay between connection completed and disconne
ction request in ms | 132 uint32_t m_delayDiscStart; ///< delay between connection completed and discon
nection request in ms |
85 uint32_t m_delayDiscEnd; // expected duration to complete disconnection in ms | 133 uint32_t m_delayDiscEnd; ///< expected duration to complete disconnection in m
s |
86 bool m_useIdealRrc; // If set to false, real RRC protocol model will be us
ed | 134 bool m_useIdealRrc; ///< If set to false, real RRC protocol model will be
used |
87 bool m_admitRrcConnectionRequest; // If set to false, eNb will not allow U
E connections | 135 bool m_admitRrcConnectionRequest; ///< If set to false, eNb will not allow
UE connections |
88 Ptr<LteHelper> m_lteHelper; | 136 Ptr<LteHelper> m_lteHelper; ///< LTE helper |
89 | 137 |
90 // key: IMSI | 138 /// key: IMSI |
91 std::map<uint64_t, bool> m_isConnectionEstablished; | 139 std::map<uint64_t, bool> m_isConnectionEstablished; |
92 }; | 140 }; |
93 | 141 |
94 | 142 |
95 std::string | 143 std::string |
96 LteRrcConnectionEstablishmentTestCase::BuildNameString (uint32_t nUes, | 144 LteRrcConnectionEstablishmentTestCase::BuildNameString (uint32_t nUes, |
97 uint32_t nBearers, | 145 uint32_t nBearers, |
98 uint32_t tConnBase, | 146 uint32_t tConnBase, |
99 uint32_t tConnIncrPerUe, | 147 uint32_t tConnIncrPerUe, |
100 uint32_t delayDiscStart, | 148 uint32_t delayDiscStart, |
101 bool useIdealRrc, | 149 bool useIdealRrc, |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 534 |
487 void | 535 void |
488 LteRrcConnectionEstablishmentTestCase::ConnectionTimeoutCallback ( | 536 LteRrcConnectionEstablishmentTestCase::ConnectionTimeoutCallback ( |
489 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) | 537 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
490 { | 538 { |
491 NS_LOG_FUNCTION (this << imsi << cellId); | 539 NS_LOG_FUNCTION (this << imsi << cellId); |
492 } | 540 } |
493 | 541 |
494 | 542 |
495 | 543 |
| 544 /** |
| 545 * \ingroup lte-test |
| 546 * \ingroup tests |
| 547 * |
| 548 * \brief Lte Rrc Connection Establishment Error Test Case |
| 549 */· |
496 class LteRrcConnectionEstablishmentErrorTestCase | 550 class LteRrcConnectionEstablishmentErrorTestCase |
497 : public LteRrcConnectionEstablishmentTestCase | 551 : public LteRrcConnectionEstablishmentTestCase |
498 { | 552 { |
499 public: | 553 public: |
500 /** | 554 /** |
501 * | 555 * |
502 * | 556 * |
503 * \param jumpAwayTime the time when all the UEs 'teleport' to a pre-defined | 557 * \param jumpAwayTime the time when all the UEs 'teleport' to a pre-defined |
504 * high-interference position and stay there for 100 ms | 558 * high-interference position and stay there for 100 ms |
505 * \param description additional description of the test case | 559 * \param description additional description of the test case |
506 */ | 560 */ |
507 LteRrcConnectionEstablishmentErrorTestCase (Time jumpAwayTime, | 561 LteRrcConnectionEstablishmentErrorTestCase (Time jumpAwayTime, |
508 std::string description = ""); | 562 std::string description = ""); |
509 protected: | 563 protected: |
510 virtual void DoRun (void); | 564 virtual void DoRun (void); |
511 | 565 |
512 private: | 566 private: |
| 567 /// Jump away function |
513 void JumpAway (); | 568 void JumpAway (); |
| 569 /// Jump back function |
514 void JumpBack (); | 570 void JumpBack (); |
515 | 571 |
516 Time m_jumpAwayTime; | 572 Time m_jumpAwayTime; ///< jump away time |
517 Ptr<MobilityModel> m_ueMobility; | 573 Ptr<MobilityModel> m_ueMobility; ///< UE mobility model |
518 }; | 574 }; |
519 | 575 |
520 | 576 |
521 LteRrcConnectionEstablishmentErrorTestCase::LteRrcConnectionEstablishmentErrorTe
stCase ( | 577 LteRrcConnectionEstablishmentErrorTestCase::LteRrcConnectionEstablishmentErrorTe
stCase ( |
522 Time jumpAwayTime, std::string description) | 578 Time jumpAwayTime, std::string description) |
523 : LteRrcConnectionEstablishmentTestCase (1, 1, 0, 0, 1, true, false, true, | 579 : LteRrcConnectionEstablishmentTestCase (1, 1, 0, 0, 1, true, false, true, |
524 description), | 580 description), |
525 m_jumpAwayTime (jumpAwayTime) | 581 m_jumpAwayTime (jumpAwayTime) |
526 { | 582 { |
527 NS_LOG_FUNCTION (this << GetName ()); | 583 NS_LOG_FUNCTION (this << GetName ()); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 721 |
666 | 722 |
667 void | 723 void |
668 LteRrcConnectionEstablishmentErrorTestCase::JumpBack () | 724 LteRrcConnectionEstablishmentErrorTestCase::JumpBack () |
669 { | 725 { |
670 NS_LOG_FUNCTION (this); | 726 NS_LOG_FUNCTION (this); |
671 m_ueMobility->SetPosition (Vector (0.0, 0.0, 0.0)); | 727 m_ueMobility->SetPosition (Vector (0.0, 0.0, 0.0)); |
672 } | 728 } |
673 | 729 |
674 | 730 |
675 | 731 /** |
| 732 * \ingroup lte-test |
| 733 * \ingroup tests |
| 734 * |
| 735 * \brief Lte Rrc Test Suite |
| 736 */· |
676 class LteRrcTestSuite : public TestSuite | 737 class LteRrcTestSuite : public TestSuite |
677 { | 738 { |
678 public: | 739 public: |
679 LteRrcTestSuite (); | 740 LteRrcTestSuite (); |
680 }; | 741 }; |
681 | 742 |
682 | 743 |
683 LteRrcTestSuite::LteRrcTestSuite () | 744 LteRrcTestSuite::LteRrcTestSuite () |
684 : TestSuite ("lte-rrc", SYSTEM) | 745 : TestSuite ("lte-rrc", SYSTEM) |
685 { | 746 { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 * unsupported feature at the moment. See also Bug 1762 Comment #25. | 802 * unsupported feature at the moment. See also Bug 1762 Comment #25. |
742 */ | 803 */ |
743 // AddTestCase (new LteRrcConnectionEstablishmentErrorTestCase ( | 804 // AddTestCase (new LteRrcConnectionEstablishmentErrorTestCase ( |
744 // Seconds (0.030), | 805 // Seconds (0.030), |
745 // "failure at RRC Connection Setup Complete"), | 806 // "failure at RRC Connection Setup Complete"), |
746 // TestCase::QUICK); | 807 // TestCase::QUICK); |
747 | 808 |
748 } | 809 } |
749 | 810 |
750 static LteRrcTestSuite g_lteRrcTestSuiteInstance; | 811 static LteRrcTestSuite g_lteRrcTestSuiteInstance; |
OLD | NEW |