A Discrete-Event Network Simulator
API
lte-rlc-am.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Manuel Requena <manuel.requena@cttc.es>
18  */
19 
20 #ifndef LTE_RLC_AM_H
21 #define LTE_RLC_AM_H
22 
24 #include "lte-rlc.h"
25 
26 #include <ns3/event-id.h>
27 
28 #include <map>
29 #include <vector>
30 
31 namespace ns3
32 {
33 
37 class LteRlcAm : public LteRlc
38 {
39  public:
40  LteRlcAm();
41  ~LteRlcAm() override;
46  static TypeId GetTypeId();
47  void DoDispose() override;
48 
54  void DoTransmitPdcpPdu(Ptr<Packet> p) override;
55 
65  void DoNotifyHarqDeliveryFailure() override;
66  void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override;
67 
68  private:
74  void ExpireReorderingTimer();
78  void ExpireRbsTimer();
79 
85 
93  //
94  // void ReassembleOutsideWindow ();
95  // void ReassembleSnLessThan (uint16_t seqNumber);
96  //
97 
103  void ReassembleAndDeliver(Ptr<Packet> packet);
104 
108  void DoReportBufferStatus();
109 
110  private:
114  struct TxPdu
115  {
121  TxPdu(const Ptr<Packet>& pdu, const Time& time)
122  : m_pdu(pdu),
123  m_waitingSince(time)
124  {
125  }
126 
127  TxPdu() = delete;
128 
131  };
132 
133  std::vector<TxPdu> m_txonBuffer;
134 
136  struct RetxPdu
137  {
139  uint16_t m_retxCount;
141  };
142 
143  std::vector<RetxPdu> m_txedBuffer;
146  std::vector<RetxPdu> m_retxBuffer;
147 
148  uint32_t m_maxTxBufferSize;
149  uint32_t m_txonBufferSize;
150  uint32_t m_retxBufferSize;
151  uint32_t m_txedBufferSize;
152 
155 
157  struct PduBuffer
158  {
160  std::list<Ptr<Packet>> m_byteSegments;
161 
163  };
164 
165  std::map<uint16_t, PduBuffer> m_rxonBuffer;
166 
168 
169  // SDU reassembly
170  // std::vector < Ptr<Packet> > m_reasBuffer; // Reassembling buffer
171  //
172  std::list<Ptr<Packet>> m_sdusBuffer;
173 
177  // Transmitting side
182 
183  // Receiving side
189 
193  uint32_t m_pduWithoutPoll;
194  uint32_t m_byteWithoutPoll;
195 
199  uint16_t m_windowSize;
200 
212 
217  uint16_t m_pollPdu;
218  uint16_t m_pollByte;
219 
222 
227  {
228  NONE = 0,
230  WAITING_SI_SF = 2
231  };
232 
235 
240 };
241 
242 } // namespace ns3
243 
244 #endif // LTE_RLC_AM_H
An identifier for simulation events.
Definition: event-id.h:55
LTE RLC Acknowledged Mode (AM), see 3GPP TS 36.322.
Definition: lte-rlc-am.h:38
ReassemblingState_t m_reassemblingState
reassembling state
Definition: lte-rlc-am.h:233
void ExpireStatusProhibitTimer()
method called when the T_status_prohibit timer expires
Definition: lte-rlc-am.cc:1777
SequenceNumber10 m_vrMr
VR(MR)
Definition: lte-rlc-am.h:185
Time m_statusProhibitTimerValue
status prohibit timer value
Definition: lte-rlc-am.h:209
bool IsInsideReceivingWindow(SequenceNumber10 seqNumber)
method called when the T_status_prohibit timer expires
Definition: lte-rlc-am.cc:1161
uint16_t m_windowSize
Constants.
Definition: lte-rlc-am.h:199
Ptr< Packet > m_keepS0
keep S0
Definition: lte-rlc-am.h:234
void DoNotifyHarqDeliveryFailure() override
Notify HARQ delivery failure.
Definition: lte-rlc-am.cc:781
SequenceNumber10 m_vrH
VR(H)
Definition: lte-rlc-am.h:188
uint32_t m_txonBufferSize
transmit on buffer size
Definition: lte-rlc-am.h:149
ReassemblingState_t
SDU Reassembling state.
Definition: lte-rlc-am.h:227
std::vector< TxPdu > m_txonBuffer
Transmission buffer.
Definition: lte-rlc-am.h:133
SequenceNumber10 m_vrMs
VR(MS)
Definition: lte-rlc-am.h:187
uint16_t m_pollByte
poll byte
Definition: lte-rlc-am.h:218
SequenceNumber10 m_vtS
VT(S)
Definition: lte-rlc-am.h:180
void DoDispose() override
Destructor implementation.
Definition: lte-rlc-am.cc:133
SequenceNumber10 m_pollSn
POLL_SN.
Definition: lte-rlc-am.h:181
SequenceNumber10 m_vtA
State variables.
Definition: lte-rlc-am.h:178
void ExpireReorderingTimer()
This method will schedule a timeout at WaitReplyTimeout interval in the future, unless a timer is alr...
Definition: lte-rlc-am.cc:1691
SequenceNumber10 m_vtMs
VT(MS)
Definition: lte-rlc-am.h:179
EventId m_rbsTimer
RBS timer.
Definition: lte-rlc-am.h:210
~LteRlcAm() override
Definition: lte-rlc-am.cc:81
uint32_t m_statusPduBufferSize
status PDU buffer size
Definition: lte-rlc-am.h:154
Ptr< Packet > m_controlPduBuffer
Control PDU buffer (just one PDU)
Definition: lte-rlc-am.h:167
bool m_txOpportunityForRetxAlwaysBigEnough
transmit opportunity for retransmit?
Definition: lte-rlc-am.h:220
bool m_pollRetransmitTimerJustExpired
poll retransmit timer just expired?
Definition: lte-rlc-am.h:221
void DoTransmitPdcpPdu(Ptr< Packet > p) override
RLC SAP.
Definition: lte-rlc-am.cc:161
Time m_reorderingTimerValue
reordering timer value
Definition: lte-rlc-am.h:207
uint32_t m_maxTxBufferSize
maximum transmission buffer size
Definition: lte-rlc-am.h:148
void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override
Receive PDU function.
Definition: lte-rlc-am.cc:787
std::list< Ptr< Packet > > m_sdusBuffer
List of SDUs in a packet (PDU)
Definition: lte-rlc-am.h:172
EventId m_pollRetransmitTimer
Timers.
Definition: lte-rlc-am.h:204
uint16_t m_maxRetxThreshold
Configurable parameters.
Definition: lte-rlc-am.h:216
SequenceNumber10 m_vrX
VR(X)
Definition: lte-rlc-am.h:186
std::vector< RetxPdu > m_retxBuffer
Buffer for PDUs considered for retransmission.
Definition: lte-rlc-am.h:146
uint32_t m_byteWithoutPoll
byte without poll
Definition: lte-rlc-am.h:194
void ExpireRbsTimer()
Expire RBS timer.
Definition: lte-rlc-am.cc:1783
uint32_t m_pduWithoutPoll
Counters.
Definition: lte-rlc-am.h:193
static TypeId GetTypeId()
Get the type ID.
Definition: lte-rlc-am.cc:87
void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters txOpParams) override
MAC SAP.
Definition: lte-rlc-am.cc:199
Time m_pollRetransmitTimerValue
poll retransmit time value
Definition: lte-rlc-am.h:205
void DoReportBufferStatus()
Report buffer status.
Definition: lte-rlc-am.cc:1621
void ReassembleAndDeliver(Ptr< Packet > packet)
Reassemble and deliver.
Definition: lte-rlc-am.cc:1183
std::map< uint16_t, PduBuffer > m_rxonBuffer
Reception buffer.
Definition: lte-rlc-am.h:165
uint32_t m_txedBufferSize
transmit ed buffer size
Definition: lte-rlc-am.h:151
uint16_t m_pollPdu
poll PDU
Definition: lte-rlc-am.h:217
EventId m_reorderingTimer
reordering timer
Definition: lte-rlc-am.h:206
void ExpirePollRetransmitTimer()
Expire poll retransmitter.
Definition: lte-rlc-am.cc:1733
SequenceNumber10 m_vrR
VR(R)
Definition: lte-rlc-am.h:184
SequenceNumber10 m_expectedSeqNumber
Expected Sequence Number.
Definition: lte-rlc-am.h:239
uint32_t m_retxBufferSize
retransmit buffer size
Definition: lte-rlc-am.h:150
EventId m_statusProhibitTimer
status prohibit timer
Definition: lte-rlc-am.h:208
std::vector< RetxPdu > m_txedBuffer
Buffer for transmitted and retransmitted PDUs that have not been acked but are not considered for ret...
Definition: lte-rlc-am.h:143
bool m_statusPduRequested
status PDU requested
Definition: lte-rlc-am.h:153
Time m_rbsTimerValue
RBS timer value.
Definition: lte-rlc-am.h:211
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
Definition: lte-rlc.h:49
SequenceNumber10 class.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters for LteMacSapUser::ReceivePdu.
Definition: lte-mac-sap.h:166
Parameters for LteMacSapUser::NotifyTxOpportunity.
Definition: lte-mac-sap.h:105
PduBuffer structure.
Definition: lte-rlc-am.h:158
SequenceNumber10 m_seqNumber
sequence number
Definition: lte-rlc-am.h:159
bool m_pduComplete
PDU complete?
Definition: lte-rlc-am.h:162
std::list< Ptr< Packet > > m_byteSegments
byte segments
Definition: lte-rlc-am.h:160
RetxPdu structure.
Definition: lte-rlc-am.h:137
uint16_t m_retxCount
retransmit count
Definition: lte-rlc-am.h:139
Ptr< Packet > m_pdu
PDU.
Definition: lte-rlc-am.h:138
Time m_waitingSince
Layer arrival time.
Definition: lte-rlc-am.h:140
Store an incoming (from layer above us) PDU, waiting to transmit it.
Definition: lte-rlc-am.h:115
TxPdu(const Ptr< Packet > &pdu, const Time &time)
TxPdu default constructor.
Definition: lte-rlc-am.h:121
Time m_waitingSince
Layer arrival time.
Definition: lte-rlc-am.h:130
Ptr< Packet > m_pdu
PDU.
Definition: lte-rlc-am.h:129