View | Details | Raw Unified | Return to bug 1762
Collapse All | Expand All

(-)a/src/lte/doc/source/figures/lte-enb-rrc-states.dot (-1 / +2 lines)
 Lines 17-24    Link Here 
17
NO_CONTEXT -> INITIAL_RANDOM_ACCESS [label="rx RA\npreamble"]
17
NO_CONTEXT -> INITIAL_RANDOM_ACCESS [label="rx RA\npreamble"]
18
INITIAL_RANDOM_ACCESS -> CONNECTION_REJECTED [label="rx RRC CONN REQ,\nAdmit = false"]
18
INITIAL_RANDOM_ACCESS -> CONNECTION_REJECTED [label="rx RRC CONN REQ,\nAdmit = false"]
19
CONNECTION_REJECTED -> CONTEXT_DESTROYED [label="connection\nrejected\ntimeout"]
19
CONNECTION_REJECTED -> CONTEXT_DESTROYED [label="connection\nrejected\ntimeout"]
20
INITIAL_RANDOM_ACCESS -> CONTEXT_DESTROYED [label="connection\ntimeout"]
20
INITIAL_RANDOM_ACCESS -> CONTEXT_DESTROYED [label="connection\nrequest\ntimeout"]
21
INITIAL_RANDOM_ACCESS -> CONNECTION_SETUP [label="rx RRC CONN REQ,\nAdmit = true"]
21
INITIAL_RANDOM_ACCESS -> CONNECTION_SETUP [label="rx RRC CONN REQ,\nAdmit = true"]
22
CONNECTION_SETUP -> CONTEXT_DESTROYED [label="connection\nsetup\ntimeout"]
22
CONNECTION_SETUP -> CONNECTED_NORMALLY [label="rx RRC CONN SETUP\nCOMPLETED"]
23
CONNECTION_SETUP -> CONNECTED_NORMALLY [label="rx RRC CONN SETUP\nCOMPLETED"]
23
CONNECTED_NORMALLY -> CONNECTION_RECONFIGURATION [label="reconfiguration\ntrigger"]
24
CONNECTED_NORMALLY -> CONNECTION_RECONFIGURATION [label="reconfiguration\ntrigger"]
24
CONNECTION_RECONFIGURATION -> CONNECTED_NORMALLY [label="rx RRC CONN RECONF\nCOMPLETED"]
25
CONNECTION_RECONFIGURATION -> CONNECTED_NORMALLY [label="rx RRC CONN RECONF\nCOMPLETED"]
(-)a/src/lte/doc/source/figures/lte-ue-rrc-states.dot (-1 / +1 lines)
 Lines 29-35    Link Here 
29
IDLE_RANDOM_ACCESS -> IDLE_CONNECTING [label="random access\nsuccessful"]
29
IDLE_RANDOM_ACCESS -> IDLE_CONNECTING [label="random access\nsuccessful"]
30
IDLE_RANDOM_ACCESS -> IDLE_CAMPED_NORMALLY [label="random access\nfailure"]
30
IDLE_RANDOM_ACCESS -> IDLE_CAMPED_NORMALLY [label="random access\nfailure"]
31
IDLE_CONNECTING -> CONNECTED_NORMALLY [label="rx RRC CONN SETUP"]
31
IDLE_CONNECTING -> CONNECTED_NORMALLY [label="rx RRC CONN SETUP"]
32
IDLE_CONNECTING -> IDLE_CAMPED_NORMALLY [label="rx RRC CONN\nREJECT"]
32
IDLE_CONNECTING -> IDLE_CAMPED_NORMALLY [label="T300 expiry or\nrx RRC CONN\nREJECT"]
33
33
34
// Handover
34
// Handover
35
CONNECTED_NORMALLY -> CONNECTED_HANDOVER [label="rx RRC CONN RECONF\nwith MobilityCtrlInfo"]
35
CONNECTED_NORMALLY -> CONNECTED_HANDOVER [label="rx RRC CONN RECONF\nwith MobilityCtrlInfo"]
(-)a/src/lte/doc/source/lte-design.rst (+33 lines)
 Lines 2755-2760    Link Here 
2755
2755
2756
   Sequence diagram of the RRC Connection Establishment procedure
2756
   Sequence diagram of the RRC Connection Establishment procedure
2757
2757
2758
There are several timeouts related to this procedure, which are listed in the
2759
following Table :ref:`tab-rrc-connection_establishment_timer`. If any of these
2760
timers expired, the RRC connection establishment procedure is terminated in
2761
failure. In this case, the upper layer (UE NAS) will immediately attempt to
2762
retry the procedure until it completes successfully.
2763
2764
.. _tab-rrc-connection_establishment_timer:
2765
2766
.. table:: Timers in RRC connection establishment procedure
2767
2768
   +------------+----------+------------+-------------+----------+------------+
2769
   | Name       | Location | Timer      | Timer       | Default  | When timer |
2770
   |            |          | starts     | stops       | duration | expired    |
2771
   +============+==========+============+=============+==========+============+
2772
   | Connection | eNodeB   | New UE     | Receive RRC | 15 ms    | Remove UE  |
2773
   | request    | RRC      | context    | CONNECTION  |          | context    |
2774
   | timeout    |          | added      | REQUEST     |          |            |
2775
   +------------+----------+------------+-------------+----------+------------+
2776
   | Connection | UE RRC   | Send RRC   | Receive RRC | 100 ms   | Reset UE   |
2777
   | timeout    |          | CONNECTION | CONNECTION  |          | MAC        |
2778
   | (T300      |          | REQUEST    | SETUP or    |          |            |
2779
   | timer)     |          |            | REJECT      |          |            |
2780
   +------------+----------+------------+-------------+----------+------------+
2781
   | Connection | eNodeB   | Send RRC   | Receive RRC | 100 ms   | Remove UE  |
2782
   | setup      | RRC      | CONNECTION | CONNECTION  |          | context    |
2783
   | timeout    |          | SETUP      | SETUP       |          |            |
2784
   |            |          |            | COMPLETE    |          |            |
2785
   +------------+----------+------------+-------------+----------+------------+
2786
   | Connection | eNodeB   | Send RRC   | Never       | 30 ms    | Remove UE  |
2787
   | rejected   | RRC      | CONNECTION |             |          | context    |
2788
   | timeout    |          | REJECT     |             |          |            |
2789
   +------------+----------+------------+-------------+----------+------------+
2790
2758
2791
2759
2792
2760
.. _sec-rrc-connection-reconfiguration:
2793
.. _sec-rrc-connection-reconfiguration:
(-)a/src/lte/doc/source/lte-testing.rst (-8 / +21 lines)
 Lines 1007-1018    Link Here 
1007
 #. RRC Connection Establishment 
1007
 #. RRC Connection Establishment 
1008
 #. RRC Reconfiguration
1008
 #. RRC Reconfiguration
1009
1009
1010
The test suite considers a type of scenario with a single eNB and multiple UEs that are instructed to connect to the eNB. Each test case implement an instance of this scenario with specific values of the following parameters:
1010
The test suite considers a type of scenario with four eNBs aligned in a square
1011
layout with 100-meter edges. Multiple UEs are located at a specific spot on the
1012
diagonal of the square and are instructed to connect to the first eNB. Each test
1013
case implements an instance of this scenario with specific values of the
1014
following parameters:
1011
1015
1012
 - number of UEs
1016
 - number of UEs
1013
 - number of Data Radio Bearers to be activated for each UE
1017
 - number of Data Radio Bearers to be activated for each UE
1014
 - time :math:`t^c_0` at which the first UE is instructed to start connecting to the eNB
1018
 - time :math:`t^c_0` at which the first UE is instructed to start connecting to the eNB
1015
 - time interval :math:`d^i` between the start of connection of UE :math:`n` and UE :math:`n+1`; the time at which user :math:`n` connects is thus determined as :math:`t^c_n = t^c_0 + n d^i` sdf
1019
 - time interval :math:`d^i` between the start of connection of UE :math:`n` and UE :math:`n+1`; the time at which user :math:`n` connects is thus determined as :math:`t^c_n = t^c_0 + n d^i` sdf
1020
 - the relative position of the UEs on the diagonal of the square, where higher
1021
   values indicate larger distance from the serving eNodeB, i.e., higher
1022
   interference from the other eNodeBs
1016
 - a boolean flag indicating whether the ideal or the real RRC protocol model is used
1023
 - a boolean flag indicating whether the ideal or the real RRC protocol model is used
1017
1024
1018
Each test cases passes if a number of test conditions are positively evaluated for each UE after a delay :math:`d^e` from the time it started connecting to the eNB. The delay :math:`d^e` is determined as 
1025
Each test cases passes if a number of test conditions are positively evaluated for each UE after a delay :math:`d^e` from the time it started connecting to the eNB. The delay :math:`d^e` is determined as 
 Lines 1031-1039    Link Here 
1031
   to allocate the UL grant because of lack of resources. The number
1038
   to allocate the UL grant because of lack of resources. The number
1032
   of collisions depends on the number of UEs that try to access
1039
   of collisions depends on the number of UEs that try to access
1033
   simultaneously; we estimated that for a :math:`0.99` RA success
1040
   simultaneously; we estimated that for a :math:`0.99` RA success
1034
   probability, 5 attempts are sufficient for up to 20 UEs, and 10
1041
   probability, 5 attempts are sufficient for up to 20 UEs, 10 attempts for up
1035
   attempts for up to 50 UEs. For the UL
1042
   to 50 UEs, 20 attempts for up to 100 UEs, and 40 attempts for up to 200 UEs.
1036
   grant, considered the system bandwidth and the
1043
   For the UL grant, considered the system bandwidth and the
1037
   default MCS used for the UL grant (MCS 0), at most 4 UL grants can
1044
   default MCS used for the UL grant (MCS 0), at most 4 UL grants can
