diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index f72a743c6..0f3a29584 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -357,21 +357,36 @@ UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gt } void -UeManager::StartDataRadioBearers () +UeManager::RecordDataRadioBearersToBeStarted () { NS_LOG_FUNCTION (this << (uint32_t) m_rnti); for (std::map >::iterator it = m_drbMap.begin (); it != m_drbMap.end (); ++it) { - it->second->m_rlc->Start (); - if (it->second->m_pdcp) - { - it->second->m_pdcp->Start (); - } + m_drbsToBeStarted.push_back (it->first); } } +void +UeManager::StartDataRadioBearers () +{ + NS_LOG_FUNCTION (this << (uint32_t) m_rnti); + for (std::list ::iterator drbIdIt = m_drbsToBeStarted.begin (); + drbIdIt != m_drbsToBeStarted.end (); + ++drbIdIt) + { + std::map >::iterator drbIt = m_drbMap.find (*drbIdIt); + NS_ASSERT (drbIt != m_drbMap.end ()); + drbIt->second->m_rlc->Start (); + if (drbIt->second->m_pdcp) + { + drbIt->second->m_pdcp->Start (); + } + } + m_drbsToBeStarted.clear (); +} + void UeManager::ReleaseDataRadioBearer (uint8_t drbid) @@ -417,6 +432,7 @@ UeManager::ScheduleRrcConnectionReconfiguration () m_pendingRrcConnectionReconfiguration = false; LteRrcSap::RrcConnectionReconfiguration msg = BuildRrcConnectionReconfiguration (); m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg); + RecordDataRadioBearersToBeStarted (); SwitchToState (CONNECTION_RECONFIGURATION); } break; @@ -648,6 +664,7 @@ UeManager::RecvRrcConnectionRequest (LteRrcSap::RrcConnectionRequest msg) msg2.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier (); msg2.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated (); m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2); + RecordDataRadioBearersToBeStarted (); SwitchToState (CONNECTION_SETUP); } break; diff --git a/src/lte/model/lte-enb-rrc.h b/src/lte/model/lte-enb-rrc.h index b6a250f66..42f933d42 100644 --- a/src/lte/model/lte-enb-rrc.h +++ b/src/lte/model/lte-enb-rrc.h @@ -127,12 +127,19 @@ public: * */ void SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress); - + /** * Start all configured data radio bearers. It is safe to call this * method if any bearer had been already started previously. * */ + void RecordDataRadioBearersToBeStarted (); + + /** + * Start the data radio bearers that have been previously recorded + * to be started using RecordDataRadioBearersToBeStarted() + * + */ void StartDataRadioBearers (); /** @@ -380,6 +387,7 @@ private: uint16_t m_sourceX2apId; uint16_t m_sourceCellId; uint16_t m_targetCellId; + std::list m_drbsToBeStarted; };