A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Manuel Requena <manuel.requena@cttc.es>
7 */
8
9#ifndef LTE_RLC_AM_H
10#define LTE_RLC_AM_H
11
13#include "lte-rlc.h"
14
15#include <ns3/event-id.h>
16
17#include <map>
18#include <vector>
19
20namespace ns3
21{
22
23/**
24 * LTE RLC Acknowledged Mode (AM), see 3GPP TS 36.322
25 */
26class LteRlcAm : public LteRlc
27{
28 public:
29 LteRlcAm();
30 ~LteRlcAm() override;
31 /**
32 * @brief Get the type ID.
33 * @return the object TypeId
34 */
35 static TypeId GetTypeId();
36 void DoDispose() override;
37
38 /**
39 * RLC SAP
40 *
41 * @param p packet
42 */
43 void DoTransmitPdcpPdu(Ptr<Packet> p) override;
44
45 /**
46 * MAC SAP
47 *
48 * @param txOpParams the LteMacSapUser::TxOpportunityParameters
49 */
51 /**
52 * Notify HARQ delivery failure
53 */
54 void DoNotifyHarqDeliveryFailure() override;
55 void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override;
56
57 private:
58 /**
59 * This method will schedule a timeout at WaitReplyTimeout interval
60 * in the future, unless a timer is already running for the cache,
61 * in which case this method does nothing.
62 */
64 /// Expire poll retransmitter
66 /// Expire RBS timer
67 void ExpireRbsTimer();
68
69 /**
70 * method called when the T_status_prohibit timer expires
71 *
72 */
74
75 /**
76 * method called when the T_status_prohibit timer expires
77 *
78 * @param seqNumber SequenceNumber10
79 * @returns true is inside receiving window
80 */
82 //
83 // void ReassembleOutsideWindow ();
84 // void ReassembleSnLessThan (uint16_t seqNumber);
85 //
86
87 /**
88 * Reassemble and deliver
89 *
90 * @param packet the packet
91 */
93
94 /**
95 * Report buffer status
96 */
98
99 private:
100 /**
101 * @brief Store an incoming (from layer above us) PDU, waiting to transmit it
102 */
103 struct TxPdu
104 {
105 /**
106 * @brief TxPdu default constructor
107 * @param pdu the PDU
108 * @param time the arrival time
109 */
110 TxPdu(const Ptr<Packet>& pdu, const Time& time)
111 : m_pdu(pdu),
112 m_waitingSince(time)
113 {
114 }
115
116 TxPdu() = delete;
117
119 Time m_waitingSince; ///< Layer arrival time
120 };
121
122 std::vector<TxPdu> m_txonBuffer; ///< Transmission buffer
123
124 /// RetxPdu structure
125 struct RetxPdu
126 {
128 uint16_t m_retxCount; ///< retransmit count
129 Time m_waitingSince; ///< Layer arrival time
130 };
131
132 std::vector<RetxPdu> m_txedBuffer; ///< Buffer for transmitted and retransmitted PDUs
133 ///< that have not been acked but are not considered
134 ///< for retransmission
135 std::vector<RetxPdu> m_retxBuffer; ///< Buffer for PDUs considered for retransmission
136
137 uint32_t m_maxTxBufferSize; ///< maximum transmission buffer size
138 uint32_t m_txonBufferSize; ///< transmit on buffer size
139 uint32_t m_retxBufferSize; ///< retransmit buffer size
140 uint32_t m_txedBufferSize; ///< transmit ed buffer size
141
142 bool m_statusPduRequested; ///< status PDU requested
143 uint32_t m_statusPduBufferSize; ///< status PDU buffer size
144
145 /// PduBuffer structure
147 {
148 SequenceNumber10 m_seqNumber; ///< sequence number
149 std::list<Ptr<Packet>> m_byteSegments; ///< byte segments
150
151 bool m_pduComplete; ///< PDU complete?
152 };
153
154 std::map<uint16_t, PduBuffer> m_rxonBuffer; ///< Reception buffer
155
156 Ptr<Packet> m_controlPduBuffer; ///< Control PDU buffer (just one PDU)
157
158 // SDU reassembly
159 // std::vector < Ptr<Packet> > m_reasBuffer; // Reassembling buffer
160 //
161 std::list<Ptr<Packet>> m_sdusBuffer; ///< List of SDUs in a packet (PDU)
162
163 /**
164 * State variables. See section 7.1 in TS 36.322
165 */
166 // Transmitting side
171
172 // Receiving side
178
179 /**
180 * Counters. See section 7.1 in TS 36.322
181 */
182 uint32_t m_pduWithoutPoll; ///< PDU without poll
183 uint32_t m_byteWithoutPoll; ///< byte without poll
184
185 /**
186 * Constants. See section 7.2 in TS 36.322
187 */
188 uint16_t m_windowSize;
189
190 /**
191 * Timers. See section 7.3 in TS 36.322
192 */
193 EventId m_pollRetransmitTimer; ///< poll retransmit timer
194 Time m_pollRetransmitTimerValue; ///< poll retransmit time value
195 EventId m_reorderingTimer; ///< reordering timer
196 Time m_reorderingTimerValue; ///< reordering timer value
197 EventId m_statusProhibitTimer; ///< status prohibit timer
198 Time m_statusProhibitTimerValue; ///< status prohibit timer value
199 EventId m_rbsTimer; ///< RBS timer
200 Time m_rbsTimerValue; ///< RBS timer value
201
202 /**
203 * Configurable parameters. See section 7.4 in TS 36.322
204 */
205 uint16_t m_maxRetxThreshold; ///< \todo How these parameters are configured???
206 uint16_t m_pollPdu; ///< poll PDU
207 uint16_t m_pollByte; ///< poll byte
208
209 bool m_txOpportunityForRetxAlwaysBigEnough; ///< transmit opportunity for retransmit?
210 bool m_pollRetransmitTimerJustExpired; ///< poll retransmit timer just expired?
211
212 /**
213 * SDU Reassembling state
214 */
221
223 Ptr<Packet> m_keepS0; ///< keep S0
224
225 /**
226 * Expected Sequence Number
227 */
229};
230
231} // namespace ns3
232
233#endif // LTE_RLC_AM_H
An identifier for simulation events.
Definition event-id.h:45
LTE RLC Acknowledged Mode (AM), see 3GPP TS 36.322.
Definition lte-rlc-am.h:27
ReassemblingState_t m_reassemblingState
reassembling state
Definition lte-rlc-am.h:222
void ExpireStatusProhibitTimer()
method called when the T_status_prohibit timer expires
SequenceNumber10 m_vrMr
VR(MR)
Definition lte-rlc-am.h:174
Time m_statusProhibitTimerValue
status prohibit timer value
Definition lte-rlc-am.h:198
bool IsInsideReceivingWindow(SequenceNumber10 seqNumber)
method called when the T_status_prohibit timer expires
uint16_t m_windowSize
Constants.
Definition lte-rlc-am.h:188
Ptr< Packet > m_keepS0
keep S0
Definition lte-rlc-am.h:223
void DoNotifyHarqDeliveryFailure() override
Notify HARQ delivery failure.
SequenceNumber10 m_vrH
VR(H)
Definition lte-rlc-am.h:177
uint32_t m_txonBufferSize
transmit on buffer size
Definition lte-rlc-am.h:138
ReassemblingState_t
SDU Reassembling state.
Definition lte-rlc-am.h:216
std::vector< TxPdu > m_txonBuffer
Transmission buffer.
Definition lte-rlc-am.h:122
SequenceNumber10 m_vrMs
VR(MS)
Definition lte-rlc-am.h:176
uint16_t m_pollByte
poll byte
Definition lte-rlc-am.h:207
SequenceNumber10 m_vtS
VT(S)
Definition lte-rlc-am.h:169
void DoDispose() override
Destructor implementation.
SequenceNumber10 m_pollSn
POLL_SN.
Definition lte-rlc-am.h:170
SequenceNumber10 m_vtA
State variables.
Definition lte-rlc-am.h:167
void ExpireReorderingTimer()
This method will schedule a timeout at WaitReplyTimeout interval in the future, unless a timer is alr...
SequenceNumber10 m_vtMs
VT(MS)
Definition lte-rlc-am.h:168
EventId m_rbsTimer
RBS timer.
Definition lte-rlc-am.h:199
~LteRlcAm() override
Definition lte-rlc-am.cc:70
uint32_t m_statusPduBufferSize
status PDU buffer size
Definition lte-rlc-am.h:143
Ptr< Packet > m_controlPduBuffer
Control PDU buffer (just one PDU)
Definition lte-rlc-am.h:156
bool m_txOpportunityForRetxAlwaysBigEnough
transmit opportunity for retransmit?
Definition lte-rlc-am.h:209
bool m_pollRetransmitTimerJustExpired
poll retransmit timer just expired?
Definition lte-rlc-am.h:210
void DoTransmitPdcpPdu(Ptr< Packet > p) override
RLC SAP.
Time m_reorderingTimerValue
reordering timer value
Definition lte-rlc-am.h:196
uint32_t m_maxTxBufferSize
maximum transmission buffer size
Definition lte-rlc-am.h:137
void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override
Receive PDU function.
std::list< Ptr< Packet > > m_sdusBuffer
List of SDUs in a packet (PDU)
Definition lte-rlc-am.h:161
EventId m_pollRetransmitTimer
Timers.
Definition lte-rlc-am.h:193
uint16_t m_maxRetxThreshold
Configurable parameters.
Definition lte-rlc-am.h:205
SequenceNumber10 m_vrX
VR(X)
Definition lte-rlc-am.h:175
std::vector< RetxPdu > m_retxBuffer
Buffer for PDUs considered for retransmission.
Definition lte-rlc-am.h:135
uint32_t m_byteWithoutPoll
byte without poll
Definition lte-rlc-am.h:183
void ExpireRbsTimer()
Expire RBS timer.
uint32_t m_pduWithoutPoll
Counters.
Definition lte-rlc-am.h:182
static TypeId GetTypeId()
Get the type ID.
Definition lte-rlc-am.cc:76
void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters txOpParams) override
MAC SAP.
Time m_pollRetransmitTimerValue
poll retransmit time value
Definition lte-rlc-am.h:194
void DoReportBufferStatus()
Report buffer status.
void ReassembleAndDeliver(Ptr< Packet > packet)
Reassemble and deliver.
std::map< uint16_t, PduBuffer > m_rxonBuffer
Reception buffer.
Definition lte-rlc-am.h:154
uint32_t m_txedBufferSize
transmit ed buffer size
Definition lte-rlc-am.h:140
uint16_t m_pollPdu
poll PDU
Definition lte-rlc-am.h:206
EventId m_reorderingTimer
reordering timer
Definition lte-rlc-am.h:195
void ExpirePollRetransmitTimer()
Expire poll retransmitter.
SequenceNumber10 m_vrR
VR(R)
Definition lte-rlc-am.h:173
SequenceNumber10 m_expectedSeqNumber
Expected Sequence Number.
Definition lte-rlc-am.h:228
uint32_t m_retxBufferSize
retransmit buffer size
Definition lte-rlc-am.h:139
EventId m_statusProhibitTimer
status prohibit timer
Definition lte-rlc-am.h:197
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:132
bool m_statusPduRequested
status PDU requested
Definition lte-rlc-am.h:142
Time m_rbsTimerValue
RBS timer value.
Definition lte-rlc-am.h:200
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
Definition lte-rlc.h:38
Smart pointer class similar to boost::intrusive_ptr.
SequenceNumber10 class.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters for LteMacSapUser::ReceivePdu.
Parameters for LteMacSapUser::NotifyTxOpportunity.
Definition lte-mac-sap.h:94
PduBuffer structure.
Definition lte-rlc-am.h:147
SequenceNumber10 m_seqNumber
sequence number
Definition lte-rlc-am.h:148
bool m_pduComplete
PDU complete?
Definition lte-rlc-am.h:151
std::list< Ptr< Packet > > m_byteSegments
byte segments
Definition lte-rlc-am.h:149
RetxPdu structure.
Definition lte-rlc-am.h:126
uint16_t m_retxCount
retransmit count
Definition lte-rlc-am.h:128
Ptr< Packet > m_pdu
PDU.
Definition lte-rlc-am.h:127
Time m_waitingSince
Layer arrival time.
Definition lte-rlc-am.h:129
Store an incoming (from layer above us) PDU, waiting to transmit it.
Definition lte-rlc-am.h:104
TxPdu(const Ptr< Packet > &pdu, const Time &time)
TxPdu default constructor.
Definition lte-rlc-am.h:110
Time m_waitingSince
Layer arrival time.
Definition lte-rlc-am.h:119
Ptr< Packet > m_pdu
PDU.
Definition lte-rlc-am.h:118