1038
   be assigned in a TTI; so for :math:`n` UEs trying to
1045
   be assigned in a TTI; so for :math:`n` UEs trying to
1039
   do RA simultaneously the max number of attempts due to the UL grant
1046
   do RA simultaneously the max number of attempts due to the UL grant
 Lines 1045-1051    Link Here 
1045
   SETUP + RRC CONNECTION SETUP COMPLETED. We consider a round trip
1052
   SETUP + RRC CONNECTION SETUP COMPLETED. We consider a round trip
1046
   delay of 10ms plus :math:`\lceil 2n/4 \rceil` considering that 2
1053
   delay of 10ms plus :math:`\lceil 2n/4 \rceil` considering that 2
1047
   RRC packets have to be transmitted and that at most 4 such packets
1054
   RRC packets have to be transmitted and that at most 4 such packets
1048
   can be transmitted per TTI.
1055
   can be transmitted per TTI. In cases where interference is high, we
1056
   accommodate one retry attempt by the UE, so we double the :math:`d^{ce}`
1057
   value and then add :math:`d^{si}` on top of it (because the timeout has
1058
   reset the previously received SIB2).
1049
 - :math:`d^{cr}` is the delay required for eventually needed RRC
1059
 - :math:`d^{cr}` is the delay required for eventually needed RRC
1050
   CONNECTION RECONFIGURATION transactions. The number of transactions needed is
1060
   CONNECTION RECONFIGURATION transactions. The number of transactions needed is
1051
   1 for each bearer activation. Similarly to what done for
1061
   1 for each bearer activation. Similarly to what done for
 Lines 1056-1064    Link Here 
1056
The conditions that are evaluated for a test case to pass are, for
1066
The conditions that are evaluated for a test case to pass are, for
1057
each UE:
1067
each UE:
1058
1068
1059
 - the eNB has the context of the UE (identified by the RNTI value
1060
   retrieved from the UE RRC)
1061
 - the RRC state of the UE at the eNB is CONNECTED_NORMALLY
1062
 - the RRC state at the UE is CONNECTED_NORMALLY
1069
 - the RRC state at the UE is CONNECTED_NORMALLY
1063
 - the UE is configured with the CellId, DlBandwidth, UlBandwidth,
1070
 - the UE is configured with the CellId, DlBandwidth, UlBandwidth,
1064
   DlEarfcn and UlEarfcn of the eNB
1071
   DlEarfcn and UlEarfcn of the eNB
 Lines 1068-1073    Link Here 
1068
 - for each Data Radio Bearer, the following identifiers match between
1075
 - for each Data Radio Bearer, the following identifiers match between
1069
   the UE and the eNB: EPS bearer id, DRB id, LCID
1076
   the UE and the eNB: EPS bearer id, DRB id, LCID
1070
1077
1078
Ideally, the UE context at the serving eNodeB would have an RRC state of
1079
CONNECTED_NORMALLY at the end of the procedure. But in the rare case of error
1080
while transmitting RRC CONNECTION SETUP COMPLETE message, the eNodeB would have
1081
removed the context because of *connection setup timeout*. A better way to
1082
handle this error is to make the UE fall back to Idle mode and retry the
1083
connection, but this behaviour is not yet implemented at the moment.
1071
 
1084
 
1072
1085
1073
Initial cell selection
1086
Initial cell selection
(-)a/src/lte/model/epc-ue-nas.cc (-7 / +3 lines)
 Lines 237-253    Link Here 
237
  SwitchToState (ACTIVE); // will eventually activate dedicated bearers
237
  SwitchToState (ACTIVE); // will eventually activate dedicated bearers
238
}
238
}
239
239
240
void 
240
void
241
EpcUeNas::DoNotifyConnectionFailed ()
241
EpcUeNas::DoNotifyConnectionFailed ()
242
{
242
{
243
  NS_LOG_FUNCTION (this);
243
  NS_LOG_FUNCTION (this);
244
244
245
  SwitchToState (OFF);
245
  // immediately retry the connection
246
  /**
246
  Simulator::ScheduleNow (&LteAsSapProvider::Connect, m_asSapProvider);
247
   * \todo Currently not implemented, action by NAS and upper layers after UE
248
   *       fails to switch to CONNNECTED mode. Maybe a retry, or just stop here
249
   *       and fire a trace to let user know.
250
   */
251
}
247
}
252
248
253
void
249
void
(-)a/src/lte/model/lte-enb-rrc.cc (-33 / +80 lines)
 Lines 241-256    Link Here 
241
  switch (m_state)
241
  switch (m_state)
242
    {
242
    {
243
    case INITIAL_RANDOM_ACCESS:
243
    case INITIAL_RANDOM_ACCESS:
244
      m_connectionTimeout = Simulator::Schedule (m_rrc->m_connectionTimeoutDuration, 
244
      m_connectionRequestTimeout = Simulator::Schedule (m_rrc->m_connectionRequestTimeoutDuration,
245
                                                 &LteEnbRrc::ConnectionTimeout, 
245
                                                        &LteEnbRrc::ConnectionRequestTimeout,
246
                                                 m_rrc, m_rnti);
246
                                                        m_rrc, m_rnti);
247
      break;
247
      break;
248
248
249
    case HANDOVER_JOINING:
249
    case HANDOVER_JOINING:
250
      m_handoverJoiningTimeout = Simulator::Schedule (m_rrc->m_handoverJoiningTimeoutDuration, 
250
      m_handoverJoiningTimeout = Simulator::Schedule (m_rrc->m_handoverJoiningTimeoutDuration,
251
                                                      &LteEnbRrc::HandoverJoiningTimeout,
251
                                                      &LteEnbRrc::HandoverJoiningTimeout,
252
                                                      m_rrc, m_rnti);
252
                                                      m_rrc, m_rnti);
253
      break;      
253
      break;
254
254
255
    default:
255
    default:
256
      NS_FATAL_ERROR ("unexpected state " << ToString (m_state));
256
      NS_FATAL_ERROR ("unexpected state " << ToString (m_state));
 Lines 772-812    Link Here 
772
  NS_LOG_FUNCTION (this);
772
  NS_LOG_FUNCTION (this);
773
  switch (m_state)
773
  switch (m_state)
774
    {
774
    {
775
    case INITIAL_RANDOM_ACCESS:      
775
    case INITIAL_RANDOM_ACCESS:
776
      {      
776
      {
777
        m_connectionRequestTimeout.Cancel ();
778
777
        if (m_rrc->m_admitRrcConnectionRequest == true)
779
        if (m_rrc->m_admitRrcConnectionRequest == true)
778
          {
780
          {
779
            m_connectionTimeout.Cancel ();
781
            m_imsi = msg.ueIdentity;
780
            m_imsi = msg.ueIdentity;      
781
            if (m_rrc->m_s1SapProvider != 0)
782
            if (m_rrc->m_s1SapProvider != 0)
782
              {
783
              {
783
                m_rrc->m_s1SapProvider->InitialUeMessage (m_imsi, m_rnti);
784
                m_rrc->m_s1SapProvider->InitialUeMessage (m_imsi, m_rnti);
784
              }      
785
              }
786
787
            // send RRC CONNECTION SETUP to UE
785
            LteRrcSap::RrcConnectionSetup msg2;
788
            LteRrcSap::RrcConnectionSetup msg2;
786
            msg2.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier ();
789
            msg2.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier ();
787
            msg2.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated ();
790
            msg2.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated ();
788
            m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2);
791
            m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2);
792
789
            RecordDataRadioBearersToBeStarted ();
793
            RecordDataRadioBearersToBeStarted ();
794
            m_connectionSetupTimeout = Simulator::Schedule (
795
                m_rrc->m_connectionSetupTimeoutDuration,
796
                &LteEnbRrc::ConnectionSetupTimeout, m_rrc, m_rnti);
790
            SwitchToState (CONNECTION_SETUP);
797
            SwitchToState (CONNECTION_SETUP);
791
          }
798
          }
792
        else
799
        else
793
          {
800
          {
794
            m_connectionTimeout.Cancel ();
795
            NS_LOG_INFO ("rejecting connection request for RNTI " << m_rnti);
801
            NS_LOG_INFO ("rejecting connection request for RNTI " << m_rnti);
802
803
            // send RRC CONNECTION REJECT to UE
796
            LteRrcSap::RrcConnectionReject rejectMsg;
804
            LteRrcSap::RrcConnectionReject rejectMsg;
797
            rejectMsg.waitTime = 3;
805
            rejectMsg.waitTime = 3;
798
            m_rrc->m_rrcSapUser->SendRrcConnectionReject (m_rnti, rejectMsg);
806
            m_rrc->m_rrcSapUser->SendRrcConnectionReject (m_rnti, rejectMsg);
799
            m_connectionRejectedTimeout = Simulator::Schedule (m_rrc->m_connectionRejectedTimeoutDuration, 
807
800
                                                       &LteEnbRrc::ConnectionRejectedTimeout, 
808
            m_connectionRejectedTimeout = Simulator::Schedule (
801
                                                       m_rrc, m_rnti);
809
                m_rrc->m_connectionRejectedTimeoutDuration,
810
                &LteEnbRrc::ConnectionRejectedTimeout, m_rrc, m_rnti);
802
            SwitchToState (CONNECTION_REJECTED);
811
            SwitchToState (CONNECTION_REJECTED);
803
          }        
812
          }
804
      }
813
      }
805
      break;
814
      break;
806
      
815
807
    default:
816
    default:
808
      NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
817
      NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
809
      break;      
818
      break;
810
    }
819
    }
811
}
820
}
812
821
 Lines 817-830    Link Here 
817
  switch (m_state)
826
  switch (m_state)
