From 58c493e92bb2608d0ea95aa7af28f50558d86bed Mon Sep 17 00:00:00 2001 From: ZorazeAli Date: Tue, 26 Mar 2019 08:38:47 +0100 Subject: [PATCH] lte: Handle handover leaving timeout Upon HO leaving timeout, the source eNB sends the HO cancel message to the target eNB, and 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. --- src/lte/model/lte-enb-rrc.cc | 10 +++++++++- src/lte/model/lte-ue-rrc.cc | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index c2638f0c8..b353793d9 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -2551,7 +2551,15 @@ LteEnbRrc::HandoverLeavingTimeout (uint16_t rnti) "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ())); m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti, ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "HandoverLeavingTimeout"); - RemoveUe (rnti); + /** + * Send HO cancel msg to the target eNB and release the RRC connection + * with the UE and also delete UE context at the source eNB and bearer + * info at SGW and PGW. + */ + Ptr ueManger = GetUeManager (rnti); + EpcX2Sap::HandoverCancelParams msg = ueManger->BuildHoCancelMsg (); + m_x2SapProvider->SendHandoverCancel (msg); + ueManger->SendRrcConnectionRelease (); } void diff --git a/src/lte/model/lte-ue-rrc.cc b/src/lte/model/lte-ue-rrc.cc index 12b8c47fd..53561f5fd 100644 --- a/src/lte/model/lte-ue-rrc.cc +++ b/src/lte/model/lte-ue-rrc.cc @@ -1199,9 +1199,9 @@ LteUeRrc::DoRecvRrcConnectionRelease (LteRrcSap::RrcConnectionRelease msg) m_lastRrcTransactionIdentifier = msg.rrcTransactionIdentifier; //release resources at UE - if (!m_rlfDetected) + if (!m_leaveConnectedMode) { - m_rlfDetected = true; + m_leaveConnectedMode = true; SwitchToState (CONNECTED_PHY_PROBLEM); m_rrcSapUser->SendIdealUeContextRemoveRequest (m_rnti); m_asSapUser->NotifyConnectionReleased ();