From 3ab6a5680bc4ec2d541e0e1d998d2ed640d2e746 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Thu, 8 Jun 2017 18:30:34 +0300 Subject: [PATCH] lte: Set CC id of UeManager to the serial number of EnbRrcMemberLteEnbCmacSapUser --- src/lte/model/lte-enb-rrc.cc | 28 +++++++++++++++------------- src/lte/model/lte-enb-rrc.h | 9 ++++++--- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index 08e29fec4..e4ced6ef8 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -65,7 +65,7 @@ public: * * \param rrc ENB RRC */ - EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc); + EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc, uint8_t componentCarrierId); virtual uint16_t AllocateTemporaryCellRnti (); virtual void NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success); @@ -73,17 +73,19 @@ public: private: LteEnbRrc* m_rrc; ///< the RRC + uint8_t m_componentCarrierId; ///< Component carrier ID }; -EnbRrcMemberLteEnbCmacSapUser::EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc) +EnbRrcMemberLteEnbCmacSapUser::EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc, uint8_t componentCarrierId) : m_rrc (rrc) + , m_componentCarrierId {componentCarrierId} { } uint16_t EnbRrcMemberLteEnbCmacSapUser::AllocateTemporaryCellRnti () { - return m_rrc->DoAllocateTemporaryCellRnti (); + return m_rrc->DoAllocateTemporaryCellRnti (m_componentCarrierId); } void @@ -139,11 +141,11 @@ UeManager::UeManager () } -UeManager::UeManager (Ptr rrc, uint16_t rnti, State s) +UeManager::UeManager (Ptr rrc, uint16_t rnti, State s, uint8_t componentCarrierId) : m_lastAllocatedDrbid (0), m_rnti (rnti), m_imsi (0), - m_componentCarrierId (0), + m_componentCarrierId (componentCarrierId), m_lastRrcTransactionIdentifier (0), m_rrc (rrc), m_state (s), @@ -1486,7 +1488,7 @@ LteEnbRrc::LteEnbRrc () m_carriersConfigured (false) { NS_LOG_FUNCTION (this); - m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this)); + m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this, 0)); m_handoverManagementSapUser = new MemberLteHandoverManagementSapUser (this); m_anrSapUser = new MemberLteAnrSapUser (this); m_ffrRrcSapUser.push_back (new MemberLteFfrRrcSapUser (this)); @@ -1512,7 +1514,7 @@ LteEnbRrc::ConfigureCarriers (std::map> ccPhyC for (uint8_t i = 1; i < m_numberOfComponentCarriers; i++) { m_cphySapUser.push_back (new MemberLteEnbCphySapUser (this)); - m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this)); + m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this, i)); m_ffrRrcSapUser.push_back (new MemberLteFfrRrcSapUser (this)); m_cphySapProvider.push_back (0); m_cmacSapProvider.push_back (0); @@ -2280,7 +2282,7 @@ LteEnbRrc::DoRecvHandoverRequest (EpcX2SapUser::HandoverRequestParams req) return; } - uint16_t rnti = AddUe (UeManager::HANDOVER_JOINING); + uint16_t rnti = AddUe (UeManager::HANDOVER_JOINING, CellToComponentCarrierId (req.targetCellId)); LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue anrcrv = m_cmacSapProvider.at (0)->AllocateNcRaPreamble (rnti); if (anrcrv.valid == false) { @@ -2460,10 +2462,10 @@ LteEnbRrc::DoRecvUeData (EpcX2SapUser::UeDataParams params) uint16_t -LteEnbRrc::DoAllocateTemporaryCellRnti () +LteEnbRrc::DoAllocateTemporaryCellRnti (uint8_t componentCarrierId) { - NS_LOG_FUNCTION (this); - return AddUe (UeManager::INITIAL_RANDOM_ACCESS); + NS_LOG_FUNCTION (this << +componentCarrierId); + return AddUe (UeManager::INITIAL_RANDOM_ACCESS, componentCarrierId); } void @@ -2576,7 +2578,7 @@ LteEnbRrc::DoSendLoadInformation (EpcX2Sap::LoadInformationParams params) } uint16_t -LteEnbRrc::AddUe (UeManager::State state) +LteEnbRrc::AddUe (UeManager::State state, uint8_t componentCarrierId) { NS_LOG_FUNCTION (this); bool found = false; @@ -2594,7 +2596,7 @@ LteEnbRrc::AddUe (UeManager::State state) NS_ASSERT_MSG (found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)"); m_lastAllocatedRnti = rnti; - Ptr ueManager = CreateObject (this, rnti, state); + Ptr ueManager = CreateObject (this, rnti, state, componentCarrierId); m_ccmRrcSapProvider-> AddUe (rnti, (uint8_t)state); m_ueMap.insert (std::pair > (rnti, ueManager)); ueManager->Initialize (); diff --git a/src/lte/model/lte-enb-rrc.h b/src/lte/model/lte-enb-rrc.h index 0aaaa2881..c4460af43 100644 --- a/src/lte/model/lte-enb-rrc.h +++ b/src/lte/model/lte-enb-rrc.h @@ -104,10 +104,11 @@ public: * \param rrc pointer to the LteEnbRrc holding this UeManager * \param rnti RNTI of the UE * \param s initial state of the UeManager + * \param componentCarrierId primary component carrier ID * * \return */ - UeManager (Ptr rrc, uint16_t rnti, State s); + UeManager (Ptr rrc, uint16_t rnti, State s, uint8_t componentCarrierId); virtual ~UeManager (void); @@ -1140,9 +1141,10 @@ private: /** * Allocate temporary cell RNTI function * + * \param componentCarrierId ID of the primary component carrier * \return temporary RNTI */ - uint16_t DoAllocateTemporaryCellRnti (); + uint16_t DoAllocateTemporaryCellRnti (uint8_t componentCarrierId); /** * Notify LC config result function * @@ -1223,10 +1225,11 @@ private: * * target cell RNTI allocation upon handover * * \param state the initial state of the UeManager + * \param componentCarrierId primary component carrier ID of the UeManager * * \return the newly allocated RNTI */ - uint16_t AddUe (UeManager::State state); + uint16_t AddUe (UeManager::State state, uint8_t componentCarrierId); /** * remove a UE from the cell