818
    {
827
    {
819
    case CONNECTION_SETUP:
828
    case CONNECTION_SETUP:
829
      m_connectionSetupTimeout.Cancel ();
820
      StartDataRadioBearers ();
830
      StartDataRadioBearers ();
821
      SwitchToState (CONNECTED_NORMALLY);
831
      SwitchToState (CONNECTED_NORMALLY);
822
      m_rrc->m_connectionEstablishedTrace (m_imsi, m_rrc->m_cellId, m_rnti);
832
      m_rrc->m_connectionEstablishedTrace (m_imsi, m_rrc->m_cellId, m_rnti);
823
      break;
833
      break;
824
            
834
825
    default:
835
    default:
826
      NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
836
      NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
827
      break;      
837
      break;
828
    }
838
    }
829
}
839
}
830
840
 Lines 835-843    Link Here 
835
  switch (m_state)
845
  switch (m_state)
836
    {
846
    {
837
    case CONNECTION_RECONFIGURATION:
847
    case CONNECTION_RECONFIGURATION:
838
      StartDataRadioBearers ();   
848
      StartDataRadioBearers ();
839
      if (m_needTransmissionModeConfiguration)
849
      if (m_needTransmissionModeConfiguration)
840
        {          
850
        {
841
          // configure MAC (and scheduler)
851
          // configure MAC (and scheduler)
842
          LteEnbCmacSapProvider::UeConfig req;
852
          LteEnbCmacSapProvider::UeConfig req;
843
          req.m_rnti = m_rnti;
853
          req.m_rnti = m_rnti;
 Lines 1308-1330    Link Here 
1308
                   MakeUintegerChecker<uint32_t> ())
1318
                   MakeUintegerChecker<uint32_t> ())
1309
1319
1310
    // Timeout related attributes
1320
    // Timeout related attributes
1311
    .AddAttribute ("ConnectionTimeoutDuration",
1321
    .AddAttribute ("ConnectionRequestTimeoutDuration",
1312
                   "After a RA attempt, if no RRC Connection Request is received before this time, the UE context is destroyed. Must account for reception of RAR and transmission of RRC CONNECTION REQUEST over UL GRANT.",
1322
                   "After a RA attempt, if no RRC CONNECTION REQUEST is "
1323
                   "received before this time, the UE context is destroyed. "
1324
                   "Must account for reception of RAR and transmission of "
1325
                   "RRC CONNECTION REQUEST over UL GRANT.",
1313
                   TimeValue (MilliSeconds (15)),
1326
                   TimeValue (MilliSeconds (15)),
1314
                   MakeTimeAccessor (&LteEnbRrc::m_connectionTimeoutDuration),
1327
                   MakeTimeAccessor (&LteEnbRrc::m_connectionRequestTimeoutDuration),
1328
                   MakeTimeChecker ())
1329
    .AddAttribute ("ConnectionSetupTimeoutDuration",
1330
                   "After accepting connection request, if no RRC CONNECTION "
1331
                   "SETUP COMPLETE is received before this time, the UE "
1332
                   "context is destroyed. Must account for the UE's reception "
1333
                   "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1334
                   "SETUP COMPLETE.",
1335
                   TimeValue (MilliSeconds (150)),
1336
                   MakeTimeAccessor (&LteEnbRrc::m_connectionSetupTimeoutDuration),
1315
                   MakeTimeChecker ())
1337
                   MakeTimeChecker ())
1316
    .AddAttribute ("ConnectionRejectedTimeoutDuration",
1338
    .AddAttribute ("ConnectionRejectedTimeoutDuration",
1317
                   "Time to wait between sending a RRC CONNECTION REJECT and destroying the UE context",
1339
                   "Time to wait between sending a RRC CONNECTION REJECT and "
1340
                   "destroying the UE context",
1318
                   TimeValue (MilliSeconds (30)),
1341
                   TimeValue (MilliSeconds (30)),
1319
                   MakeTimeAccessor (&LteEnbRrc::m_connectionRejectedTimeoutDuration),
1342
                   MakeTimeAccessor (&LteEnbRrc::m_connectionRejectedTimeoutDuration),
1320
                   MakeTimeChecker ())
1343
                   MakeTimeChecker ())
1321
    .AddAttribute ("HandoverJoiningTimeoutDuration",
1344
    .AddAttribute ("HandoverJoiningTimeoutDuration",
1322
                   "After accepting a handover request, if no RRC Connection Reconfiguration Completed is received before this time, the UE context is destroyed. Must account for reception of X2 HO REQ ACK by source eNB, transmission of the Handover Command, non-contention-based random access and reception of the RRC Connection Reconfiguration Completed message.",
1345
                   "After accepting a handover request, if no RRC CONNECTION "
1346
                   "RECONFIGURATION COMPLETE is received before this time, the "
1347
                   "UE context is destroyed. Must account for reception of "
1348
                   "X2 HO REQ ACK by source eNB, transmission of the Handover "
1349
                   "Command, non-contention-based random access and reception "
1350
                   "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1323
                   TimeValue (MilliSeconds (200)),
1351
                   TimeValue (MilliSeconds (200)),
1324
                   MakeTimeAccessor (&LteEnbRrc::m_handoverJoiningTimeoutDuration),
1352
                   MakeTimeAccessor (&LteEnbRrc::m_handoverJoiningTimeoutDuration),
1325
                   MakeTimeChecker ())
1353
                   MakeTimeChecker ())
1326
    .AddAttribute ("HandoverLeavingTimeoutDuration",
1354
    .AddAttribute ("HandoverLeavingTimeoutDuration",
1327
                   "After issuing a Handover Command, if neither RRC Connection Reestablishment nor X2 UE Context Release has been previously received, the UE context is destroyed.",
1355
                   "After issuing a Handover Command, if neither RRC "
1356
                   "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
1357
                   "been previously received, the UE context is destroyed.",
1328
                   TimeValue (MilliSeconds (500)),
1358
                   TimeValue (MilliSeconds (500)),
1329
                   MakeTimeAccessor (&LteEnbRrc::m_handoverLeavingTimeoutDuration),
1359
                   MakeTimeAccessor (&LteEnbRrc::m_handoverLeavingTimeoutDuration),
1330
                   MakeTimeChecker ())
1360
                   MakeTimeChecker ())
 Lines 1500-1505    Link Here 
1500
  return m_cphySapUser;
1530
  return m_cphySapUser;
1501
}
1531
}
1502
1532
1533
bool
1534
LteEnbRrc::HasUeManager (uint16_t rnti) const
1535
{
1536
  NS_LOG_FUNCTION (this << (uint32_t) rnti);
1537
  std::map<uint16_t, Ptr<UeManager> >::const_iterator it = m_ueMap.find (rnti);
1538
  return (it != m_ueMap.end ());
1539
}
1540
1503
Ptr<UeManager>
1541
Ptr<UeManager>
1504
LteEnbRrc::GetUeManager (uint16_t rnti)
1542
LteEnbRrc::GetUeManager (uint16_t rnti)
1505
{
1543
{
 Lines 1696-1706    Link Here 
1696
}
1734
}
1697
1735
1698
void
1736
void
1699
LteEnbRrc::ConnectionTimeout (uint16_t rnti)
1737
LteEnbRrc::ConnectionRequestTimeout (uint16_t rnti)
1700
{
1738
{
1701
  NS_LOG_FUNCTION (this << rnti);
1739
  NS_LOG_FUNCTION (this << rnti);
1702
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::INITIAL_RANDOM_ACCESS, 
1740
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::INITIAL_RANDOM_ACCESS,
1703
                 "ConnectionTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1741
                 "ConnectionRequestTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1742
  RemoveUe (rnti);
1743
}
1744
1745
void
1746
LteEnbRrc::ConnectionSetupTimeout (uint16_t rnti)
1747
{
1748
  NS_LOG_FUNCTION (this << rnti);
1749
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP,
1750
                 "ConnectionSetupTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1704
  RemoveUe (rnti);
1751
  RemoveUe (rnti);
1705
}
1752
}
1706
1753
 Lines 1709-1715    Link Here 
1709
{
1756
{
1710
  NS_LOG_FUNCTION (this << rnti);
1757
  NS_LOG_FUNCTION (this << rnti);
1711
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_REJECTED,
1758
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_REJECTED,
1712
                 "ConnectionTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1759
                 "ConnectionRejectedTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1713
  RemoveUe (rnti);
1760
  RemoveUe (rnti);
1714
}
1761
}
1715
1762
 Lines 1717-1723    Link Here 
1717
LteEnbRrc::HandoverJoiningTimeout (uint16_t rnti)
1764
LteEnbRrc::HandoverJoiningTimeout (uint16_t rnti)
1718
{
1765
{
1719
  NS_LOG_FUNCTION (this << rnti);
1766
  NS_LOG_FUNCTION (this << rnti);
1720
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING, 
1767
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING,
1721
                 "HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1768
                 "HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1722
  RemoveUe (rnti);
1769
  RemoveUe (rnti);
1723
}
1770
}
 Lines 1726-1732    Link Here 
1726
LteEnbRrc::HandoverLeavingTimeout (uint16_t rnti)
1773
LteEnbRrc::HandoverLeavingTimeout (uint16_t rnti)
1727
{
1774
{
1728
  NS_LOG_FUNCTION (this << rnti);
1775
  NS_LOG_FUNCTION (this << rnti);
1729
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING, 
1776
  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING,
1730
                 "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1777
                 "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1731
  RemoveUe (rnti);
1778
  RemoveUe (rnti);
1732
}
1779
}
(-)a/src/lte/model/lte-enb-rrc.h (-4 / +23 lines)
 Lines 410-416    Link Here 
410
  std::list<uint8_t> m_drbsToBeStarted;
410
  std::list<uint8_t> m_drbsToBeStarted;
411
  bool m_needTransmissionModeConfiguration;
