Moved LteHelper::Connect functionality into LteHelper::Attach

This commit is contained in:
Budiarto Herman
2013-08-02 14:38:56 +03:00
parent 3ad66df568
commit 7c0d6d1255
4 changed files with 56 additions and 54 deletions

View File

@@ -2098,9 +2098,9 @@ Section :ref:`sec-network-attachment` of user documentation.
When the cell passes all the above criteria, then the cell is deemed as
*suitable*. Next, UE camps to it, switching its RRC state to
`IDLE_WAIT_SYSTEM_INFO`, or to `IDLE_CAMPED_NORMALLY` if SIB2 has been received.
After this, the UE may request to enter CONNECTED mode, which can be done by
calling ``LteHelper::Connect`` function; please refer to section
:ref:`sec-rrc-connection-establishment` for details on this.
After this, upper layer may request UE to enter CONNECTED mode. Please refer to
section :ref:`sec-rrc-connection-establishment` for details on this.
On the other hand, when the cell does not pass the CSG criterion, then the cell
is labeled as *acceptable* (Section 10.1.1.1 [TS36300]_). In this case, the RRC

View File

@@ -611,8 +611,19 @@ LteHelper::Attach (Ptr<NetDevice> ueDevice)
NS_FATAL_ERROR ("The passed NetDevice must be an LteUeNetDevice");
}
// execute cell search
Ptr<LteUePhy> uePhy = ueLteDevice->GetPhy ();
uePhy->CellSearch ();
// instruct UE to immediately enter CONNECTED mode after camping
Ptr<EpcUeNas> ueNas = ueLteDevice->GetNas ();
NS_ASSERT (ueNas != 0);
ueNas->Connect ();
// activate default EPS bearer
m_epcHelper->ActivateEpsBearer (ueDevice, ueLteDevice->GetImsi (),
EpcTft::Default (),
EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT));
}
void
@@ -682,43 +693,6 @@ LteHelper::AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDe
Attach (ueDevice, closestEnbDevice);
}
void
LteHelper::Connect (NetDeviceContainer ueDevices)
{
NS_LOG_FUNCTION (this);
for (NetDeviceContainer::Iterator i = ueDevices.Begin (); i != ueDevices.End (); ++i)
{
Connect (*i);
}
}
void
LteHelper::Connect (Ptr<NetDevice> ueDevice)
{
NS_LOG_FUNCTION (this);
Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice> ();
if (ueLteDevice == 0)
{
NS_FATAL_ERROR ("The passed NetDevice must be an LteUeNetDevice");
}
Ptr<EpcUeNas> ueNas = ueLteDevice->GetNas ();
NS_ASSERT (ueNas != 0);
ueNas->Connect ();
if (m_epcHelper == 0)
{
// TODO activate bearer for without-EPC simulation
}
else
{
// activate default EPS bearer
m_epcHelper->ActivateEpsBearer (ueDevice, ueLteDevice->GetImsi (), EpcTft::Default (),
EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT));
}
}
void
LteHelper::ActivateDedicatedEpsBearer (NetDeviceContainer ueDevices, EpsBearer bearer, Ptr<EpcTft> tft)
{
@@ -736,7 +710,7 @@ LteHelper::ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer
NS_LOG_FUNCTION (this);
NS_ASSERT_MSG (m_epcHelper != 0, "dedicated EPS bearers cannot be set up when EPC is not used");
uint64_t imsi = ueDevice->GetObject<LteUeNetDevice> ()->GetImsi ();
m_epcHelper->ActivateEpsBearer (ueDevice, imsi, tft, bearer);
}

View File

@@ -188,8 +188,16 @@ public:
* \param ueDevices the set of UE devices to be attached
*
* By calling this, the UE will start the initial cell selection procedure at
* the beginning of simulation. Note that this function can only be used in
* EPC-enabled simulation.
* the beginning of simulation. In addition, the function also instructs each
* UE to immediately enter CONNECTED mode and activates the default EPS
* bearer.
*
* If this function is called when the UE is in a situation where entering
* CONNECTED mode is not possible (e.g. before the simulation begin), then the
* UE will attempt to connect at the earliest possible time (e.g. after it
* camps to a suitable cell).
*
* Note that this function can only be used in EPC-enabled simulation.
*/
void Attach (NetDeviceContainer ueDevices);
@@ -199,8 +207,16 @@ public:
* \param ueDevice the UE device to be attached
*
* By calling this, the UE will start the initial cell selection procedure at
* the beginning of simulation. Note that this function can only be used in
* EPC-enabled simulation.
* the beginning of simulation. In addition, the function also instructs the
* UE to immediately enter CONNECTED mode and activates the default EPS
* bearer.
*
* If this function is called when the UE is in a situation where entering
* CONNECTED mode is not possible (e.g. before the simulation begin), then the
* UE will attempt to connect at the earliest possible time (e.g. after it
* camps to a suitable cell).
*
* Note that this function can only be used in EPC-enabled simulation.
*/
void Attach (Ptr<NetDevice> ueDevice);
@@ -234,22 +250,34 @@ public:
void Attach (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
/**
* Attach each UE in a set to the closest (w.r.t. distance) eNB among those in a set.
* \brief Manual attachment of a set of UE devices to the network via the
* closest eNodeB (with respect to distance) among those in the set.
* \param ueDevices the set of UE devices to be attached
* \param enbDevices the set of eNodeB devices to be considered
*
* This function finds among the eNodeB set the closest eNodeB for each UE,
* and then invokes manual attachment between the pair.
*
* Users are encouraged to use automatic attachment (Idle mode cell selection)
* instead of this function.
*
* \param ueDevices the set of UEs
* \param enbDevices the set of eNBs
* \sa LteHelper::Attach(NetDeviceContainer ueDevices);
*/
void AttachToClosestEnb (NetDeviceContainer ueDevices, NetDeviceContainer enbDevices);
/**
* Attach an UE ito the closest (w.r.t. distance) eNB among those in a set
* Will call LteHelper::Attach () passing to it the single eNB
* instance which resulted to be the closest to the UE
* \brief Manual attachment of a UE device to the network via the closest
* eNodeB (with respect to distance) among those in the set.
* \param ueDevices the set UE device to be attached
* \param enbDevices the set of eNodeB devices to be considered
*
* This function finds among the eNodeB set the closest eNodeB for the UE,
* and then invokes manual attachment between the pair.
*
* \param ueDevice the UE
* \param enbDevices the set of eNBs
* Users are encouraged to use automatic attachment (Idle mode cell selection)
* instead of this function.
*
* \sa LteHelper::Attach(Ptr<NetDevice> ueDevice);
*/
void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);

View File

@@ -298,8 +298,8 @@ LteCellSelectionTestCase::DoRun ()
ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
}
// Enable Idle mode cell selection
lteHelper->Attach (ueDevs);
lteHelper->Connect (ueDevs);
} // end of if (m_isEpcMode)
else