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 
65  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
69  virtual void DoNotifyHarqDeliveryFailure ();
70  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
71 
72 private:
78  void ExpireReorderingTimer (void);
80  void ExpirePollRetransmitTimer (void);
82  void ExpireRbsTimer (void);
83 
88  void ExpireStatusProhibitTimer (void);
89 
97 //
98 // void ReassembleOutsideWindow (void);
99 // void ReassembleSnLessThan (uint16_t seqNumber);
100 //
101 
107  void ReassembleAndDeliver (Ptr<Packet> packet);
108 
112  void DoReportBufferStatus ();
113 
114 private:
115  std::vector < Ptr<Packet> > m_txonBuffer;
116 
118  struct RetxPdu
119  {
121  uint16_t m_retxCount;
122  };
123 
124  std::vector <RetxPdu> m_txedBuffer;
125  std::vector <RetxPdu> m_retxBuffer;
128 
129  uint32_t m_txonBufferSize;
130  uint32_t m_retxBufferSize;
131  uint32_t m_txedBufferSize;
132 
135 
137  struct PduBuffer
138  {
140  std::list < Ptr<Packet> > m_byteSegments;
141 
143  };
144 
145  std::map <uint16_t, PduBuffer > m_rxonBuffer;
146 
148 
149  // SDU reassembly
150 // std::vector < Ptr<Packet> > m_reasBuffer; // Reassembling buffer
151 //
152  std::list < Ptr<Packet> > m_sdusBuffer;
153 
157  // Transmitting side
162 
163  // Receiving side
169 
173  uint32_t m_pduWithoutPoll;
174  uint32_t m_byteWithoutPoll;
175 
179  uint16_t m_windowSize;
180 
192 
197  uint16_t m_pollPdu;
198  uint16_t m_pollByte;
199 
202 
206  typedef enum { NONE = 0,
211 
216 
217 };
218 
219 
220 } // namespace ns3
221 
222 #endif // LTE_RLC_AM_H
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
SequenceNumber10 m_seqNumber
sequence number
Definition: lte-rlc-am.h:139
EventId m_statusProhibitTimer
status prohibit timer
Definition: lte-rlc-am.h:188
uint32_t m_byteWithoutPoll
byte without poll
Definition: lte-rlc-am.h:174
EventId m_rbsTimer
RBS timer.
Definition: lte-rlc-am.h:190
uint32_t m_statusPduBufferSize
status PDU buffer size
Definition: lte-rlc-am.h:134
SequenceNumber10 m_vtS
VT(S)
Definition: lte-rlc-am.h:160
void DoReportBufferStatus()
Report buffer status.
Definition: lte-rlc-am.cc:1559
virtual void DoReceivePdu(Ptr< Packet > p, uint16_t rnti, uint8_t lcid)
Receive PDU function.
Definition: lte-rlc-am.cc:752
SequenceNumber10 m_vtMs
VT(MS)
Definition: lte-rlc-am.h:159
Time m_reorderingTimerValue
reordering timer value
Definition: lte-rlc-am.h:187
SequenceNumber10 m_vrMs
VR(MS)
Definition: lte-rlc-am.h:167
Time m_pollRetransmitTimerValue
poll retransmit time value
Definition: lte-rlc-am.h:185
SequenceNumber10 m_vrR
VR(R)
Definition: lte-rlc-am.h:164
EventId m_reorderingTimer
reordering timer
Definition: lte-rlc-am.h:186
Time m_rbsTimerValue
RBS timer value.
Definition: lte-rlc-am.h:191
ReassemblingState_t
SDU Reassembling state.
Definition: lte-rlc-am.h:206
bool IsInsideReceivingWindow(SequenceNumber10 seqNumber)
method called when the T_status_prohibit timer expires
Definition: lte-rlc-am.cc:1116
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:124
EventId m_pollRetransmitTimer
Timers.
Definition: lte-rlc-am.h:184
void ExpireRbsTimer(void)
Expire RBS timer.
Definition: lte-rlc-am.cc:1723
uint32_t m_txonBufferSize
transmit on buffer size
Definition: lte-rlc-am.h:129
PduBuffer structure.
Definition: lte-rlc-am.h:137
SequenceNumber10 m_expectedSeqNumber
Expected Sequence Number.
Definition: lte-rlc-am.h:215
virtual void DoNotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
MAC SAP.
Definition: lte-rlc-am.cc:189
std::map< uint16_t, PduBuffer > m_rxonBuffer
Reception buffer.
Definition: lte-rlc-am.h:145
uint16_t m_pollPdu
poll PDU
Definition: lte-rlc-am.h:197
Ptr< Packet > m_keepS0
keep S0
Definition: lte-rlc-am.h:210
SequenceNumber10 m_pollSn
POLL_SN.
Definition: lte-rlc-am.h:161
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::list< Ptr< Packet > > m_sdusBuffer
List of SDUs in a packet (PDU)
Definition: lte-rlc-am.h:152
uint16_t m_pollByte
poll byte
Definition: lte-rlc-am.h:198
SequenceNumber10 m_vrH
VR(H)
Definition: lte-rlc-am.h:168
bool m_pollRetransmitTimerJustExpired
poll retransmit timer just expired?
Definition: lte-rlc-am.h:201
SequenceNumber10 m_vrMr
VR(MR)
Definition: lte-rlc-am.h:165
uint16_t m_retxCount
retransmit count
Definition: lte-rlc-am.h:121
SequenceNumber10 m_vrX
VR(X)
Definition: lte-rlc-am.h:166
uint32_t m_pduWithoutPoll
Counters.
Definition: lte-rlc-am.h:173
uint32_t m_txedBufferSize
transmit ed buffer size
Definition: lte-rlc-am.h:131
Time m_statusProhibitTimerValue
status prohibit timer value
Definition: lte-rlc-am.h:189
virtual void DoNotifyHarqDeliveryFailure()
Notify HARQ delivery failure
Definition: lte-rlc-am.cc:745
uint16_t m_maxRetxThreshold
Configurable parameters.
Definition: lte-rlc-am.h:196
An identifier for simulation events.
Definition: event-id.h:53
virtual void DoDispose()
Destructor implementation.
Definition: lte-rlc-am.cc:128
void ExpireStatusProhibitTimer(void)
method called when the T_status_prohibit timer expires
Definition: lte-rlc-am.cc:1717
void ExpirePollRetransmitTimer(void)
Expire poll retransmitter.
Definition: lte-rlc-am.cc:1674
SequenceNumber10 m_vtA
State variables.
Definition: lte-rlc-am.h:158
std::vector< RetxPdu > m_retxBuffer
Buffer for PDUs considered for retransmission.
Definition: lte-rlc-am.h:127
RetxPdu structure.
Definition: lte-rlc-am.h:118
bool m_pduComplete
PDU complete?
Definition: lte-rlc-am.h:142
std::vector< Ptr< Packet > > m_txonBuffer
Transmission buffer.
Definition: lte-rlc-am.h:115
SequenceNumber10 class.
LTE RLC Acknowledged Mode (AM), see 3GPP TS 36.322.
Definition: lte-rlc-am.h:36
Ptr< Packet > m_controlPduBuffer
Control PDU buffer (just one PDU)
Definition: lte-rlc-am.h:147
void ReassembleAndDeliver(Ptr< Packet > packet)
Reassemble and deliver.
Definition: lte-rlc-am.cc:1140
std::list< Ptr< Packet > > m_byteSegments
byte segments
Definition: lte-rlc-am.h:140
uint16_t m_windowSize
Constants.
Definition: lte-rlc-am.h:179
bool m_txOpportunityForRetxAlwaysBigEnough
transmit opportunity for retransmit?
Definition: lte-rlc-am.h:200
ReassemblingState_t m_reassemblingState
reassembling state
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:50
a unique identifier for an interface.
Definition: type-id.h:58
uint32_t m_retxBufferSize
retransmit buffer size
Definition: lte-rlc-am.h:130
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc-am.cc:88
bool m_statusPduRequested
status PDU requested
Definition: lte-rlc-am.h:133
Ptr< Packet > m_pdu
PDU.
Definition: lte-rlc-am.h:120
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:1632
virtual void DoTransmitPdcpPdu(Ptr< Packet > p)
RLC SAP.
Definition: lte-rlc-am.cc:156
virtual ~LteRlcAm()
Definition: lte-rlc-am.cc:82