411
  bool m_needTransmissionModeConfiguration;
412
412
413
  EventId m_connectionTimeout;
413
  EventId m_connectionRequestTimeout;
414
  EventId m_connectionSetupTimeout;
414
  EventId m_connectionRejectedTimeout;
415
  EventId m_connectionRejectedTimeout;
415
  EventId m_handoverJoiningTimeout;
416
  EventId m_handoverJoiningTimeout;
416
  EventId m_handoverLeavingTimeout;
417
  EventId m_handoverLeavingTimeout;
 Lines 569-574    Link Here 
569
   * 
570
   * 
570
   * \param rnti the identifier of an UE
571
   * \param rnti the identifier of an UE
571
   * 
572
   * 
573
   * \return true if the corresponding UeManager instance exists
574
   */
575
  bool HasUeManager (uint16_t rnti) const;
576
577
  /**
578
   *
579
   *
580
   * \param rnti the identifier of an UE
581
   *
572
   * \return the corresponding UeManager instance
582
   * \return the corresponding UeManager instance
573
   */
583
   */
574
  Ptr<UeManager> GetUeManager (uint16_t rnti);
584
  Ptr<UeManager> GetUeManager (uint16_t rnti);
 Lines 644-657    Link Here 
644
  void SetForwardUpCallback (Callback <void, Ptr<Packet> > cb);
654
  void SetForwardUpCallback (Callback <void, Ptr<Packet> > cb);
645
655
646
  /** 
656
  /** 
647
   * Method triggered when a UE is expected to get connected but does
657
   * Method triggered when a UE is expected to request for connection but does
648
   * not do so in a reasonable time
658
   * not do so in a reasonable time
649
   * 
659
   * 
650
   * \param rnti the T-C-RNTI whose timeout expired
660
   * \param rnti the T-C-RNTI whose timeout expired
651
   */
661
   */
652
  void ConnectionTimeout (uint16_t rnti);
662
  void ConnectionRequestTimeout (uint16_t rnti);
653
663
654
  /** 
664
  /** 
665
   * Method triggered when a UE is expected to complete a connection setup
666
   * procedure but does not do so in a reasonable time
667
   *
668
   * \param rnti the T-C-RNTI whose timeout expired
669
   */
670
  void ConnectionSetupTimeout (uint16_t rnti);
671
672
  /**
655
   * Method triggered a while after sending RRC Connection Rejected
673
   * Method triggered a while after sending RRC Connection Rejected
656
   * 
674
   * 
657
   * \param rnti the T-C-RNTI whose timeout expired
675
   * \param rnti the T-C-RNTI whose timeout expired
 Lines 950-956    Link Here 
950
  uint8_t m_rsrqFilterCoefficient;
968
  uint8_t m_rsrqFilterCoefficient;
951
969
952
  // timeouts
970
  // timeouts
953
  Time m_connectionTimeoutDuration;
971
  Time m_connectionRequestTimeoutDuration;
972
  Time m_connectionSetupTimeoutDuration;
954
  Time m_connectionRejectedTimeoutDuration;
973
  Time m_connectionRejectedTimeoutDuration;
955
  Time m_handoverJoiningTimeoutDuration;
974
  Time m_handoverJoiningTimeoutDuration;
956
  Time m_handoverLeavingTimeoutDuration;
975
  Time m_handoverLeavingTimeoutDuration;
(-)a/src/lte/model/lte-ue-mac.cc (+2 lines)
 Lines 528-533    Link Here 
528
          m_lcInfoMap.erase (it++);
528
          m_lcInfoMap.erase (it++);
529
        }
529
        }
530
    }
530
    }
531
532
  m_noRaResponseReceivedEvent.Cancel ();
531
  m_rachConfigured = false;
533
  m_rachConfigured = false;
532
  m_freshUlBsr = false;
534
  m_freshUlBsr = false;
533
  m_ulBsrReceived.clear ();
535
  m_ulBsrReceived.clear ();
(-)a/src/lte/model/lte-ue-rrc.cc (-1 / +29 lines)
 Lines 190-195    Link Here 
190
                   UintegerValue (0), // unused, read-only attribute
190
                   UintegerValue (0), // unused, read-only attribute
191
                   MakeUintegerAccessor (&LteUeRrc::GetRnti),
191
                   MakeUintegerAccessor (&LteUeRrc::GetRnti),
192
                   MakeUintegerChecker<uint16_t> ())
192
                   MakeUintegerChecker<uint16_t> ())
193
    .AddAttribute ("T300",
194
                   "Timer for the RRC Connection Establishment procedure "
195
                   "(i.e., the procedure is deemed as failed if it takes longer than this)",
196
                   TimeValue (MilliSeconds (100)),
197
                   MakeTimeAccessor (&LteUeRrc::m_t300),
198
                   MakeTimeChecker ())
193
    .AddTraceSource ("MibReceived",
199
    .AddTraceSource ("MibReceived",
194
                     "trace fired upon reception of Master Information Block",
200
                     "trace fired upon reception of Master Information Block",
195
                     MakeTraceSourceAccessor (&LteUeRrc::m_mibReceivedTrace))
201
                     MakeTraceSourceAccessor (&LteUeRrc::m_mibReceivedTrace))
 Lines 217-222    Link Here 
217
    .AddTraceSource ("ConnectionEstablished",
223
    .AddTraceSource ("ConnectionEstablished",
218
                     "trace fired upon successful RRC connection establishment",
224
                     "trace fired upon successful RRC connection establishment",
219
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionEstablishedTrace))
225
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionEstablishedTrace))
226
    .AddTraceSource ("ConnectionTimeout",
227
                     "trace fired upon timeout RRC connection establishment because of T300",
228
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionTimeoutTrace))
220
    .AddTraceSource ("ConnectionReconfiguration",
229
    .AddTraceSource ("ConnectionReconfiguration",
221
                     "trace fired upon RRC connection reconfiguration",
230
                     "trace fired upon RRC connection reconfiguration",
222
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionReconfigurationTrace))
231
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionReconfigurationTrace))
 Lines 488-493    Link Here 
488
        LteRrcSap::RrcConnectionRequest msg;
497
        LteRrcSap::RrcConnectionRequest msg;
489
        msg.ueIdentity = m_imsi;
498
        msg.ueIdentity = m_imsi;
490
        m_rrcSapUser->SendRrcConnectionRequest (msg); 
499
        m_rrcSapUser->SendRrcConnectionRequest (msg); 
500
        m_connectionTimeout = Simulator::Schedule (m_t300,
501
                                                   &LteUeRrc::ConnectionTimeout,
502
                                                   this);
491
      }
503
      }
492
      break;
504
      break;
493
505
 Lines 822-827    Link Here 
822
    case IDLE_CONNECTING:
834
    case IDLE_CONNECTING:
823
      {
835
      {
824
        ApplyRadioResourceConfigDedicated (msg.radioResourceConfigDedicated);
836
        ApplyRadioResourceConfigDedicated (msg.radioResourceConfigDedicated);
837
        m_connectionTimeout.Cancel ();
825
        SwitchToState (CONNECTED_NORMALLY);
838
        SwitchToState (CONNECTED_NORMALLY);
826
        LteRrcSap::RrcConnectionSetupCompleted msg2;
839
        LteRrcSap::RrcConnectionSetupCompleted msg2;
827
        msg2.rrcTransactionIdentifier = msg.rrcTransactionIdentifier;
840
        msg2.rrcTransactionIdentifier = msg.rrcTransactionIdentifier;
 Lines 965-972    Link Here 
965
LteUeRrc::DoRecvRrcConnectionReject (LteRrcSap::RrcConnectionReject msg)
978
LteUeRrc::DoRecvRrcConnectionReject (LteRrcSap::RrcConnectionReject msg)
966
{
979
{
967
  NS_LOG_FUNCTION (this);
980
  NS_LOG_FUNCTION (this);
968
  m_cmacSapProvider->Reset ();
981
  m_connectionTimeout.Cancel ();
982
983
  m_cmacSapProvider->Reset ();       // reset the MAC
984
  m_hasReceivedSib2 = false;         // invalidate the previously received SIB2
969
  SwitchToState (IDLE_CAMPED_NORMALLY);
985
  SwitchToState (IDLE_CAMPED_NORMALLY);
986
  m_asSapUser->NotifyConnectionFailed ();  // inform upper layer
970
}
987
}
971
988
972
989
 Lines 2729-2734    Link Here 
2729
}
2746
}
2730
2747
2731
void
2748
void
2749
LteUeRrc::ConnectionTimeout ()
2750
{
2751
  NS_LOG_FUNCTION (this << m_imsi);
2752
  m_cmacSapProvider->Reset ();       // reset the MAC
2753
  m_hasReceivedSib2 = false;         // invalidate the previously received SIB2
2754
  SwitchToState (IDLE_CAMPED_NORMALLY);
2755
  m_connectionTimeoutTrace (m_imsi, m_cellId, m_rnti);
2756
  m_asSapUser->NotifyConnectionFailed ();  // inform upper layer
2757
}
2758
2759
void
2732
LteUeRrc::DisposeOldSrb1 ()
2760
LteUeRrc::DisposeOldSrb1 ()
2733
{
2761
{
2734
  NS_LOG_FUNCTION (this);
2762
  NS_LOG_FUNCTION (this);
(-)a/src/lte/model/lte-ue-rrc.h (+21 lines)
 Lines 526-531    Link Here 
526
  //             imsi      cellId    rnti
526
  //             imsi      cellId    rnti
527
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;
527
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;
528
  //             imsi      cellId    rnti
528
  //             imsi      cellId    rnti
529
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionTimeoutTrace;
530
  //             imsi      cellId    rnti
529
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionReconfigurationTrace;
531
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionReconfigurationTrace;
530
  //             imsi      cellId    rnti      targetCellId
532
  //             imsi      cellId    rnti      targetCellId
531
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_handoverStartTrace;
533
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_handoverStartTrace;
 Lines 796-801    Link Here 
796
   */
