diff --git a/src/lte/model/lte-common.h b/src/lte/model/lte-common.h index a74b482f6..497ccedd9 100644 --- a/src/lte/model/lte-common.h +++ b/src/lte/model/lte-common.h @@ -127,6 +127,7 @@ struct PhyTransmissionStatParameters uint16_t m_size; ///< Size of transport block uint8_t m_rv; ///< the redundancy version (HARQ) uint8_t m_ndi; ///< new data indicator flag + uint8_t m_ccId; ///< component carrier id /** * TracedCallback signature. @@ -152,6 +153,7 @@ struct PhyReceptionStatParameters uint8_t m_rv; ///< the redundancy version (HARQ) uint8_t m_ndi; ///< new data indicator flag uint8_t m_correctness; ///< correctness of the TB received + uint8_t m_ccId; ///< component carrier id /** * TracedCallback signature. diff --git a/src/lte/model/lte-enb-mac.cc b/src/lte/model/lte-enb-mac.cc index a50ec1165..0218d7bab 100644 --- a/src/lte/model/lte-enb-mac.cc +++ b/src/lte/model/lte-enb-mac.cc @@ -339,6 +339,11 @@ LteEnbMac::GetTypeId (void) "Information regarding UL scheduling.", MakeTraceSourceAccessor (&LteEnbMac::m_ulScheduling), "ns3::LteEnbMac::UlSchedulingTracedCallback") + .AddAttribute ("ComponentCarrierId", + "ComponentCarrier Id, needed to reply on the appropriate sap.", + UintegerValue (0), + MakeUintegerAccessor (&LteEnbMac::m_componentCarrierId), + MakeUintegerChecker (0,4)) ; return tid; @@ -378,6 +383,11 @@ LteEnbMac::DoDispose () delete m_enbPhySapUser; } +void +LteEnbMac::SetComponentCarrierId (uint16_t index) +{ + m_componentCarrierId = index; +} void LteEnbMac::SetFfMacSchedSapProvider (FfMacSchedSapProvider* s) diff --git a/src/lte/model/lte-enb-mac.h b/src/lte/model/lte-enb-mac.h index 09e154d34..32861f8e3 100644 --- a/src/lte/model/lte-enb-mac.h +++ b/src/lte/model/lte-enb-mac.h @@ -62,7 +62,7 @@ public: virtual ~LteEnbMac (void); virtual void DoDispose (void); - + void SetComponentCarrierId (uint16_t index); /** * \brief Set the scheduler SAP provider * \param s a pointer SAP provider of the FF packet scheduler @@ -290,6 +290,10 @@ private: std::map m_receivedRachPreambleCount; std::map m_rapIdRntiMap; + + // component carrier Id used to address sap + uint8_t m_componentCarrierId; + }; } // end namespace ns3 diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index 6df91436c..f30358a70 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -704,6 +704,7 @@ LteEnbPhy::StartSubFrame (void) params.m_size = dci->GetDci ().m_tbsSize.at (i); params.m_rv = dci->GetDci ().m_rv.at (i); params.m_ndi = dci->GetDci ().m_ndi.at (i); + params.m_ccId = m_componentCarrierId; m_dlPhyTransmission (params); } diff --git a/src/lte/model/lte-mac-sap.h b/src/lte/model/lte-mac-sap.h index e06791f98..f8476dbea 100644 --- a/src/lte/model/lte-mac-sap.h +++ b/src/lte/model/lte-mac-sap.h @@ -49,6 +49,7 @@ public: uint8_t lcid; /**< the logical channel id corresponding to the sending RLC instance */ uint8_t layer; /**< the layer value that was passed by the MAC in the call to NotifyTxOpportunity that generated this PDU */ uint8_t harqProcessId; /**< the HARQ process id that was passed by the MAC in the call to NotifyTxOpportunity that generated this PDU */ + uint8_t componentCarrierId; /**< the component carrier id corresponding to the sending Mac istance */ }; /** diff --git a/src/lte/model/lte-phy.cc b/src/lte/model/lte-phy.cc index a7a54e899..e2ddfc73b 100644 --- a/src/lte/model/lte-phy.cc +++ b/src/lte/model/lte-phy.cc @@ -49,7 +49,8 @@ LtePhy::LtePhy (Ptr dlPhy, Ptr ulPhy) m_dlBandwidth (0), m_rbgSize (0), m_macChTtiDelay (0), - m_cellId (0) + m_cellId (0), + m_componentCarrierId(0) { NS_LOG_FUNCTION (this); } @@ -249,5 +250,18 @@ LtePhy::DoSetCellId (uint16_t cellId) m_uplinkSpectrumPhy->SetCellId (cellId); } +void +LtePhy::SetComponentCarrierId (uint16_t index) +{ + m_componentCarrierId = index; + m_downlinkSpectrumPhy->SetComponentCarrierId (index); + m_uplinkSpectrumPhy->SetComponentCarrierId (index); +} + +uint8_t +LtePhy::GetComponentCarrierId () +{ + return m_componentCarrierId; +} } // namespace ns3 diff --git a/src/lte/model/lte-phy.h b/src/lte/model/lte-phy.h index f9b8d9739..a0cfdc1e8 100644 --- a/src/lte/model/lte-phy.h +++ b/src/lte/model/lte-phy.h @@ -209,7 +209,9 @@ public: */ virtual void ReportRsReceivedPower (const SpectrumValue& power) = 0; + void SetComponentCarrierId (uint16_t index); + uint8_t GetComponentCarrierId (); protected: /// Pointer to the NetDevice where this PHY layer is attached. @@ -291,6 +293,9 @@ protected: */ uint16_t m_cellId; + /// component carrier Id used to address sap + uint8_t m_componentCarrierId; + }; // end of `class LtePhy` diff --git a/src/lte/model/lte-spectrum-phy.cc b/src/lte/model/lte-spectrum-phy.cc index 9500f63dd..bf66d3adc 100644 --- a/src/lte/model/lte-spectrum-phy.cc +++ b/src/lte/model/lte-spectrum-phy.cc @@ -984,6 +984,7 @@ LteSpectrumPhy::EndRxData () params.m_rv = (*itTb).second.rv; params.m_ndi = (*itTb).second.ndi; params.m_correctness = (uint8_t)!(*itTb).second.corrupt; + params.m_ccId = m_componentCarrierId; if ((*itTb).second.downlink) { // DL @@ -1189,6 +1190,11 @@ LteSpectrumPhy::SetCellId (uint16_t cellId) m_cellId = cellId; } +void +LteSpectrumPhy::SetComponentCarrierId (uint8_t componentCarrierId) +{ + m_componentCarrierId = componentCarrierId; +} void LteSpectrumPhy::AddRsPowerChunkProcessor (Ptr p) diff --git a/src/lte/model/lte-spectrum-phy.h b/src/lte/model/lte-spectrum-phy.h index f8d14974d..892b2577d 100644 --- a/src/lte/model/lte-spectrum-phy.h +++ b/src/lte/model/lte-spectrum-phy.h @@ -323,6 +323,11 @@ public: */ void SetCellId (uint16_t cellId); + /** + * + * \param componentCarrierId the component carrier id + */ + void SetComponentCarrierId (uint8_t componentCarrierId); /** * @@ -468,6 +473,7 @@ private: uint16_t m_cellId; + uint8_t m_componentCarrierId; expectedTbs_t m_expectedTbs; SpectrumValue m_sinrPerceived; diff --git a/src/lte/model/lte-ue-cphy-sap.h b/src/lte/model/lte-ue-cphy-sap.h index 8f876d4c8..4d93a8f9b 100644 --- a/src/lte/model/lte-ue-cphy-sap.h +++ b/src/lte/model/lte-ue-cphy-sap.h @@ -177,6 +177,7 @@ public: struct UeMeasurementsParameters { std::vector m_ueMeasurementsList; + uint16_t m_componentCarrierId; }; diff --git a/src/lte/model/lte-ue-mac.cc b/src/lte/model/lte-ue-mac.cc index 78c57a2d7..982168fb1 100644 --- a/src/lte/model/lte-ue-mac.cc +++ b/src/lte/model/lte-ue-mac.cc @@ -224,6 +224,7 @@ LteUeMac::LteUeMac () m_cmacSapProvider = new UeMemberLteUeCmacSapProvider (this); m_uePhySapUser = new UeMemberLteUePhySapUser (this); m_raPreambleUniformVariable = CreateObject (); + m_componentCarrierId = 0; } @@ -275,6 +276,11 @@ LteUeMac::GetLteUeCmacSapProvider (void) return m_cmacSapProvider; } +void +LteUeMac::SetComponentCarrierId (uint16_t index) +{ + m_componentCarrierId = index; +} void LteUeMac::DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params) diff --git a/src/lte/model/lte-ue-mac.h b/src/lte/model/lte-ue-mac.h index 2541d6e8c..107aad9fe 100644 --- a/src/lte/model/lte-ue-mac.h +++ b/src/lte/model/lte-ue-mac.h @@ -56,6 +56,8 @@ public: LteMacSapProvider* GetLteMacSapProvider (void); void SetLteUeCmacSapUser (LteUeCmacSapUser* s); LteUeCmacSapProvider* GetLteUeCmacSapProvider (void); + + void SetComponentCarrierId (uint16_t index); /** * \brief Get the PHY SAP user @@ -113,6 +115,9 @@ private: void SendReportBufferStatus (void); void RefreshHarqProcessesPacketBuffer (void); + /// component carrier Id --> used to address sap + uint8_t m_componentCarrierId; + private: struct LcInfo