A Discrete-Event Network Simulator
API
lte-rlc-am.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
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
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 #ifndef LTE_RLC_AM_H
22 #define LTE_RLC_AM_H
23 
24 #include <ns3/event-id.h>
25 #include <ns3/lte-rlc-sequence-number.h>
26 #include <ns3/lte-rlc.h>
27 
28 #include <vector>
29 #include <map>
30 
31 namespace ns3 {
32 
36 class LteRlcAm : public LteRlc
37 {
38 public:
39  LteRlcAm ();
40  virtual ~LteRlcAm ();
45  static TypeId GetTypeId (void);
46  virtual void DoDispose ();
47 
53  virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
54 
64  virtual void DoNotifyHarqDeliveryFailure ();
65  virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
66 
67 private:
73  void ExpireReorderingTimer (void);
75  void ExpirePollRetransmitTimer (void);
77  void ExpireRbsTimer (void);
78 
83  void ExpireStatusProhibitTimer (void);
84 
92 //
93 // void ReassembleOutsideWindow (void);
94 // void ReassembleSnLessThan (uint16_t seqNumber);
95 //
96 
102  void ReassembleAndDeliver (Ptr<Packet> packet);
103 
107  void DoReportBufferStatus ();
108 
109 private:
113  struct TxPdu
114  {
120  TxPdu (const Ptr<Packet> &pdu, const Time &time) :
121  m_pdu (pdu),
122  m_waitingSince (time)
123  { }
124 
125  TxPdu () = delete;
126 
129  };
130 
131  std::vector < TxPdu > m_txonBuffer;
132 
134  struct RetxPdu
135  {
137  uint16_t m_retxCount;
139  };
140 
141  std::vector <RetxPdu> m_txedBuffer;
144  std::vector <RetxPdu> m_retxBuffer;
145 
146  uint32_t m_maxTxBufferSize;
147  uint32_t m_txonBufferSize;
148  uint32_t m_retxBufferSize;
149  uint32_t m_txedBufferSize;
150 
153 
155  struct PduBuffer
156  {
158  std::list < Ptr<Packet> > m_byteSegments;
159 
161  };
162 
163  std::map <uint16_t, PduBuffer > m_rxonBuffer;
164 
166 
167  // SDU reassembly
168 // std::vector < Ptr<Packet> > m_reasBuffer; // Reassembling buffer
169 //
170  std::list < Ptr<Packet> > m_sdusBuffer;
171 
175  // Transmitting side
180 
181  // Receiving side
187 
191  uint32_t m_pduWithoutPoll;
192  uint32_t m_byteWithoutPoll;
193 
197  uint16_t m_windowSize;
198 
210 
215  uint16_t m_pollPdu;
216  uint16_t m_pollByte;
217 
220 
224  typedef enum { NONE = 0,
229 
234 
235 };
236 
237 
238 } // namespace ns3
239 
240 #endif // LTE_RLC_AM_H
An identifier for simulation events.
Definition: event-id.h:54
LTE RLC Acknowledged Mode (AM), see 3GPP TS 36.322.
Definition: lte-rlc-am.h:37
virtual void DoTransmitPdcpPdu(Ptr< Packet > p)
RLC SAP.
Definition: lte-rlc-am.cc:161
ReassemblingState_t m_reassemblingState
reassembling state
Definition: lte-rlc-am.h:227
std::vector< TxPdu > m_txonBuffer
Transmission buffer.
Definition: lte-rlc-am.h:131
SequenceNumber10 m_vrMr
VR(MR)
Definition: lte-rlc-am.h:183
Time m_statusProhibitTimerValue
status prohibit timer value
Definition: lte-rlc-am.h:207
virtual void DoNotifyHarqDeliveryFailure()
Notify HARQ delivery failure.
Definition: lte-rlc-am.cc:760
void ExpirePollRetransmitTimer(void)
Expire poll retransmitter.
Definition: lte-rlc-am.cc:1699
bool IsInsideReceivingWindow(SequenceNumber10 seqNumber)
method called when the T_status_prohibit timer expires
Definition: lte-rlc-am.cc:1138
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc-am.cc:88
uint16_t m_windowSize
Constants.
Definition: lte-rlc-am.h:197
Ptr< Packet > m_keepS0
keep S0
Definition: lte-rlc-am.h:228
SequenceNumber10 m_vrH
VR(H)
Definition: lte-rlc-am.h:186
uint32_t m_txonBufferSize
transmit on buffer size
Definition: lte-rlc-am.h:147
ReassemblingState_t
SDU Reassembling state.
Definition: lte-rlc-am.h:224
SequenceNumber10 m_vrMs
VR(MS)
Definition: lte-rlc-am.h:185
uint16_t m_pollByte
poll byte
Definition: lte-rlc-am.h:216
SequenceNumber10 m_vtS
VT(S)
Definition: lte-rlc-am.h:178
virtual void DoDispose()
Destructor implementation.
Definition: lte-rlc-am.cc:132
SequenceNumber10 m_pollSn
POLL_SN.
Definition: lte-rlc-am.h:179
virtual void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters txOpParams)
MAC SAP.
Definition: lte-rlc-am.cc:200
SequenceNumber10 m_vtA
State variables.
Definition: lte-rlc-am.h:176
void ExpireReorderingTimer(void)
This method will schedule a timeout at WaitReplyTimeout interval in the future, unless a timer is alr...
Definition: lte-rlc-am.cc:1657
SequenceNumber10 m_vtMs
VT(MS)
Definition: lte-rlc-am.h:177
EventId m_rbsTimer
RBS timer.
Definition: lte-rlc-am.h:208
uint32_t m_statusPduBufferSize
status PDU buffer size
Definition: lte-rlc-am.h:152
Ptr< Packet > m_controlPduBuffer
Control PDU buffer (just one PDU)
Definition: lte-rlc-am.h:165
std::map< uint16_t, PduBuffer > m_rxonBuffer
Reception buffer.
Definition: lte-rlc-am.h:163
bool m_txOpportunityForRetxAlwaysBigEnough
transmit opportunity for retransmit?
Definition: lte-rlc-am.h:218
bool m_pollRetransmitTimerJustExpired
poll retransmit timer just expired?
Definition: lte-rlc-am.h:219
void ExpireStatusProhibitTimer(void)
method called when the T_status_prohibit timer expires
Definition: lte-rlc-am.cc:1744
Time m_reorderingTimerValue
reordering timer value
Definition: lte-rlc-am.h:205
uint32_t m_maxTxBufferSize
maximum transmission buffer size
Definition: lte-rlc-am.h:146
EventId m_pollRetransmitTimer
Timers.
Definition: lte-rlc-am.h:202
uint16_t m_maxRetxThreshold
Configurable parameters.
Definition: lte-rlc-am.h:214
SequenceNumber10 m_vrX
VR(X)
Definition: lte-rlc-am.h:184
void ExpireRbsTimer(void)
Expire RBS timer.
Definition: lte-rlc-am.cc:1750
std::vector< RetxPdu > m_retxBuffer
Buffer for PDUs considered for retransmission.
Definition: lte-rlc-am.h:144
uint32_t m_byteWithoutPoll
byte without poll
Definition: lte-rlc-am.h:192
std::list< Ptr< Packet > > m_sdusBuffer
List of SDUs in a packet (PDU)
Definition: lte-rlc-am.h:170
uint32_t m_pduWithoutPoll
Counters.
Definition: lte-rlc-am.h:191
virtual ~LteRlcAm()
Definition: lte-rlc-am.cc:82
Time m_pollRetransmitTimerValue
poll retransmit time value
Definition: lte-rlc-am.h:203
void DoReportBufferStatus()
Report buffer status.
Definition: lte-rlc-am.cc:1586
void ReassembleAndDeliver(Ptr< Packet > packet)
Reassemble and deliver.
Definition: lte-rlc-am.cc:1162
uint32_t m_txedBufferSize
transmit ed buffer size
Definition: lte-rlc-am.h:149
uint16_t m_pollPdu
poll PDU
Definition: lte-rlc-am.h:215
virtual void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams)
Receive PDU function.
Definition: lte-rlc-am.cc:767
EventId m_reorderingTimer
reordering timer
Definition: lte-rlc-am.h:204
SequenceNumber10 m_vrR
VR(R)
Definition: lte-rlc-am.h:182
SequenceNumber10 m_expectedSeqNumber
Expected Sequence Number.
Definition: lte-rlc-am.h:233
uint32_t m_retxBufferSize
retransmit buffer size
Definition: lte-rlc-am.h:148
EventId m_statusProhibitTimer
status prohibit timer
Definition: lte-rlc-am.h:206
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:141
bool m_statusPduRequested
status PDU requested
Definition: lte-rlc-am.h:151
Time m_rbsTimerValue
RBS timer value.
Definition: lte-rlc-am.h:209
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
Definition: lte-rlc.h:51
SequenceNumber10 class.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
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:157
Parameters for LteMacSapUser::NotifyTxOpportunity.
Definition: lte-mac-sap.h:104
PduBuffer structure.
Definition: lte-rlc-am.h:156
std::list< Ptr< Packet > > m_byteSegments
byte segments
Definition: lte-rlc-am.h:158
SequenceNumber10 m_seqNumber
sequence number
Definition: lte-rlc-am.h:157
bool m_pduComplete
PDU complete?
Definition: lte-rlc-am.h:160
RetxPdu structure.
Definition: lte-rlc-am.h:135
uint16_t m_retxCount
retransmit count
Definition: lte-rlc-am.h:137
Ptr< Packet > m_pdu
PDU.
Definition: lte-rlc-am.h:136
Time m_waitingSince
Layer arrival time.
Definition: lte-rlc-am.h:138
Store an incoming (from layer above us) PDU, waiting to transmit it.
Definition: lte-rlc-am.h:114
TxPdu(const Ptr< Packet > &pdu, const Time &time)
TxPdu default constructor.
Definition: lte-rlc-am.h:120
Time m_waitingSince
Layer arrival time.
Definition: lte-rlc-am.h:128
Ptr< Packet > m_pdu
PDU.
Definition: lte-rlc-am.h:127