798
   */
797
  void CancelLeavingTrigger (uint8_t measId, uint16_t cellId);
799
  void CancelLeavingTrigger (uint8_t measId, uint16_t cellId);
798
800
801
  /**
802
   * \brief Timer for RRC connection establishment procedure.
803
   *
804
   * Section 7.3 of 3GPP TS 36.331.
805
   */
806
  Time m_t300;
807
808
  /**
809
   * \brief Invokes ConnectionEstablishmentTimeout() if RRC connection
810
   *        establishment procedure for this UE takes longer than T300.
811
   */
812
  EventId m_connectionTimeout;
813
814
  /**
815
   * \brief Invoked after timer T300 expires, notifying upper layers that RRC
816
   *        connection establishment procedure has failed.
817
   */
818
  void ConnectionTimeout ();
819
799
}; // end of class LteUeRrc
820
}; // end of class LteUeRrc
800
821
801
822
(-)a/src/lte/test/test-lte-rrc.cc (-82 / +283 lines)
 Lines 36-77    Link Here 
36
   *
36
   *
37
   * 
37
   * 
38
   * \param nUes number of UEs in the test
38
   * \param nUes number of UEs in the test
39
   * \param tc connection time base value for all UEs in ms
39
   * \param nBearers number of bearers to be setup in each connection
40
   * \param tConnBase connection time base value for all UEs in ms
40
   * \param tConnIncrPerUe additional connection time increment for each UE index (0...nUes-1) in ms
41
   * \param tConnIncrPerUe additional connection time increment for each UE index (0...nUes-1) in ms
41
   * \param delayDiscStart expected duration to perform connection establishment in ms
42
   * \param delayDiscStart expected duration to perform connection establishment in ms
42
   *
43
   * \param ueDistance distance of the UEs to the serving eNodeB, relative to
44
   *                   the diagonal of the rectangular grid
45
   * \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 connections
47
   * \param rngRun run number for random number generator
48
   * \param description additional description of the test case
43
   */
49
   */
44
  LteRrcConnectionEstablishmentTestCase (uint32_t nUes, uint32_t nBearers, uint32_t tc, uint32_t tConnIncrPerUe, uint32_t delayDiscStart, bool useIdealRrc, bool admitRrcConnectionRequest);
50
  LteRrcConnectionEstablishmentTestCase (uint32_t nUes,
51
                                         uint32_t nBearers,
52
                                         uint32_t tConnBase,
53
                                         uint32_t tConnIncrPerUe,
54
                                         uint32_t delayDiscStart,
55
                                         double ueDistance,
56
                                         bool useIdealRrc,
57
                                         bool admitRrcConnectionRequest,
58
                                         int64_t rngRun = 1,
59
                                         std::string description = "");
45
60
46
private:
61
private:
47
  static std::string BuildNameString (uint32_t nUes, uint32_t nBearers, uint32_t tc, uint32_t tConnIncrPerUe, uint32_t delayDiscStart, bool useIdealRrc, bool admitRrcConnectionRequest);
62
  static std::string BuildNameString (uint32_t nUes,
63
                                      uint32_t nBearers,
64
                                      uint32_t tConnBase,
65
                                      uint32_t tConnIncrPerUe,
66
                                      uint32_t delayDiscStart,
67
                                      double ueDistance,
68
                                      bool useIdealRrc,
69
                                      bool admitRrcConnectionRequest,
70
                                      int64_t rngRun = 1,
71
                                      std::string description = "");
48
  virtual void DoRun (void);
72
  virtual void DoRun (void);
