lte: (fixes #2980) reset MAC and PHY of secondary carriers upon handover

This commit is contained in:
Zoraze Ali
2018-09-06 14:14:51 +02:00
parent 18a087866c
commit 52ba3734e3
6 changed files with 72 additions and 8 deletions

View File

@@ -651,6 +651,17 @@ UeManager::RecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams params
Ptr<Packet> encodedHandoverCommand = params.rrcContext;
LteRrcSap::RrcConnectionReconfiguration handoverCommand = m_rrc->m_rrcSapUser->DecodeHandoverCommand (encodedHandoverCommand);
if (handoverCommand.haveNonCriticalExtension)
{
//Total number of component carriers = handoverCommand.nonCriticalExtension.sCellsToAddModList.size() + 1 (Primary carrier)
if (handoverCommand.nonCriticalExtension.sCellsToAddModList.size() + 1 != m_rrc->m_numberOfComponentCarriers)
{
//Currently handover is only possible if source and target eNBs have equal number of component carriers
NS_FATAL_ERROR ("The source and target eNBs have unequal number of component carriers. Target eNB CCs = "
<< handoverCommand.nonCriticalExtension.sCellsToAddModList.size() + 1
<< " Source eNB CCs = " << m_rrc->m_numberOfComponentCarriers);
}
}
m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand);
SwitchToState (HANDOVER_LEAVING);
m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration,
@@ -2348,7 +2359,6 @@ LteEnbRrc::DoRecvHandoverRequest (EpcX2SapUser::HandoverRequestParams req)
handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize;
handoverCommand.haveNonCriticalExtension = false;
Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand (handoverCommand);

View File

