A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-rlc-um.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_UM_H
21#define LTE_RLC_UM_H
22
24#include "lte-rlc.h"
25
26#include <ns3/event-id.h>
27
28#include <deque>
29#include <map>
30
31namespace ns3
32{
33
34/**
35 * LTE RLC Unacknowledged Mode (UM), see 3GPP TS 36.322
36 */
37class LteRlcUm : public LteRlc
38{
39 public:
40 LteRlcUm();
41 ~LteRlcUm() override;
42 /**
43 * \brief Get the type ID.
44 * \return the object TypeId
45 */
46 static TypeId GetTypeId();
47 void DoDispose() override;
48
49 /**
50 * RLC SAP
51 *
52 * \param p packet
53 */
54 void DoTransmitPdcpPdu(Ptr<Packet> p) override;
55
56 /**
57 * MAC SAP
58 *
59 * \param txOpParams the LteMacSapUser::TxOpportunityParameters
60 */
62 void DoNotifyHarqDeliveryFailure() override;
63 void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override;
64
65 private:
66 /// Expire reordering timer
68 /// Expire RBS timer
69 void ExpireRbsTimer();
70
71 /**
72 * Is inside reordering window function
73 *
74 * \param seqNumber the sequence number
75 * \returns true if inside the window
76 */
78
79 /// Reassemble outside window
81 /**
82 * Reassemble SN interval function
83 *
84 * \param lowSeqNumber the low sequence number
85 * \param highSeqNumber the high sequence number
86 */
87 void ReassembleSnInterval(SequenceNumber10 lowSeqNumber, SequenceNumber10 highSeqNumber);
88
89 /**
90 * Reassemble and deliver function
91 *
92 * \param packet the packet
93 */
95
96 /// Report buffer status
98
99 private:
100 uint32_t m_maxTxBufferSize; ///< maximum transmit buffer status
101 uint32_t m_txBufferSize; ///< transmit buffer size
102
103 /**
104 * \brief Store an incoming (from layer above us) PDU, waiting to transmit it
105 */
106 struct TxPdu
107 {
108 /**
109 * \brief TxPdu default constructor
110 * \param pdu the PDU
111 * \param time the arrival time
112 */
113 TxPdu(const Ptr<Packet>& pdu, const Time& time)
114 : m_pdu(pdu),
115 m_waitingSince(time)
116 {
117 }
118
119 TxPdu() = delete;
120
122 Time m_waitingSince; ///< Layer arrival time
123 };
124
125 std::deque<TxPdu> m_txBuffer; ///< Transmission buffer
126 std::map<uint16_t, Ptr<Packet>> m_rxBuffer; ///< Reception buffer
127 std::vector<Ptr<Packet>> m_reasBuffer; ///< Reassembling buffer
128
129 std::list<Ptr<Packet>> m_sdusBuffer; ///< List of SDUs in a packet
130
131 /**
132 * State variables. See section 7.1 in TS 36.322
133 */
135
139
140 /**
141 * Constants. See section 7.2 in TS 36.322
142 */
143 uint16_t m_windowSize; ///< windows size
144
145 /**
146 * Timers. See section 7.3 in TS 36.322
147 */
148 Time m_reorderingTimerValue; ///< reordering timer value
149 EventId m_reorderingTimer; ///< reordering timer
150 EventId m_rbsTimer; ///< RBS timer
151 bool m_enablePdcpDiscarding{false}; //!< whether to use the PDCP discarding (perform discarding
152 //!< at the moment of passing the PDCP SDU to RLC)
153 uint32_t m_discardTimerMs{0}; //!< the discard timer value in milliseconds
154
155 /**
156 * Reassembling state
157 */
159 {
160 NONE = 0,
162 WAITING_SI_SF = 2
163 };
164
166 Ptr<Packet> m_keepS0; ///< keep S0
167
168 /**
169 * Expected Sequence Number
170 */
172};
173
174} // namespace ns3
175
176#endif // LTE_RLC_UM_H
An identifier for simulation events.
Definition: event-id.h:55
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
Definition: lte-rlc.h:49
LTE RLC Unacknowledged Mode (UM), see 3GPP TS 36.322.
Definition: lte-rlc-um.h:38
SequenceNumber10 m_vrUr
VR(UR)
Definition: lte-rlc-um.h:136
Ptr< Packet > m_keepS0
keep S0
Definition: lte-rlc-um.h:166
void ReassembleAndDeliver(Ptr< Packet > packet)
Reassemble and deliver function.
Definition: lte-rlc-um.cc:642
void DoReportBufferStatus()
Report buffer status.
Definition: lte-rlc-um.cc:1176
uint32_t m_txBufferSize
transmit buffer size
Definition: lte-rlc-um.h:101
static TypeId GetTypeId()
Get the type ID.
Definition: lte-rlc-um.cc:56
void ReassembleOutsideWindow()
Reassemble outside window.
Definition: lte-rlc-um.cc:1123
std::vector< Ptr< Packet > > m_reasBuffer
Reassembling buffer.
Definition: lte-rlc-um.h:127
void DoDispose() override
Destructor implementation.
Definition: lte-rlc-um.cc:91
void ExpireReorderingTimer()
Expire reordering timer.
Definition: lte-rlc-um.cc:1203
Time m_reorderingTimerValue
Timers.
Definition: lte-rlc-um.h:148
~LteRlcUm() override
Definition: lte-rlc-um.cc:50
SequenceNumber10 m_expectedSeqNumber
Expected Sequence Number.
Definition: lte-rlc-um.h:171
ReassemblingState_t m_reassemblingState
reassembling state
Definition: lte-rlc-um.h:165
void ReassembleSnInterval(SequenceNumber10 lowSeqNumber, SequenceNumber10 highSeqNumber)
Reassemble SN interval function.
Definition: lte-rlc-um.cc:1148
void ExpireRbsTimer()
Expire RBS timer.
Definition: lte-rlc-um.cc:1242
EventId m_rbsTimer
RBS timer.
Definition: lte-rlc-um.h:150
void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters txOpParams) override
MAC SAP.
Definition: lte-rlc-um.cc:163
SequenceNumber10 m_vrUx
VR(UX)
Definition: lte-rlc-um.h:137
uint16_t m_windowSize
Constants.
Definition: lte-rlc-um.h:143
std::map< uint16_t, Ptr< Packet > > m_rxBuffer
Reception buffer.
Definition: lte-rlc-um.h:126
uint32_t m_discardTimerMs
the discard timer value in milliseconds
Definition: lte-rlc-um.h:153
void DoNotifyHarqDeliveryFailure() override
Notify HARQ delivery failure.
Definition: lte-rlc-um.cc:446
SequenceNumber10 m_vrUh
VR(UH)
Definition: lte-rlc-um.h:138
void DoTransmitPdcpPdu(Ptr< Packet > p) override
RLC SAP.
Definition: lte-rlc-um.cc:105
void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override
Receive PDU function.
Definition: lte-rlc-um.cc:452
uint32_t m_maxTxBufferSize
maximum transmit buffer status
Definition: lte-rlc-um.h:100
std::deque< TxPdu > m_txBuffer
Transmission buffer.
Definition: lte-rlc-um.h:125
std::list< Ptr< Packet > > m_sdusBuffer
List of SDUs in a packet.
Definition: lte-rlc-um.h:129
ReassemblingState_t
Reassembling state.
Definition: lte-rlc-um.h:159
EventId m_reorderingTimer
reordering timer
Definition: lte-rlc-um.h:149
bool IsInsideReorderingWindow(SequenceNumber10 seqNumber)
Is inside reordering window function.
Definition: lte-rlc-um.cc:620
SequenceNumber10 m_sequenceNumber
State variables.
Definition: lte-rlc-um.h:134
bool m_enablePdcpDiscarding
whether to use the PDCP discarding (perform discarding at the moment of passing the PDCP SDU to RLC)
Definition: lte-rlc-um.h:151
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
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
Store an incoming (from layer above us) PDU, waiting to transmit it.
Definition: lte-rlc-um.h:107
TxPdu(const Ptr< Packet > &pdu, const Time &time)
TxPdu default constructor.
Definition: lte-rlc-um.h:113
Ptr< Packet > m_pdu
PDU.
Definition: lte-rlc-um.h:121
Time m_waitingSince
Layer arrival time.
Definition: lte-rlc-um.h:122