diff --git a/src/lte/model/lte-rlc.cc b/src/lte/model/lte-rlc.cc index 23ec63c21..e828249bf 100644 --- a/src/lte/model/lte-rlc.cc +++ b/src/lte/model/lte-rlc.cc @@ -32,81 +32,6 @@ namespace ns3 { NS_LOG_COMPONENT_DEFINE ("LteRlc"); -/** - * Tag to calculate the per-PDU delay from eNb RLC to UE RLC - */ - -class RlcSmHeader : public Header -{ -public: - /** - * \brief Get the type ID. - * \return the object TypeId - */ - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - - /** - * Create an empty RLC tag - */ - RlcSmHeader (); - - virtual void Serialize (Buffer::Iterator i) const; - virtual uint32_t Deserialize (Buffer::Iterator i); - virtual uint32_t GetSerializedSize () const; - virtual void Print (std::ostream &os) const; -}; - -RlcSmHeader::RlcSmHeader () : Header () -{ - // Nothing to do here -} - - -TypeId -RlcSmHeader::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::RlcSmTag") - .SetParent
() - .SetGroupName("Lte") - .AddConstructor (); - return tid; -} - -TypeId -RlcSmHeader::GetInstanceTypeId (void) const -{ - return GetTypeId (); -} - -uint32_t -RlcSmHeader::GetSerializedSize (void) const -{ - return 1; -} - -void -RlcSmHeader::Serialize (Buffer::Iterator i) const -{ - // Arbitrary value. It is not used anywhere. - i.WriteU8 (8U); -} - -uint32_t -RlcSmHeader::Deserialize (Buffer::Iterator i) -{ - uint8_t v = i.ReadU8 (); - NS_UNUSED (v); - return 1; -} - -void -RlcSmHeader::Print (std::ostream &os) const -{ - os << "RlcSmTag"; -} - - /// LteRlcSpecificLteMacSapUser class class LteRlcSpecificLteMacSapUser : public LteMacSapUser { @@ -312,12 +237,15 @@ LteRlcSm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpPara { NS_LOG_FUNCTION (this << txOpParams.bytes); LteMacSapProvider::TransmitPduParameters params; - RlcSmHeader header; RlcTag tag (Simulator::Now ()); - params.pdu = Create (txOpParams.bytes - header.GetSerializedSize ()); - params.pdu->AddHeader (header); - params.pdu->AddByteTag (tag, 1, header.GetSerializedSize ()); + params.pdu = Create (txOpParams.bytes); + NS_ABORT_MSG_UNLESS (txOpParams.bytes > 0, "Bytes must be > 0"); + /** + * For RLC SM, the packets are not passed to the upper layers, therefore, + * in the absence of an header we can safely byte tag the entire packet. + */ + params.pdu->AddByteTag (tag, 1, params.pdu->GetSize ()); params.rnti = m_rnti; params.lcid = m_lcid; @@ -326,8 +254,8 @@ LteRlcSm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpPara params.componentCarrierId = txOpParams.componentCarrierId; // RLC Performance evaluation - NS_LOG_LOGIC (" RNTI=" << m_rnti - << " LCID=" << (uint32_t) m_lcid + NS_LOG_LOGIC (" RNTI=" << m_rnti + << " LCID=" << (uint32_t) m_lcid << " size=" << txOpParams.bytes); m_txPdu(m_rnti, m_lcid, txOpParams.bytes);