@@ -80,6 +80,11 @@ public:
* where the bearer is enabled
*/
virtual std::vector<uint16_t> RemoveLc (uint8_t lcid) = 0;
/**
* \brief Reset LC maps
*
*/
virtual void Reset () = 0;
/// Notify reconfiguration msg function
virtual void NotifyConnectionReconfigurationMsg () = 0;
@@ -110,6 +115,7 @@ public:
// inherited from LteUeCcmRrcSapProvider
virtual std::vector<uint16_t> RemoveLc (uint8_t lcid);
virtual void Reset ();
virtual std::vector<LteUeCcmRrcSapProvider::LcsConfig> AddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu);
virtual void NotifyConnectionReconfigurationMsg ();
virtual LteMacSapUser* ConfigureSignalBearer (uint8_t lcid, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu);
@@ -130,6 +136,13 @@ std::vector<uint16_t> MemberLteUeCcmRrcSapProvider<C>::RemoveLc (uint8_t lcid)
return m_owner->DoRemoveLc (lcid);
}
template <class C>
void MemberLteUeCcmRrcSapProvider<C>::Reset ()
{
return m_owner->DoReset ();
}
template <class C>
std::vector<LteUeCcmRrcSapProvider::LcsConfig> MemberLteUeCcmRrcSapProvider<C>::AddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu)
{

View File

@@ -537,7 +537,7 @@ void
LteUeMac::DoAddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu)
{
NS_LOG_FUNCTION (this << " lcId" << (uint32_t) lcId);
NS_ASSERT_MSG (m_lcInfoMap.find (lcId) == m_lcInfoMap.end (), "cannot add channel because LCID " << lcId << " is already present");
NS_ASSERT_MSG (m_lcInfoMap.find (lcId) == m_lcInfoMap.end (), "cannot add channel because LCID " << (uint16_t)lcId << " is already present");
LcInfo lcInfo;
lcInfo.lcConfig = lcConfig;

View File

@@ -990,8 +990,13 @@ LteUeRrc::DoRecvRrcConnectionReconfiguration (LteRrcSap::RrcConnectionReconfigur
SwitchToState (CONNECTED_HANDOVER);
const LteRrcSap::MobilityControlInfo& mci = msg.mobilityControlInfo;
m_handoverStartTrace (m_imsi, m_cellId, m_rnti, mci.targetPhysCellId);
m_cmacSapProvider.at(0)->Reset ();
m_cphySapProvider.at(0)->Reset ();
//We should reset the MACs and PHYs for all the component carriers
for (uint16_t i = 0; i < m_numberOfComponentCarriers; i++)
{
m_cmacSapProvider.at(i)->Reset ();
m_cphySapProvider.at(i)->Reset ();
}
m_ccmRrcSapProvider->Reset();
m_cellId = mci.targetPhysCellId;
NS_ASSERT (mci.haveCarrierFreq);
NS_ASSERT (mci.haveCarrierBandwidth);
@@ -1016,6 +1021,11 @@ LteUeRrc::DoRecvRrcConnectionReconfiguration (LteRrcSap::RrcConnectionReconfigur
m_drbMap.clear (); // dispose all DRBs
ApplyRadioResourceConfigDedicated (msg.radioResourceConfigDedicated);
if (msg.haveNonCriticalExtension)
{
NS_LOG_DEBUG (this << "RNTI " << m_rnti << " Handover. Configuring secondary carriers");
ApplyRadioResourceConfigDedicatedSecondaryCarrier (msg.nonCriticalExtension);
}
if (msg.haveMeasConfig)
{
@@ -1030,7 +1040,7 @@ LteUeRrc::DoRecvRrcConnectionReconfiguration (LteRrcSap::RrcConnectionReconfigur
if (msg.haveNonCriticalExtension)
{
ApplyRadioResourceConfigDedicatedSecondaryCarrier (msg.nonCriticalExtension);
NS_LOG_FUNCTION ( this << "RNTI " << m_rnti << " Configured for CA" );
NS_LOG_DEBUG (this << "RNTI " << m_rnti << " Configured for CA" );
}
if (msg.haveRadioResourceConfigDedicated)
{
@@ -1111,8 +1121,10 @@ LteUeRrc::DoRecvRrcConnectionReject (LteRrcSap::RrcConnectionReject msg)
{
NS_LOG_FUNCTION (this);
m_connectionTimeout.Cancel ();
m_cmacSapProvider.at (0)->Reset (); // reset the MAC
for (uint16_t i = 0; i < m_numberOfComponentCarriers; i++)
{
m_cmacSapProvider.at(i)->Reset (); // reset the MAC
}
m_hasReceivedSib2 = false; // invalidate the previously received SIB2
SwitchToState (IDLE_CAMPED_NORMALLY);
m_asSapUser->NotifyConnectionFailed (); // inform upper layer
@@ -2962,7 +2974,10 @@ void
LteUeRrc::ConnectionTimeout ()
{
NS_LOG_FUNCTION (this << m_imsi);
m_cmacSapProvider.at (0)->Reset (); // reset the MAC
for (uint16_t i = 0; i < m_numberOfComponentCarriers; i++)
{
m_cmacSapProvider.at(i)->Reset (); // reset the MAC
}
m_hasReceivedSib2 = false; // invalidate the previously received SIB2
SwitchToState (IDLE_CAMPED_NORMALLY);
m_connectionTimeoutTrace (m_imsi, m_cellId, m_rnti);

View File

@@ -260,6 +260,27 @@ SimpleUeComponentCarrierManager::DoRemoveLc (uint8_t lcid)
}
void
SimpleUeComponentCarrierManager::DoReset ()
{
NS_LOG_FUNCTION (this);
// same semantics as LteUeMac::DoRest
std::map<uint8_t, LteMacSapUser*>::iterator it = m_lcAttached.begin ();
while (it != m_lcAttached.end ())
{
// don't delete CCCH
if (it->first == 0)
{
++it;
}
else
{
// note: use of postfix operator preserves validity of iterator
m_lcAttached.erase (it++);
}
}
}
std::vector<LteUeCcmRrcSapProvider::LcsConfig>
SimpleUeComponentCarrierManager::DoAddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu)
{

View File

@@ -131,6 +131,11 @@ protected:
* \returns LteMacSapUser *
*/
LteMacSapUser* DoConfigureSignalBearer (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu);
/**
* \brief Reset LC map
*
*/
void DoReset ();
private: