lte: Init RNTI in UE RRC protocol before sending the UE context remove request

This commit is contained in:
ZorazeAli
2019-04-12 13:59:57 +02:00
parent 5a540e93e4
commit b1ebdc7d81
2 changed files with 38 additions and 7 deletions

View File

@@ -173,16 +173,31 @@ LteUeRrcProtocolIdeal::DoSendMeasurementReport (LteRrcSap::MeasurementReport msg
void
LteUeRrcProtocolIdeal::DoSendIdealUeContextRemoveRequest (uint16_t rnti)
{
SetEnbRrcSapProvider (); //the provider has to be reset since the cell might have changed due to handover
//ideally informing eNB
Simulator::Schedule (RRC_IDEAL_MSG_DELAY, &LteEnbRrcSapProvider::RecvIdealUeContextRemoveRequest,
m_enbRrcSapProvider, rnti);
NS_LOG_FUNCTION (this);
uint16_t cellId = m_rrc->GetCellId ();
// re-initialize the RNTI and get the EnbLteRrcSapProvider for the
// eNB we are currently attached to or attempting random access to
// a target eNB
m_rnti = m_rrc->GetRnti ();
NS_LOG_DEBUG ("RNTI " << rnti
<< " sending UE context remove request to cell id " << cellId);
NS_ABORT_MSG_IF (m_rnti != rnti, "RNTI mismatch");
SetEnbRrcSapProvider (); //the provider has to be reset since the cell might have changed due to handover
//ideally informing eNB
Simulator::Schedule (RRC_IDEAL_MSG_DELAY, &LteEnbRrcSapProvider::RecvIdealUeContextRemoveRequest,
m_enbRrcSapProvider, m_rnti);
}
void
LteUeRrcProtocolIdeal::SetEnbRrcSapProvider ()
{
NS_LOG_FUNCTION (this);
uint16_t cellId = m_rrc->GetCellId ();
NS_LOG_DEBUG ("RNTI " << m_rnti << " connected to cell " << cellId);
// walk list of all nodes to get the peer eNB
Ptr<LteEnbNetDevice> enbDev;
@@ -284,7 +299,8 @@ LteEnbRrcProtocolIdeal::SetUeRrcSapProvider (uint16_t rnti, LteUeRrcSapProvider*
{
std::map<uint16_t, LteUeRrcSapProvider*>::iterator it;
it = m_enbRrcSapProviderMap.find (rnti);
NS_ASSERT_MSG (it != m_enbRrcSapProviderMap.end (), "could not find RNTI = " << rnti);
NS_ASSERT_MSG (it != m_enbRrcSapProviderMap.end (), "Cell id " << m_cellId
<< " could not find RNTI = " << rnti);
it->second = p;
}

View File

@@ -197,8 +197,18 @@ void
LteUeRrcProtocolReal::DoSendIdealUeContextRemoveRequest (uint16_t rnti)
{
NS_LOG_FUNCTION(this<<rnti);
uint16_t cellId = m_rrc->GetCellId ();
// re-initialize the RNTI and get the EnbLteRrcSapProvider for the
// eNB we are currently attached to or attempting random access to
// a target eNB
m_rnti = m_rrc->GetRnti ();
SetEnbRrcSapProvider (); //the provider has to be reset since the cell might have changed due to handover
NS_LOG_DEBUG ("RNTI " << rnti
<< " sending UE context remove request to cell id " << cellId);
NS_ABORT_MSG_IF (m_rnti != rnti, "RNTI mismatch");
SetEnbRrcSapProvider (); //the provider has to be reset since the cell might
// have changed due to handover
//ideally informing eNB
Simulator::Schedule (RRC_REAL_MSG_DELAY, &LteEnbRrcSapProvider::RecvIdealUeContextRemoveRequest,
m_enbRrcSapProvider, rnti);
@@ -244,8 +254,12 @@ LteUeRrcProtocolReal::DoSendRrcConnectionReestablishmentComplete (LteRrcSap::Rrc
void
LteUeRrcProtocolReal::SetEnbRrcSapProvider ()
{
NS_LOG_FUNCTION (this);
uint16_t cellId = m_rrc->GetCellId ();
NS_LOG_DEBUG ("RNTI " << m_rnti << " connected to cell " << cellId);
// walk list of all nodes to get the peer eNB
Ptr<LteEnbNetDevice> enbDev;
NodeList::Iterator listEnd = NodeList::End ();
@@ -434,7 +448,8 @@ LteEnbRrcProtocolReal::SetUeRrcSapProvider (uint16_t rnti, LteUeRrcSapProvider*
{
std::map<uint16_t, LteUeRrcSapProvider*>::iterator it;
it = m_enbRrcSapProviderMap.find (rnti);
NS_ASSERT_MSG (it != m_enbRrcSapProviderMap.end (), "could not find RNTI = " << rnti);
NS_ASSERT_MSG (it != m_enbRrcSapProviderMap.end (), "Cell id " << m_cellId
<< " could not find RNTI = " << rnti);
it->second = p;
}