49
  void Connect (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
73
  void Connect (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
50
  void CheckConnected (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
74
  void CheckConnected (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
75
  void ConnectionEstablishedCallback (std::string context, uint64_t imsi,
76
                                      uint16_t cellId, uint16_t rnti);
77
  void ConnectionTimeoutCallback (std::string context, uint64_t imsi,
78
                                  uint16_t cellId, uint16_t rnti);
51
79
52
80
53
  uint32_t m_nUes; // number of UEs in the test
81
  uint32_t m_nUes; // number of UEs in the test
54
  uint32_t m_nBearers; // number of UEs in the test
82
  uint32_t m_nBearers; // number of bearers to be setup in each connection
55
  uint32_t m_tConnBase;  // connection time base value for all UEs in ms
83
  uint32_t m_tConnBase;  // connection time base value for all UEs in ms
56
  uint32_t m_tConnIncrPerUe; // additional connection time increment for each UE index (0...nUes-1) in ms
84
  uint32_t m_tConnIncrPerUe; // additional connection time increment for each UE index (0...nUes-1) in ms
57
  uint32_t m_delayConnEnd;  // expected duration to perform connection establishment in ms
85
  uint32_t m_delayConnEnd;  // expected duration to perform connection establishment in ms
58
  uint32_t m_delayDiscStart;  // delay between connection completed and disconnection request in ms
86
  uint32_t m_delayDiscStart;  // delay between connection completed and disconnection request in ms
59
  uint32_t m_delayDiscEnd; // expected duration to complete disconnection in ms
87
  uint32_t m_delayDiscEnd; // expected duration to complete disconnection in ms
60
  bool     m_useIdealRrc;
88
  double   m_ueDistance; // relative distance of the UEs to the serving eNodeB
61
  bool    m_admitRrcConnectionRequest; // If set to false, eNb will not allow ue connections
89
  bool     m_useIdealRrc; // If set to false, real RRC protocol model will be used
90
  bool     m_admitRrcConnectionRequest; // If set to false, eNb will not allow UE connections
91
  int64_t  m_rngRun; // run number for random number generator
62
  Ptr<LteHelper> m_lteHelper;
92
  Ptr<LteHelper> m_lteHelper;
63
93
94
  // key: IMSI
95
  std::map<uint64_t, bool> m_isConnectionEstablished;
64
};
96
};
65
97
66
98
67
std::string LteRrcConnectionEstablishmentTestCase::BuildNameString (uint32_t nUes, uint32_t nBearers, uint32_t tConnBase, uint32_t tConnIncrPerUe, uint32_t delayDiscStart, bool useIdealRrc, bool admitRrcConnectionRequest)
99
std::string
100
LteRrcConnectionEstablishmentTestCase::BuildNameString (uint32_t nUes,
101
                                                        uint32_t nBearers,
102
                                                        uint32_t tConnBase,
103
                                                        uint32_t tConnIncrPerUe,
104
                                                        uint32_t delayDiscStart,
105
                                                        double ueDistance,
106
                                                        bool useIdealRrc,
107
                                                        bool admitRrcConnectionRequest,
108
                                                        int64_t rngRun,
109
                                                        std::string description)
68
{
110
{
69
  std::ostringstream oss;
111
  std::ostringstream oss;
70
  oss << "nUes=" << nUes
112
  oss << "nUes=" << nUes
71
      << ", nBearers=" << nBearers
113
      << ", nBearers=" << nBearers
72
      << ", tConnBase=" << tConnBase
114
      << ", tConnBase=" << tConnBase
73
      << ", tConnIncrPerUe=" << tConnIncrPerUe
115
      << ", tConnIncrPerUe=" << tConnIncrPerUe
74
      << ", delayDiscStart=" << delayDiscStart;
116
      << ", delayDiscStart=" << delayDiscStart
117
      << ", ueDistance=" << ueDistance;
118
75
  if (useIdealRrc)
119
  if (useIdealRrc)
76
    {
120
    {
77
      oss << ", ideal RRC";
121
      oss << ", ideal RRC";
 Lines 80-85    Link Here 
80
    {
124
    {
81
      oss << ", real RRC";
125
      oss << ", real RRC";
82
    }
126
    }
127
83
  if (admitRrcConnectionRequest)
128
  if (admitRrcConnectionRequest)
84
    {
129
    {
85
      oss << ", admitRrcConnectionRequest = true";
130
      oss << ", admitRrcConnectionRequest = true";
 Lines 88-98    Link Here 
88
    {
133
    {
89
      oss << ", admitRrcConnectionRequest = false";
134
      oss << ", admitRrcConnectionRequest = false";
90
    }
135
    }
136
137
  if (rngRun != 1)
138
    {
139
      oss << ", rngRun=" << rngRun;
140
    }
141
142
  if (!description.empty ())
143
    {
144
      oss << ", " << description;
145
    }
146
91
  return oss.str ();
147
  return oss.str ();
92
}
148
}
93
149
94
LteRrcConnectionEstablishmentTestCase::LteRrcConnectionEstablishmentTestCase (uint32_t nUes, uint32_t nBearers, uint32_t tConnBase, uint32_t tConnIncrPerUe, uint32_t delayDiscStart, bool useIdealRrc, bool admitRrcConnectionRequest)
150
LteRrcConnectionEstablishmentTestCase::LteRrcConnectionEstablishmentTestCase (
95
  : TestCase (BuildNameString (nUes, nBearers, tConnBase, tConnIncrPerUe, delayDiscStart, useIdealRrc, admitRrcConnectionRequest)),
151
    uint32_t nUes, uint32_t nBearers,
152
    uint32_t tConnBase, uint32_t tConnIncrPerUe,
153
    uint32_t delayDiscStart, double ueDistance,
154
    bool useIdealRrc, bool admitRrcConnectionRequest,
155
    int64_t rngRun, std::string description)
156
  : TestCase (BuildNameString (nUes, nBearers,
157
                               tConnBase, tConnIncrPerUe,
158
                               delayDiscStart, ueDistance,
159
                               useIdealRrc, admitRrcConnectionRequest,
160
                               rngRun, description)),
96
    m_nUes (nUes),
161
    m_nUes (nUes),
97
    m_nBearers (nBearers),
162
    m_nBearers (nBearers),
98
    m_tConnBase (tConnBase),
163
    m_tConnBase (tConnBase),
 Lines 100-107    Link Here 
100
165
101
    m_delayDiscStart (delayDiscStart),
166
    m_delayDiscStart (delayDiscStart),
102
    m_delayDiscEnd (10),
167
    m_delayDiscEnd (10),
168
    m_ueDistance (ueDistance),
103
    m_useIdealRrc (useIdealRrc),
169
    m_useIdealRrc (useIdealRrc),
104
    m_admitRrcConnectionRequest (admitRrcConnectionRequest)
170
    m_admitRrcConnectionRequest (admitRrcConnectionRequest),
171
    m_rngRun (rngRun)
105
{
172
{
106
  // see the description of d^e in the LTE testing docs
173
  // see the description of d^e in the LTE testing docs
107
  double dsi = 90;
174
  double dsi = 90;
 Lines 110-123    Link Here 
110
    {
177
    {
111
      nRaAttempts += 5;
178
      nRaAttempts += 5;
112
    }
179
    }
180
  else if (nUes <= 50)
181
    {
182
      nRaAttempts += 10;
183
    }
184
  else if (nUes <= 100)
185
    {
186
      nRaAttempts += 20;
187
    }
113
  else
188
  else
114
    {
189
    {
115
      NS_ASSERT (nUes <= 50);
190
      NS_ASSERT (nUes <= 200);
116
      nRaAttempts += 10;
191
      nRaAttempts += 40;
117
    }
192
    }
193
118
  nRaAttempts += std::ceil (nUes / 4.0);
194
  nRaAttempts += std::ceil (nUes / 4.0);
119
  double dra = nRaAttempts * 7;
195
  double dra = nRaAttempts * 7;
120
  double dce = 10.0 + (2.0 * nUes) / 4.0;
196
  double dce = 10.0 + (2.0 * nUes) / 4.0;
197
  if (ueDistance > 0.2)
198
    {
199
      /*
200
       * Interference may affect the probability of successful connection
201
       * setup. If it fails, the UE has to repeat again from acquiring system
202
       * information.
203
       */
204
      dce += dsi + dce;
205
    }
121
  double nCrs;
206
  double nCrs;
122
  if (nUes <= 2)
207
  if (nUes <= 2)
123
    {
208
    {
 Lines 142-148    Link Here 
142
  double dcr =  (10.0 + (2.0 * nUes) / 4.0) * (m_nBearers + nCrs);
227
  double dcr =  (10.0 + (2.0 * nUes) / 4.0) * (m_nBearers + nCrs);
143
228
144
  m_delayConnEnd = round (dsi + dra + dce + dcr);
229
  m_delayConnEnd = round (dsi + dra + dce + dcr);
145
  NS_LOG_LOGIC (this << GetName () << " dsi=" << dsi << " dra=" << dra << " dce=" << dce << " dcr=" << dcr << " m_delayConnEnd=" << m_delayConnEnd);
230
  NS_LOG_LOGIC (this << " " << GetName () << " dsi=" << dsi << " dra=" << dra << " dce=" << dce << " dcr=" << dcr << " m_delayConnEnd=" << m_delayConnEnd);
146
}
231
}
147
232
148
void
233
void
 Lines 150-155    Link Here 
150
{
235
{
151
  NS_LOG_FUNCTION (this << GetName ());
236
  NS_LOG_FUNCTION (this << GetName ());
152
  Config::Reset ();
237
  Config::Reset ();
238
  Config::SetGlobal ("RngRun", IntegerValue (m_rngRun));
153
239
154
  if (m_nUes < 25)
240
  if (m_nUes < 25)
155
    {
241
    {
 Lines 173-193    Link Here 
173
  m_lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (m_useIdealRrc));
259
  m_lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (m_useIdealRrc));
174
260
175
  NodeContainer enbNodes;
261
  NodeContainer enbNodes;
176
  enbNodes.Create (1);
262
  enbNodes.Create (4);
177
  NodeContainer ueNodes;
263
  NodeContainer ueNodes;
178
  ueNodes.Create (m_nUes);
264
  ueNodes.Create (m_nUes);
179
265
266
  // Assign nodes to position
267
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
268
  positionAlloc->Add (Vector (0, 0, 0));
269
  positionAlloc->Add (Vector (100.0, 0, 0));
270
  positionAlloc->Add (Vector (0, 100.0, 0));
271
  positionAlloc->Add (Vector (100.0, 100.0, 0));
272
  for (uint16_t i = 0; i < m_nUes; i++)
273
    {
274
      positionAlloc->Add (Vector (m_ueDistance * 100.0,
275
                                  m_ueDistance * 100.0,
276
                                  0.0));
277
    }
278
180
  MobilityHelper mobility;
279
  MobilityHelper mobility;
181
  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
280
  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
281
  mobility.SetPositionAllocator (positionAlloc);
182
  mobility.Install (enbNodes);
282
  mobility.Install (enbNodes);
183
  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
184
  mobility.Install (ueNodes);
283
  mobility.Install (ueNodes);
185
284
285
  int64_t stream = 1;
186
  NetDeviceContainer enbDevs;
286
  NetDeviceContainer enbDevs;
187
  enbDevs = m_lteHelper->InstallEnbDevice (enbNodes);
287
  enbDevs = m_lteHelper->InstallEnbDevice (enbNodes);
288
  stream += m_lteHelper->AssignStreams (enbDevs, stream);
188
289
189
  NetDeviceContainer ueDevs;
290
  NetDeviceContainer ueDevs;
190
  ueDevs = m_lteHelper->InstallUeDevice (ueNodes);
291
  ueDevs = m_lteHelper->InstallUeDevice (ueNodes);
292
  stream += m_lteHelper->AssignStreams (ueDevs, stream);
191
293
192
  // custom code used for testing purposes
294
  // custom code used for testing purposes
193
  // instead of lteHelper->Attach () and lteHelper->ActivateXxx
295
  // instead of lteHelper->Attach () and lteHelper->ActivateXxx
 Lines 225-233    Link Here 
225
327
226
      // disconnection not supported yet
328
      // disconnection not supported yet
227
329
330
      uint64_t imsi = ueLteDevice->GetImsi ();
331
      m_isConnectionEstablished[imsi] = false;
332
228
      ++i;
333
      ++i;
229
    }
334
    }
230
335
336
  // Connect to trace sources in UEs
337
  Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionEstablished",
338
                   MakeCallback (&LteRrcConnectionEstablishmentTestCase::ConnectionEstablishedCallback,
339
                                 this));
340
  Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionTimeout",
341
                   MakeCallback (&LteRrcConnectionEstablishmentTestCase::ConnectionTimeoutCallback,
342
                                 this));
231
343
232
  Simulator::Stop (MilliSeconds (tmax + 1));
344
  Simulator::Stop (MilliSeconds (tmax + 1));
233
345
 Lines 240-245    Link Here 
240
void
352
void
241
LteRrcConnectionEstablishmentTestCase::Connect (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice)
353
LteRrcConnectionEstablishmentTestCase::Connect (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice)
242
{
354
{
355
  NS_LOG_FUNCTION (this);
243
  m_lteHelper->Attach (ueDevice, enbDevice);
356
  m_lteHelper->Attach (ueDevice, enbDevice);
244
357
245
  for (uint32_t b = 0; b < m_nBearers; ++b)
358
  for (uint32_t b = 0; b < m_nBearers; ++b)
 Lines 249-280    Link Here 
249
      m_lteHelper->ActivateDataRadioBearer (ueDevice, bearer);
362
      m_lteHelper->ActivateDataRadioBearer (ueDevice, bearer);
250
    }
363
    }
251
}
364
}
365
252
void
366
void
253
LteRrcConnectionEstablishmentTestCase::CheckConnected (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice)
367
LteRrcConnectionEstablishmentTestCase::CheckConnected (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice)
254
{
368
{
255
  Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice> ();
369
  Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice> ();
256
  Ptr<LteUeRrc> ueRrc = ueLteDevice->GetRrc ();
370
  Ptr<LteUeRrc> ueRrc = ueLteDevice->GetRrc ();
371
  const uint64_t imsi = ueLteDevice->GetImsi ();
372
  const uint16_t rnti = ueRrc->GetRnti ();
373
  NS_LOG_FUNCTION (this << imsi << rnti);
374
  NS_ASSERT_MSG (m_isConnectionEstablished.find (imsi) != m_isConnectionEstablished.end (),
375
                 "Invalid IMSI " << imsi);
257
376
258
  if (!m_admitRrcConnectionRequest)
377
  if (!m_admitRrcConnectionRequest)
259
    {
378
    {
260
      NS_TEST_ASSERT_MSG_EQ (ueRrc->GetState (), LteUeRrc::IDLE_CAMPED_NORMALLY, "Wrong LteUeRrc state!");
379
      NS_TEST_ASSERT_MSG_EQ (m_isConnectionEstablished[imsi], false,
380
                             "Connection with RNTI " << rnti << " should have been rejected");
261
      return;
381
      return;
262
    }
382
    }
263
383
264
  NS_TEST_ASSERT_MSG_EQ (ueRrc->GetState (), LteUeRrc::CONNECTED_NORMALLY, "Wrong LteUeRrc state!");
384
  /*
385
   * Verifying UE state in UE RRC. Try to increase the test case duration if
386
   * the following checks.
387
   */
388
  NS_TEST_ASSERT_MSG_EQ (m_isConnectionEstablished[imsi], true,
389
                         "RNTI " << rnti << " fails to establish connection");
390
  NS_TEST_ASSERT_MSG_EQ (ueRrc->GetState (), LteUeRrc::CONNECTED_NORMALLY,
391
                         "RNTI " << rnti << " is not at CONNECTED_NORMALLY state");
392
393
  // Verifying UE context state in eNodeB RRC.
265
394
266
  Ptr<LteEnbNetDevice> enbLteDevice = enbDevice->GetObject<LteEnbNetDevice> ();
395
  Ptr<LteEnbNetDevice> enbLteDevice = enbDevice->GetObject<LteEnbNetDevice> ();
267
  Ptr<LteEnbRrc> enbRrc = enbLteDevice->GetRrc ();
396
  Ptr<LteEnbRrc> enbRrc = enbLteDevice->GetRrc ();
268
  uint16_t rnti = ueRrc->GetRnti ();
397
  const bool hasContext = enbRrc->HasUeManager (rnti);
269
  Ptr<UeManager> ueManager = enbRrc->GetUeManager (rnti);
270
  NS_TEST_ASSERT_MSG_NE (ueManager, 0, "RNTI " << rnti << " not found in eNB");
271
398
272
  NS_TEST_ASSERT_MSG_EQ (ueManager->GetState (), UeManager::CONNECTED_NORMALLY, "Wrong UeManager state!");
399
  if (hasContext)
400
    {
401
      Ptr<UeManager> ueManager = enbRrc->GetUeManager (rnti);
402
      NS_ASSERT (ueManager != 0);
403
      UeManager::State state = ueManager->GetState ();
404
      /*
405
       * At the moment, failure in RRC Connection Reconfiguration is outside
406
       * the scope of this test case, so we simply accept them as a valid case.
407
       */
408
      bool isValidState = (state == UeManager::CONNECTED_NORMALLY)
409
                           || (state == UeManager::CONNECTION_RECONFIGURATION);
410
      NS_TEST_ASSERT_MSG_EQ (isValidState, true,
411
                             "The context of RNTI " << rnti << " is in invalid state");
412
    }
413
  else
414
    {
415
       NS_LOG_WARN (this << " RNTI " << rnti << " thinks that it has"
416
                         << " established connection but the eNodeB thinks"
417
                         << " that the UE has failed on connection setup.");
418
       /*
419
        * The standard specifies that this case would the maximum retransmission
420
        * limit at UE RLC (SRB1), which will trigger an RLF. However, this
421
        * behaviour is not implemented yet.
422
        */
423
    }
424
425
  // Verifying other attributes on both sides.
273
426
274
  uint16_t ueCellId = ueRrc->GetCellId ();
427
  uint16_t ueCellId = ueRrc->GetCellId ();
275
  uint16_t enbCellId = enbLteDevice->GetCellId ();
428
  uint16_t enbCellId = enbLteDevice->GetCellId ();
276
  uint16_t ueImsi = ueLteDevice->GetImsi ();
429
  uint16_t ueImsi = ueLteDevice->GetImsi ();
277
  uint16_t enbImsi = ueManager->GetImsi ();
430
278
  uint8_t ueDlBandwidth = ueRrc->GetDlBandwidth ();
431
  uint8_t ueDlBandwidth = ueRrc->GetDlBandwidth ();
279
  uint8_t enbDlBandwidth = enbLteDevice->GetDlBandwidth ();
432
  uint8_t enbDlBandwidth = enbLteDevice->GetDlBandwidth ();
280
  uint8_t ueUlBandwidth = ueRrc->GetUlBandwidth ();
433
  uint8_t ueUlBandwidth = ueRrc->GetUlBandwidth ();
 Lines 284-325    Link Here 
284
  uint8_t ueUlEarfcn = ueRrc->GetUlEarfcn ();
437
  uint8_t ueUlEarfcn = ueRrc->GetUlEarfcn ();
285
  uint8_t enbUlEarfcn = enbLteDevice->GetUlEarfcn ();
438
  uint8_t enbUlEarfcn = enbLteDevice->GetUlEarfcn ();
286
439
287
288
  NS_TEST_ASSERT_MSG_EQ (ueCellId, enbCellId, "inconsistent CellId");
440
  NS_TEST_ASSERT_MSG_EQ (ueCellId, enbCellId, "inconsistent CellId");
289
  NS_TEST_ASSERT_MSG_EQ (ueImsi, enbImsi, "inconsistent Imsi");
290
  NS_TEST_ASSERT_MSG_EQ (ueDlBandwidth, enbDlBandwidth, "inconsistent DlBandwidth");
441
  NS_TEST_ASSERT_MSG_EQ (ueDlBandwidth, enbDlBandwidth, "inconsistent DlBandwidth");
291
  NS_TEST_ASSERT_MSG_EQ (ueUlBandwidth, enbUlBandwidth, "inconsistent UlBandwidth");
442
  NS_TEST_ASSERT_MSG_EQ (ueUlBandwidth, enbUlBandwidth, "inconsistent UlBandwidth");
292
  NS_TEST_ASSERT_MSG_EQ (ueDlEarfcn, enbDlEarfcn, "inconsistent DlEarfcn");
443
  NS_TEST_ASSERT_MSG_EQ (ueDlEarfcn, enbDlEarfcn, "inconsistent DlEarfcn");
293
  NS_TEST_ASSERT_MSG_EQ (ueUlEarfcn, enbUlEarfcn, "inconsistent UlEarfcn");
444
  NS_TEST_ASSERT_MSG_EQ (ueUlEarfcn, enbUlEarfcn, "inconsistent UlEarfcn");
294
445
295
  ObjectMapValue enbDataRadioBearerMapValue;
446
  if (hasContext)
296
  ueManager->GetAttribute ("DataRadioBearerMap", enbDataRadioBearerMapValue);
447
    {
297
  NS_TEST_ASSERT_MSG_EQ (enbDataRadioBearerMapValue.GetN (), m_nBearers, "wrong num bearers at eNB");
448
      Ptr<UeManager> ueManager = enbRrc->GetUeManager (rnti);
449
      NS_ASSERT (ueManager != 0);
450
      UeManager::State state = ueManager->GetState ();
451
      uint16_t enbImsi = ueManager->GetImsi ();
452
      NS_TEST_ASSERT_MSG_EQ (ueImsi, enbImsi, "inconsistent Imsi");
298
453
299
  ObjectMapValue ueDataRadioBearerMapValue;
454
      if (state == UeManager::CONNECTED_NORMALLY)
300
  ueRrc->GetAttribute ("DataRadioBearerMap", ueDataRadioBearerMapValue);
455
        {
301
  NS_TEST_ASSERT_MSG_EQ (ueDataRadioBearerMapValue.GetN (), m_nBearers, "wrong num bearers at UE");
456
          ObjectMapValue enbDataRadioBearerMapValue;
457
          ueManager->GetAttribute ("DataRadioBearerMap", enbDataRadioBearerMapValue);
458
          NS_TEST_ASSERT_MSG_EQ (enbDataRadioBearerMapValue.GetN (), m_nBearers, "wrong num bearers at eNB");
459
          ObjectMapValue ueDataRadioBearerMapValue;
460
          ueRrc->GetAttribute ("DataRadioBearerMap", ueDataRadioBearerMapValue);
461
          NS_TEST_ASSERT_MSG_EQ (ueDataRadioBearerMapValue.GetN (), m_nBearers, "wrong num bearers at UE");
302
462
303
  ObjectMapValue::Iterator enbBearerIt = enbDataRadioBearerMapValue.Begin ();
463
          ObjectMapValue::Iterator enbBearerIt = enbDataRadioBearerMapValue.Begin ();
304
  ObjectMapValue::Iterator ueBearerIt = ueDataRadioBearerMapValue.Begin ();
464
          ObjectMapValue::Iterator ueBearerIt = ueDataRadioBearerMapValue.Begin ();
305
  while (enbBearerIt != enbDataRadioBearerMapValue.End ()
465
          while (enbBearerIt != enbDataRadioBearerMapValue.End ()
306
         && ueBearerIt != ueDataRadioBearerMapValue.End ())
466
                 && ueBearerIt != ueDataRadioBearerMapValue.End ())
307
    {
467
            {
308
      Ptr<LteDataRadioBearerInfo> enbDrbInfo = enbBearerIt->second->GetObject<LteDataRadioBearerInfo> ();
468
              Ptr<LteDataRadioBearerInfo> enbDrbInfo = enbBearerIt->second->GetObject<LteDataRadioBearerInfo> ();
309
      Ptr<LteDataRadioBearerInfo> ueDrbInfo = ueBearerIt->second->GetObject<LteDataRadioBearerInfo> ();
469
              Ptr<LteDataRadioBearerInfo> ueDrbInfo = ueBearerIt->second->GetObject<LteDataRadioBearerInfo> ();
310
      //NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_epsBearer, ueDrbInfo->m_epsBearer, "epsBearer differs");
470
              //NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_epsBearer, ueDrbInfo->m_epsBearer, "epsBearer differs");
311
      NS_TEST_ASSERT_MSG_EQ ((uint32_t) enbDrbInfo->m_epsBearerIdentity, (uint32_t) ueDrbInfo->m_epsBearerIdentity, "epsBearerIdentity differs");
471
              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");
472
              NS_TEST_ASSERT_MSG_EQ ((uint32_t) enbDrbInfo->m_drbIdentity, (uint32_t) ueDrbInfo->m_drbIdentity, "drbIdentity differs");
313
      //NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_rlcConfig, ueDrbInfo->m_rlcConfig, "rlcConfig differs");
473
              //NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_rlcConfig, ueDrbInfo->m_rlcConfig, "rlcConfig differs");
314
      NS_TEST_ASSERT_MSG_EQ ((uint32_t) enbDrbInfo->m_logicalChannelIdentity, (uint32_t) ueDrbInfo->m_logicalChannelIdentity, "logicalChannelIdentity differs");
474
              NS_TEST_ASSERT_MSG_EQ ((uint32_t) enbDrbInfo->m_logicalChannelIdentity, (uint32_t) ueDrbInfo->m_logicalChannelIdentity, "logicalChannelIdentity differs");
315
      //NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_logicalChannelConfig, ueDrbInfo->m_logicalChannelConfig, "logicalChannelConfig differs");
475
              //NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_logicalChannelConfig, ueDrbInfo->m_logicalChannelConfig, "logicalChannelConfig differs");
316
476
317
      ++enbBearerIt;
477
              ++enbBearerIt;
318
      ++ueBearerIt;
478
              ++ueBearerIt;
479
            }
480
481
          NS_ASSERT_MSG (enbBearerIt == enbDataRadioBearerMapValue.End (), "too many bearers at eNB");
482
          NS_ASSERT_MSG (ueBearerIt == ueDataRadioBearerMapValue.End (), "too many bearers at UE");
483
        }
319
    }
484
    }
320
  NS_ASSERT_MSG (enbBearerIt == enbDataRadioBearerMapValue.End (), "too many bearers at eNB");
485
}
321
  NS_ASSERT_MSG (ueBearerIt == ueDataRadioBearerMapValue.End (), "too many bearers at UE");
322
486
487
void
488
LteRrcConnectionEstablishmentTestCase::ConnectionEstablishedCallback (
489
    std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
490
{
491
  NS_LOG_FUNCTION (this << imsi << cellId);
492
  m_isConnectionEstablished[imsi] = true;
493
}
494
495
496
void
497
LteRrcConnectionEstablishmentTestCase::ConnectionTimeoutCallback (
498
    std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
499
{
500
  NS_LOG_FUNCTION (this << imsi << cellId);
323
}
501
}
324
502
325
503
 Lines 334-379    Link Here 
334
LteRrcTestSuite::LteRrcTestSuite ()
512
LteRrcTestSuite::LteRrcTestSuite ()
335
  : TestSuite ("lte-rrc", SYSTEM)
513
  : TestSuite ("lte-rrc", SYSTEM)
336
{
514
{
515
//  LogComponentEnableAll (LOG_PREFIX_ALL);
516
//  LogComponentEnable ("LteRrcTest", LOG_LEVEL_ALL);
517
//  LogComponentEnable ("LteEnbRrc", LOG_INFO);
518
//  LogComponentEnable ("LteUeRrc", LOG_INFO);
519
337
  NS_LOG_FUNCTION (this);
520
  NS_LOG_FUNCTION (this);
338
521
339
  for (uint32_t useIdealRrc = 0; useIdealRrc <= 1; ++useIdealRrc)
522
  for (uint32_t useIdealRrc = 0; useIdealRrc <= 1; ++useIdealRrc)
340
    {
523
    {
341
      //         <----- all times in ms ----------------->
524
      //         <----- all times in ms ----------------->
342
      //                                                     nUes, nBearers, tConnBase, tConnIncrPerUe, delayDiscStart, useIdealRrc, admitRrcConnectionRequest
343
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,        0,         0,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
344
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,        0,       100,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
345
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,        1,         0,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
346
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,        1,       100,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
347
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,        2,         0,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
348
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,        2,       100,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
349
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        0,        20,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
350
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        0,        20,             10,             1, useIdealRrc, true), TestCase::EXTENSIVE);
351
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        0,        20,            100,             1, useIdealRrc, true), TestCase::EXTENSIVE);
352
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        1,        20,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
353
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        1,        20,             10,             1, useIdealRrc, true), TestCase::EXTENSIVE);
354
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        1,        20,            100,             1, useIdealRrc, true), TestCase::EXTENSIVE);
355
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        2,        20,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
356
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        2,        20,             10,             1, useIdealRrc, true), TestCase::QUICK);
357
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        2,        20,            100,             1, useIdealRrc, true), TestCase::EXTENSIVE);
358
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  3,        0,        20,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
359
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  4,        0,        20,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
360
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  4,        0,        20,            300,             1, useIdealRrc, true), TestCase::EXTENSIVE);
361
      AddTestCase (new LteRrcConnectionEstablishmentTestCase ( 20,        0,        10,              1,             1, useIdealRrc, true), TestCase::EXTENSIVE);
