lte: Handle handover joining timeout

Upon HO joining timeout, the target eNB sends the HO preparation failure message to the source eNB and deletes the UE context. On the other hand, the source eNB after receiving this msg releases the resources towards a UE by sending the RRC connection release msg in an ideal way irrespective of the RRC protocol used; and also requests the core network to delete that UE.
This commit is contained in:
ZorazeAli
2019-03-26 08:22:32 +01:00
committed by Tom Henderson
parent bc47595f5b
commit 4de9269e2e
4 changed files with 74 additions and 0 deletions

View File

@@ -996,6 +996,12 @@ UeManager::RecvHandoverPreparationFailure (uint16_t cellId)
NS_LOG_INFO ("target eNB sent HO preparation failure, aborting HO");
SwitchToState (CONNECTED_NORMALLY);
break;
case HANDOVER_LEAVING: //case added to tackle HO joining timer expiration
NS_ASSERT (cellId == m_targetCellId);
NS_LOG_INFO ("target eNB sent HO preparation failure, aborting HO");
m_handoverLeavingTimeout.Cancel ();
SendRrcConnectionRelease ();
break;
default:
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
@@ -1030,6 +1036,24 @@ UeManager::RecvUeContextRelease (EpcX2SapUser::UeContextReleaseParams params)
m_handoverLeavingTimeout.Cancel ();
}
void
UeManager::SendRrcConnectionRelease ()
{
// TODO implement in the 3gpp way, see Section 5.3.8 of 3GPP TS 36.331.
NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
// De-activation towards UE, it will deactivate all bearers
LteRrcSap::RrcConnectionRelease msg;
msg.rrcTransactionIdentifier = this->GetNewRrcTransactionIdentifier ();
m_rrc->m_rrcSapUser->SendRrcConnectionRelease (m_rnti, msg);
/**
* Bearer de-activation indication towards epc-enb application
* and removal of UE context at the eNodeB
*
*/
m_rrc->DoRecvIdealUeContextRemoveRequest (m_rnti);
}
// methods forwarded from RRC SAP
@@ -2505,6 +2529,17 @@ LteEnbRrc::HandoverJoiningTimeout (uint16_t rnti)
"HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "HandoverJoiningTimeout");
/**
* When the handover joining timer expires at the target cell,
* then notify the source cell to release the RRC connection and
* delete the UE context at eNodeB and SGW/PGW. The
* HandoverPreparationFailure message is reused to notify the source cell
* through the X2 interface instead of creating a new message.
*/
Ptr<UeManager> ueManger = GetUeManager (rnti);
EpcX2Sap::HandoverPreparationFailureParams msg = ueManger->BuildHoPrepFailMsg ();
m_x2SapProvider->SendHandoverPreparationFailure (msg);
RemoveUe (rnti);
}

View File

@@ -380,6 +380,13 @@ public:
*/
void CancelPendingEvents ();
/**
* \brief This function acts as an interface to trigger the connection
* release towards eNB, EPC and UE.
*
*/
void SendRrcConnectionRelease ();
/**
* \brief build handover preparation failure message
*/
@@ -1048,6 +1055,14 @@ public:
*/
void DoSendReleaseDataRadioBearer (uint64_t imsi, uint16_t rnti, uint8_t bearerId);
/**
* \brief Send RRC connection release function
*
* This function acts as an interface to trigger the connection
* release towards eNB, EPC and UE.
*/
void SendRrcConnectionRelease ();
/**
* Identifies how EPS Bearer parameters are mapped to different RLC types
*

View File

@@ -657,6 +657,8 @@ LteEnbRrcProtocolReal::DoSendRrcConnectionReestablishmentReject (uint16_t rnti,
void
LteEnbRrcProtocolReal::DoSendRrcConnectionRelease (uint16_t rnti, LteRrcSap::RrcConnectionRelease msg)
{
//The code below is commented so RRC connection release can be sent in an ideal way
/*
Ptr<Packet> packet = Create<Packet> ();
RrcConnectionReleaseHeader rrcConnectionReleaseHeader;
@@ -670,6 +672,18 @@ LteEnbRrcProtocolReal::DoSendRrcConnectionRelease (uint16_t rnti, LteRrcSap::Rrc
transmitPdcpSduParameters.lcid = 1;
m_setupUeParametersMap[rnti].srb1SapProvider->TransmitPdcpSdu (transmitPdcpSduParameters);
*/
/**
* Send RRC connection release in an idle way to ensure UE goes
* to idle mode during handover failure and connection setup timeout.
* Implemented to avoid unnecessary triggering of assert msgs due to reception of
* msgs (SRS CQI reports) from UE after UE context is deleted at eNodeB.
* TODO: Detection of handover failure and connection setup timeout at UE,
* so that the RRC connection release can be sent through the physical channel again.
*/
NS_LOG_FUNCTION(this<<rnti);
Simulator::Schedule (RRC_REAL_MSG_DELAY, &LteUeRrcSapProvider::RecvRrcConnectionRelease,
GetUeRrcSapProvider (rnti), msg);
}
void

View File

@@ -1196,6 +1196,16 @@ LteUeRrc::DoRecvRrcConnectionRelease (LteRrcSap::RrcConnectionRelease msg)
{
NS_LOG_FUNCTION (this << " RNTI " << m_rnti);
/// \todo Currently not implemented, see Section 5.3.8 of 3GPP TS 36.331.
m_lastRrcTransactionIdentifier = msg.rrcTransactionIdentifier;
//release resources at UE
if (!m_rlfDetected)
{
m_rlfDetected = true;
SwitchToState (CONNECTED_PHY_PROBLEM);
m_rrcSapUser->SendIdealUeContextRemoveRequest (m_rnti);
m_asSapUser->NotifyConnectionReleased ();
}
}
void