From 82e2613d4191bfa850e96051ed4538af68ff7e68 Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Thu, 13 Dec 2012 12:50:50 +0100 Subject: [PATCH 1/3] LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg --- src/lte/model/lte-enb-rrc.cc | 29 +++++++++++++++++++++++------ src/lte/model/lte-enb-rrc.h | 10 +++++++++- 2 files changed, 32 insertions(+), 7 deletions(-) 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; }; From c7a3efd93ee8a8b3c58837d2752abf17a59bbcbb Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Thu, 13 Dec 2012 13:19:57 +0100 Subject: [PATCH 2/3] enable traces correctly in lena-simple --- src/lte/examples/lena-simple.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lte/examples/lena-simple.cc b/src/lte/examples/lena-simple.cc index 4b635773f..336c62ffe 100644 --- a/src/lte/examples/lena-simple.cc +++ b/src/lte/examples/lena-simple.cc @@ -46,7 +46,6 @@ int main (int argc, char *argv[]) cmd.Parse (argc, argv); Ptr lteHelper = CreateObject (); - lteHelper->EnableTraces (); // Uncomment to enable logging //lteHelper->EnableLogComponents (); @@ -81,7 +80,9 @@ int main (int argc, char *argv[]) EpsBearer bearer (q); lteHelper->ActivateDataRadioBearer (ueDevs, bearer); - Simulator::Stop (Seconds (0.100)); + lteHelper->EnableTraces (); + + Simulator::Stop (Seconds (1.05)); Simulator::Run (); From cca38b6b1874abf8dc445eb61846a366e88cc522 Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Thu, 13 Dec 2012 14:31:36 +0100 Subject: [PATCH 3/3] increased SRS start time to 20ms to cope with RRC message delays --- src/lte/model/lte-enb-phy.cc | 2 +- src/lte/model/lte-ue-phy.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index 53c48cc7a..8d66883ee 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -894,7 +894,7 @@ LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi) // inhibit SRS until RRC Connection Reconfiguration propagates // to UEs, otherwise we might be wrong in determining the UE who // actually sent the SRS (if the UE was using a stale SRS config) - m_srsStartTime = Simulator::Now () + MilliSeconds (m_macChTtiDelay) + MilliSeconds (3); + m_srsStartTime = Simulator::Now () + MilliSeconds (m_macChTtiDelay) + MilliSeconds (20); } NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srcCi) << " CI " << srcCi); diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index 4778eca02..be8ad7d8d 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -899,7 +899,7 @@ LteUePhy::DoSetSrsConfigurationIndex (uint16_t srcCi) // to make sure no UE sends SRSs before all UEs received the new SRS configuration. // Note that the eNB will send the new SRS config to all UEs at the same time, // but with the real RRC model the time it takes to reach each UE might vary. - m_srsStartTime = Simulator::Now () + MilliSeconds (3); + m_srsStartTime = Simulator::Now () + MilliSeconds (20); NS_LOG_DEBUG (this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset " << m_srsSubframeOffset << " cellId " << m_cellId << " CI " << srcCi); }