362
      AddTestCase (new LteRrcConnectionEstablishmentTestCase ( 50,        0,         0,              0,             1, useIdealRrc, true), TestCase::EXTENSIVE);
363
525
364
      //Test cases to check admitRrcConnectionRequest=false
526
      // Test cases with high interference
365
      //                                                     nUes, nBearers, tConnBase, tConnIncrPerUe, delayDiscStart, useIdealRrc, admitRrcConnectionRequest
527
      //                                                        nBearers       tConnIncrPerUe            ueDistance
366
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,        0,         0,              0,             1, useIdealRrc, false), TestCase::EXTENSIVE);
528
      //                                                     nUes      tConnBase            delayDiscStart          useIdealRrc  admitRrcConnectionRequest
367
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,        2,       100,              0,             1, useIdealRrc, false), TestCase::EXTENSIVE);
529
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     1,      0,           0,           1,   0.55, useIdealRrc, true,
368
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        0,        20,              0,             1, useIdealRrc, false), TestCase::EXTENSIVE);
530
                                                                1, "failure at RRC Connection Setup, then successful"), TestCase::QUICK);
369
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,        1,        20,              0,             1, useIdealRrc, false), TestCase::QUICK);
531
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     1,      0,           0,           1,   0.55, useIdealRrc, true,
370
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  3,        0,        20,              0,             1, useIdealRrc, false), TestCase::EXTENSIVE);
532
                                                                3, "failure at RRC Connection Setup Complete"), TestCase::QUICK);
