23 #include "ns3/simulator.h"
25 #include "ns3/lte-rlc.h"
26 #include "ns3/lte-rlc-tag.h"
28 #include "ns3/lte-rlc-sap.h"
54 LteRlcSpecificLteMacSapUser::LteRlcSpecificLteMacSapUser (
LteRlc* rlc)
59 LteRlcSpecificLteMacSapUser::LteRlcSpecificLteMacSapUser ()
66 m_rlc->DoNotifyTxOpportunity (bytes, layer, harqId);
72 m_rlc->DoNotifyHarqDeliveryFailure ();
78 m_rlc->DoReceivePdu (p);
84 NS_OBJECT_ENSURE_REGISTERED (
LteRlc);
102 TypeId LteRlc::GetTypeId (
void)
104 static TypeId tid = TypeId (
"ns3::LteRlc")
105 .SetParent<Object> ()
106 .AddTraceSource (
"TxPDU",
107 "PDU transmission notified to the MAC.",
109 .AddTraceSource (
"RxPDU",
120 delete (m_rlcSapProvider);
121 delete (m_macSapUser);
149 return m_rlcSapProvider;
156 m_macSapProvider = s;
170 NS_OBJECT_ENSURE_REGISTERED (
LteRlcSm);
172 LteRlcSm::LteRlcSm ()
177 LteRlcSm::~LteRlcSm ()
183 LteRlcSm::GetTypeId (
void)
185 static TypeId tid = TypeId (
"ns3::LteRlcSm")
186 .SetParent<LteRlc> ()
187 .AddConstructor<LteRlcSm> ()
196 ReportBufferStatus ();
213 LteRlcSm::DoReceivePdu (Ptr<Packet> p)
219 if (p->FindFirstMatchingByteTag(rlcTag))
224 <<
" LCID=" << (uint32_t) m_lcid
225 <<
" size=" << p->GetSize ()
226 <<
" delay=" << delay.GetNanoSeconds ());
227 m_rxPdu(m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds () );
231 LteRlcSm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId)
234 LteMacSapProvider::TransmitPduParameters params;
235 params.pdu = Create<Packet> (bytes);
236 params.rnti = m_rnti;
237 params.lcid = m_lcid;
238 params.layer = layer;
239 params.harqProcessId = harqId;
243 params.pdu->AddByteTag (tag);
245 <<
" LCID=" << (uint32_t) m_lcid
246 <<
" size=" << bytes);
247 m_txPdu(m_rnti, m_lcid, bytes);
250 ReportBufferStatus ();
254 LteRlcSm::DoNotifyHarqDeliveryFailure ()
260 LteRlcSm::ReportBufferStatus ()
263 LteMacSapProvider::ReportBufferStatusParameters p;
266 p.txQueueSize = 80000;
267 p.txQueueHolDelay = 10;
269 p.retxQueueHolDelay = 0;
TracedCallback< uint16_t, uint8_t, uint32_t > m_txPdu
#define NS_LOG_FUNCTION(parameters)
#define NS_LOG_COMPONENT_DEFINE(name)
virtual void ReceivePdu(Ptr< Packet > p)
void SetRnti(uint16_t rnti)
virtual void NotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId)
LteMacSapUser * GetLteMacSapUser()
#define NS_LOG_LOGIC(msg)
void SetLteRlcSapUser(LteRlcSapUser *s)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
void SetLcId(uint8_t lcId)
virtual void NotifyHarqDeliveryFailure()
virtual void ReportBufferStatus(ReportBufferStatusParameters params)=0
LteRlcSapProvider * GetLteRlcSapProvider()
TracedCallback< uint16_t, uint8_t, uint32_t, uint64_t > m_rxPdu
virtual void DoInitialize()
virtual void TransmitPdu(TransmitPduParameters params)=0
void SetLteMacSapProvider(LteMacSapProvider *s)