LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 | 121 |
122 /** | 122 /** |
123 * MAC SAP | 123 * MAC SAP |
124 */ | 124 */ |
125 | 125 |
126 void | 126 void |
127 LteRlcUm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid) | 127 LteRlcUm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid) |
128 { | 128 { |
129 NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes); | 129 NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes); |
130 NS_UNUSED(rnti); | 130 NS_UNUSED (rnti); |
131 NS_UNUSED(lcid); | 131 NS_UNUSED (lcid); |
132 | 132 |
133 if (bytes <= 2) | 133 if (bytes <= 2) |
134 { | 134 { |
135 // Stingy MAC: Header fix part is 2 bytes, we need more bytes for the data | 135 // Stingy MAC: Header fix part is 2 bytes, we need more bytes for the data |
136 NS_LOG_LOGIC ("TX opportunity too small = " << bytes); | 136 NS_LOG_LOGIC ("TX opportunity too small = " << bytes); |
137 return; | 137 return; |
138 } | 138 } |
139 | 139 |
140 Ptr<Packet> packet = Create<Packet> (); | 140 Ptr<Packet> packet = Create<Packet> (); |
141 LteRlcHeader rlcHeader; | 141 LteRlcHeader rlcHeader; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 NS_LOG_LOGIC (" IF firstSegment < NextSegmentSize && txBuffer.size
> 0"); | 292 NS_LOG_LOGIC (" IF firstSegment < NextSegmentSize && txBuffer.size
> 0"); |
293 // Add txBuffer.FirstBuffer to DataField | 293 // Add txBuffer.FirstBuffer to DataField |
294 dataFieldAddedSize = firstSegment->GetSize (); | 294 dataFieldAddedSize = firstSegment->GetSize (); |
295 dataFieldTotalSize += dataFieldAddedSize; | 295 dataFieldTotalSize += dataFieldAddedSize; |
296 dataField.push_back (firstSegment); | 296 dataField.push_back (firstSegment); |
297 | 297 |
298 // ExtensionBit (Next_Segment - 1) = 1 | 298 // ExtensionBit (Next_Segment - 1) = 1 |
299 rlcHeader.PushExtensionBit (LteRlcHeader::E_LI_FIELDS_FOLLOWS); | 299 rlcHeader.PushExtensionBit (LteRlcHeader::E_LI_FIELDS_FOLLOWS); |
300 | 300 |
301 // LengthIndicator (Next_Segment) = txBuffer.FirstBuffer.length() | 301 // LengthIndicator (Next_Segment) = txBuffer.FirstBuffer.length() |
302 rlcHeader.PushLengthIndicator ((uint16_t)firstSegment->GetSize ()); | 302 rlcHeader.PushLengthIndicator (static_cast<uint16_t> (firstSegment->Ge
tSize ())); |
303 | 303 |
304 nextSegmentSize -= ((nextSegmentId % 2) ? (2) : (1)) + dataFieldAddedS
ize; | 304 nextSegmentSize -= ((nextSegmentId % 2) ? (2) : (1)) + dataFieldAddedS
ize; |
305 nextSegmentId++; | 305 nextSegmentId++; |
306 | 306 |
307 NS_LOG_LOGIC (" SDUs in TxBuffer = " << m_txBuffer.size ()); | 307 NS_LOG_LOGIC (" SDUs in TxBuffer = " << m_txBuffer.size ()); |
308 if (m_txBuffer.size () > 0) | 308 if (m_txBuffer.size () > 0) |
309 { | 309 { |
310 NS_LOG_LOGIC (" First SDU buffer = " << *(m_txBuffer.begin
())); | 310 NS_LOG_LOGIC (" First SDU buffer = " << *(m_txBuffer.begin
())); |
311 NS_LOG_LOGIC (" First SDU size = " << (*(m_txBuffer.begi
n()))->GetSize ()); | 311 NS_LOG_LOGIC (" First SDU size = " << (*(m_txBuffer.begi
n()))->GetSize ()); |
312 } | 312 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 void | 405 void |
406 LteRlcUm::DoNotifyHarqDeliveryFailure () | 406 LteRlcUm::DoNotifyHarqDeliveryFailure () |
407 { | 407 { |
408 NS_LOG_FUNCTION (this); | 408 NS_LOG_FUNCTION (this); |
409 } | 409 } |
410 | 410 |
411 void | 411 void |
412 LteRlcUm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) | 412 LteRlcUm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) |
413 { | 413 { |
414 NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize ()); | 414 NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize ()); |
415 NS_UNUSED(rnti); | 415 NS_UNUSED (rnti); |
416 NS_UNUSED(lcid); | 416 NS_UNUSED (lcid); |
417 | 417 |
418 // Receiver timestamp | 418 // Receiver timestamp |
419 RlcTag rlcTag; | 419 RlcTag rlcTag; |
420 Time delay; | 420 Time delay; |
421 NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing"); | 421 NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing"); |
422 p->RemovePacketTag (rlcTag); | 422 p->RemovePacketTag (rlcTag); |
423 delay = Simulator::Now() - rlcTag.GetSenderTimestamp (); | 423 delay = Simulator::Now() - rlcTag.GetSenderTimestamp (); |
424 m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds ()); | 424 m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds ()); |
425 | 425 |
426 // 5.1.2.2 Receive operations | 426 // 5.1.2.2 Receive operations |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 Time holDelay (0); | 1125 Time holDelay (0); |
1126 uint32_t queueSize = 0; | 1126 uint32_t queueSize = 0; |
1127 | 1127 |
1128 if (! m_txBuffer.empty ()) | 1128 if (! m_txBuffer.empty ()) |
1129 { | 1129 { |
1130 RlcTag holTimeTag; | 1130 RlcTag holTimeTag; |
1131 NS_ASSERT_MSG (m_txBuffer.front ()->PeekPacketTag (holTimeTag), "RlcTag is
missing"); | 1131 NS_ASSERT_MSG (m_txBuffer.front ()->PeekPacketTag (holTimeTag), "RlcTag is
missing"); |
1132 m_txBuffer.front ()->PeekPacketTag (holTimeTag); | 1132 m_txBuffer.front ()->PeekPacketTag (holTimeTag); |
1133 holDelay = Simulator::Now () - holTimeTag.GetSenderTimestamp (); | 1133 holDelay = Simulator::Now () - holTimeTag.GetSenderTimestamp (); |
1134 | 1134 |
1135 queueSize = m_txBufferSize + 2 * m_txBuffer.size (); // Data in tx queue +
estimated headers size | 1135 queueSize = m_txBufferSize + 2 * static_cast<uint32_t> (m_txBuffer.size ()
); // Data in tx queue + estimated headers size |
1136 } | 1136 } |
1137 | 1137 |
1138 LteMacSapProvider::ReportBufferStatusParameters r; | 1138 LteMacSapProvider::ReportBufferStatusParameters r; |
1139 r.rnti = m_rnti; | 1139 r.rnti = m_rnti; |
1140 r.lcid = m_lcid; | 1140 r.lcid = m_lcid; |
1141 r.txQueueSize = queueSize; | 1141 r.txQueueSize = queueSize; |
1142 r.txQueueHolDelay = (uint16_t)holDelay.GetMilliSeconds () ; | 1142 r.txQueueHolDelay = static_cast<uint16_t> (holDelay.GetMilliSeconds ()); |
1143 r.retxQueueSize = 0; | 1143 r.retxQueueSize = 0; |
1144 r.retxQueueHolDelay = 0; | 1144 r.retxQueueHolDelay = 0; |
1145 r.statusPduSize = 0; | 1145 r.statusPduSize = 0; |
1146 | 1146 |
1147 NS_LOG_LOGIC ("Send ReportBufferStatus = " << r.txQueueSize << ", " << r.txQue
ueHolDelay ); | 1147 NS_LOG_LOGIC ("Send ReportBufferStatus = " << r.txQueueSize << ", " << r.txQue
ueHolDelay ); |
1148 m_macSapProvider->ReportBufferStatus (r); | 1148 m_macSapProvider->ReportBufferStatus (r); |
1149 } | 1149 } |
1150 | 1150 |
1151 | 1151 |
1152 void | 1152 void |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 NS_LOG_LOGIC ("RBS Timer expires"); | 1194 NS_LOG_LOGIC ("RBS Timer expires"); |
1195 | 1195 |
1196 if (! m_txBuffer.empty ()) | 1196 if (! m_txBuffer.empty ()) |
1197 { | 1197 { |
1198 DoReportBufferStatus (); | 1198 DoReportBufferStatus (); |
1199 m_rbsTimer = Simulator::Schedule (MilliSeconds (10), &LteRlcUm::ExpireRbsT
imer, this); | 1199 m_rbsTimer = Simulator::Schedule (MilliSeconds (10), &LteRlcUm::ExpireRbsT
imer, this); |
1200 } | 1200 } |
1201 } | 1201 } |
1202 | 1202 |
1203 } // namespace ns3 | 1203 } // namespace ns3 |
LEFT | RIGHT |