533
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     1,      0,           0,           1,   0.55, useIdealRrc, true,
534
                                                                5, "failure at RRC Connection Reconfiguration"), TestCase::QUICK);
535
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     1,      0,           0,           1,   0.55, useIdealRrc, true,
536
                                                                7, "successful case"), TestCase::QUICK);
371
537
372
      //time consuming tests with a lot of UEs
538
      // Test cases with minimal interference
373
      // AddTestCase (new LteRrcConnectionEstablishmentTestCase (100,        0,        10,              0,             1, useIdealRrc, true), TestCase::TAKES_FOREVER);
539
      //                                                        nBearers       tConnIncrPerUe            ueDistance
374
      // AddTestCase (new LteRrcConnectionEstablishmentTestCase (100,        0,        10,              1,             1, useIdealRrc, true), TestCase::TAKES_FOREVER);
540
      //                                                     nUes      tConnBase            delayDiscStart          useIdealRrc  admitRrcConnectionRequest
375
      // AddTestCase (new LteRrcConnectionEstablishmentTestCase (200,        0,        10,              0,             1, useIdealRrc, true), TestCase::TAKES_FOREVER);
541
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     0,      0,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
376
      // AddTestCase (new LteRrcConnectionEstablishmentTestCase (200,        0,        10,              1,             1, useIdealRrc, true), TestCase::TAKES_FOREVER);
542
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     0,    100,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
543
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     1,      0,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
544
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     1,    100,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
545
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     2,      0,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
546
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     2,    100,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
547
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     0,     20,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
548
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     0,     20,          10,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
549
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     0,     20,         100,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
550
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     1,     20,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
551
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     1,     20,          10,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
552
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     1,     20,         100,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
553
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     2,     20,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
554
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     2,     20,          10,           1,    0.0, useIdealRrc, true), TestCase::QUICK);
555
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     2,     20,         100,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
556
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  3,     0,     20,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
557
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  4,     0,     20,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
558
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  4,     0,     20,         300,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
559
      AddTestCase (new LteRrcConnectionEstablishmentTestCase ( 20,     0,     10,           1,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
560
      AddTestCase (new LteRrcConnectionEstablishmentTestCase ( 50,     0,      0,           0,           1,    0.0, useIdealRrc, true), TestCase::EXTENSIVE);
561
562
      // Test cases to check admitRrcConnectionRequest=false
563
      //                                                        nBearers       tConnIncrPerUe            ueDistance
564
      //                                                     nUes      tConnBase            delayDiscStart          useIdealRrc  admitRrcConnectionRequest
565
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     0,      0,           0,           1,    0.0, useIdealRrc, false), TestCase::EXTENSIVE);
566
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  1,     2,    100,           0,           1,    0.0, useIdealRrc, false), TestCase::EXTENSIVE);
567
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     0,     20,           0,           1,    0.0, useIdealRrc, false), TestCase::EXTENSIVE);
568
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  2,     1,     20,           0,           1,    0.0, useIdealRrc, false), TestCase::QUICK);
569
      AddTestCase (new LteRrcConnectionEstablishmentTestCase (  3,     0,     20,           0,           1,    0.0, useIdealRrc, false), TestCase::EXTENSIVE);
570
571
      // Time consuming tests with a lot of UEs
572
      //                                                        nBearers       tConnIncrPerUe            ueDistance
573
      //                                                     nUes      tConnBase            delayDiscStart          useIdealRrc  admitRrcConnectionRequest
574
      //AddTestCase (new LteRrcConnectionEstablishmentTestCase (100,     0,     10,           0,           1,    0.0, useIdealRrc, true), TestCase::TAKES_FOREVER);
575
      //AddTestCase (new LteRrcConnectionEstablishmentTestCase (100,     0,     10,           1,           1,    0.0, useIdealRrc, true), TestCase::TAKES_FOREVER);
576
      //AddTestCase (new LteRrcConnectionEstablishmentTestCase (200,     0,     10,           0,           1,    0.0, useIdealRrc, true), TestCase::TAKES_FOREVER);
577
      //AddTestCase (new LteRrcConnectionEstablishmentTestCase (200,     0,     10,           1,           1,    0.0, useIdealRrc, true), TestCase::TAKES_FOREVER);
377
    }
578
    }
378
}
579
}
379
580

Return to bug 1762