A Discrete-Event Network Simulator
API
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 <map>
29 
30 namespace ns3
31 {
32 
36 class LteRlcUm : public LteRlc
37 {
38  public:
39  LteRlcUm();
40  ~LteRlcUm() override;
45  static TypeId GetTypeId();
46  void DoDispose() override;
47 
53  void DoTransmitPdcpPdu(Ptr<Packet> p) override;
54 
61  void DoNotifyHarqDeliveryFailure() override;
62  void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams) override;
63 
64  private:
66  void ExpireReorderingTimer();
68  void ExpireRbsTimer();
69 
77 
86  void ReassembleSnInterval(SequenceNumber10 lowSeqNumber, SequenceNumber10 highSeqNumber);
87 
93  void ReassembleAndDeliver(Ptr<Packet> packet);
94 
96  void DoReportBufferStatus();
97 
98  private:
99  uint32_t m_maxTxBufferSize;
100  uint32_t m_txBufferSize;
101 
105  struct TxPdu
106  {
112  TxPdu(const Ptr<Packet>& pdu, const Time& time)
113  : m_pdu(pdu),
114  m_waitingSince(time)
115  {
116  }
117 
118  TxPdu() = delete;
119 
122  };
123 
124  std::vector<TxPdu> m_txBuffer;
125  std::map<uint16_t, Ptr<Packet>> m_rxBuffer;
126  std::vector<Ptr<Packet>> m_reasBuffer;
127 
128  std::list<Ptr<Packet>> m_sdusBuffer;
129 
134 
138 
142  uint16_t m_windowSize;
143 
152  uint32_t m_discardTimerMs{0};
153 
158  {
159  NONE = 0,
161  WAITING_SI_SF = 2
162  };
163 
166 
171 };
172 
173 } // namespace ns3
174 
175 #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:37
SequenceNumber10 m_vrUr
VR(UR)
Definition: lte-rlc-um.h:135
Ptr< Packet > m_keepS0
keep S0
Definition: lte-rlc-um.h:165
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:100
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:126
void DoDispose() override
Destructor implementation.
Definition: lte-rlc-um.cc:91
void ExpireReorderingTimer()
Expire reordering timer.
Definition: lte-rlc-um.cc:1203
std::vector< TxPdu > m_txBuffer
Transmission buffer.
Definition: lte-rlc-um.h:124
Time m_reorderingTimerValue
Timers.
Definition: lte-rlc-um.h:147
~LteRlcUm() override
Definition: lte-rlc-um.cc:50
SequenceNumber10 m_expectedSeqNumber
Expected Sequence Number.
Definition: lte-rlc-um.h:170
ReassemblingState_t m_reassemblingState
reassembling state
Definition: lte-rlc-um.h:164
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:149
void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters txOpParams) override
MAC SAP.
Definition: lte-rlc-um.cc:163
SequenceNumber10 m_vrUx
VR(UX)
Definition: lte-rlc-um.h:136
uint16_t m_windowSize
Constants.
Definition: lte-rlc-um.h:142
std::map< uint16_t, Ptr< Packet > > m_rxBuffer
Reception buffer.
Definition: lte-rlc-um.h:125
uint32_t m_discardTimerMs
the discard timer value in milliseconds
Definition: lte-rlc-um.h:152
void DoNotifyHarqDeliveryFailure() override
Notify HARQ delivery failure.
Definition: lte-rlc-um.cc:446
SequenceNumber10 m_vrUh
VR(UH)
Definition: lte-rlc-um.h:137
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:99
std::list< Ptr< Packet > > m_sdusBuffer
List of SDUs in a packet.
Definition: lte-rlc-um.h:128
ReassemblingState_t
Reassembling state.
Definition: lte-rlc-um.h:158
EventId m_reorderingTimer
reordering timer
Definition: lte-rlc-um.h:148
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:133
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:150
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:106
TxPdu(const Ptr< Packet > &pdu, const Time &time)
TxPdu default constructor.
Definition: lte-rlc-um.h:112
Ptr< Packet > m_pdu
PDU.
Definition: lte-rlc-um.h:120
Time m_waitingSince
Layer arrival time.
Definition: lte-rlc-um.h:121