A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
lte-rlc-am-header.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_HEADER_H
10
#define LTE_RLC_AM_HEADER_H
11
12
#include "
lte-rlc-sequence-number.h
"
13
14
#include "ns3/header.h"
15
16
#include <list>
17
18
namespace
ns3
19
{
20
21
/**
22
* @ingroup lte
23
* @brief The packet header for the AM Radio Link Control (RLC) protocol packets
24
*
25
* This class has fields corresponding to those in an RLC header as well as
26
* methods for serialization to and deserialization from a byte buffer.
27
* It follows 3GPP TS 36.322 Radio Link Control (RLC) protocol specification.
28
*/
29
class
LteRlcAmHeader
:
public
Header
30
{
31
public
:
32
/**
33
* @brief Constructor
34
*
35
* Creates a null header
36
*/
37
LteRlcAmHeader
();
38
~LteRlcAmHeader
()
override
;
39
40
/// Set data PDU function
41
void
SetDataPdu
();
42
/**
43
* Set control PDU function
44
*
45
* @param controlPduType
46
*/
47
void
SetControlPdu
(uint8_t controlPduType);
48
/**
49
* Is data PDU function
50
* @returns true if data PDU
51
*/
52
bool
IsDataPdu
()
const
;
53
/**
54
* Is control PDU function
55
* @returns true if control PDU
56
*/
57
bool
IsControlPdu
()
const
;
58
59
/// DataControlPdu_t enumeration
60
enum
DataControlPdu_t
61
{
62
CONTROL_PDU
= 0,
63
DATA_PDU
= 1
64
};
65
66
/// Control PDU type status
67
static
constexpr
uint8_t
STATUS_PDU
{0};
68
69
//
70
// DATA PDU
71
//
72
73
/**
74
* Set sequence number
75
*
76
* @param sequenceNumber sequence number
77
*/
78
void
SetSequenceNumber
(
SequenceNumber10
sequenceNumber);
79
/**
80
* Get sequence number
81
*
82
* @returns sequence number
83
*/
84
SequenceNumber10
GetSequenceNumber
()
const
;
85
86
/**
87
* Set sequence number
88
*
89
* @param framingInfo framing info
90
*/
91
void
SetFramingInfo
(uint8_t framingInfo);
92
/**
93
* Get framing info
94
*
95
* @returns framing info
96
*/
97
uint8_t
GetFramingInfo
()
const
;
98
99
/// FramingInfoByte_t enumeration
100
enum
FramingInfoByte_t
101
{
102
FIRST_BYTE
= 0x00,
103
NO_FIRST_BYTE
= 0x02,
104
LAST_BYTE
= 0x00,
105
NO_LAST_BYTE
= 0x01
106
};
107
108
/**
109
* Push extension bit function
110
*
111
* @param extensionBit the extension bit
112
*/
113
void
PushExtensionBit
(uint8_t extensionBit);
114
/**
115
* Push length indicator function
116
*
117
* @param lengthIndicator the length indicator
118
*/
119
void
PushLengthIndicator
(uint16_t lengthIndicator);
120
121
/**
122
* Pop extension bit function
123
*
124
* @returns the extension bit
125
*/
126
uint8_t
PopExtensionBit
();
127
/**
128
* Pop length indicator function
129
*
130
* @returns the length indicator
131
*/
132
uint16_t
PopLengthIndicator
();
133
134
/// ExtensionBit_t typedef
135
enum
ExtensionBit_t
136
{
137
DATA_FIELD_FOLLOWS
= 0,
138
E_LI_FIELDS_FOLLOWS
= 1
139
};
140
141
/**
142
* Pop extension bit function
143
*
144
* @param resegFlag resegmentation flag
145
*/
146
void
SetResegmentationFlag
(uint8_t resegFlag);
147
/**
148
* Get resegmentation flag function
149
*
150
* @returns resegmentation flag
151
*/
152
uint8_t
GetResegmentationFlag
()
const
;
153
154
/// ResegmentationFlag_t typedef
155
enum
ResegmentationFlag_t
156
{
157
PDU
= 0,
158
SEGMENT
= 1
159
};
160
161
/**
162
* Set polling bit function
163
*
164
* @param pollingBit polling bit
165
*/
166
void
SetPollingBit
(uint8_t pollingBit);
167
/**
168
* Get polling bit function
169
*
170
* @returns polling bit
171
*/
172
uint8_t
GetPollingBit
()
const
;
173
174
/// PollingBit_t enumeration
175
enum
PollingBit_t
176
{
177
STATUS_REPORT_NOT_REQUESTED
= 0,
178
STATUS_REPORT_IS_REQUESTED
= 1
179
};
180
181
/**
182
* Set last segment flag function
183
*
184
* @param lsf last segment flag
185
*/
186
void
SetLastSegmentFlag
(uint8_t lsf);
187
/**
188
* Get last segment flag function
189
*
190
* @returns last segment flag
191
*/
192
uint8_t
GetLastSegmentFlag
()
const
;
193
194
/// LastSegmentFlag_t typedef
195
enum
LastSegmentFlag_t
196
{
197
NO_LAST_PDU_SEGMENT
= 0,
198
LAST_PDU_SEGMENT
= 1
199
};
200
201
/**
202
* Set segment offset function
203
*
204
* @param segmentOffset segment offset
205
*/
206
void
SetSegmentOffset
(uint16_t segmentOffset);
207
/**
208
* Get segment offset function
209
*
210
* @returns segment offset
211
*/
212
uint16_t
GetSegmentOffset
()
const
;
213
/**
214
* Get last offset function
215
*
216
* @returns last offset
217
*/
218
uint16_t
GetLastOffset
()
const
;
219
220
//
221
// CONTROL PDU
222
//
223
224
/**
225
* Set ack sn function
226
*
227
* @param ackSn ack sn
228
*/
229
void
SetAckSn
(
SequenceNumber10
ackSn);
230
/**
231
* Get ack sn function
232
*
233
* @returns sequence number
234
*/
235
SequenceNumber10
GetAckSn
()
const
;
236
237
/**
238
* @brief Get the type ID.
239
* @return the object TypeId
240
*/
241
static
TypeId
GetTypeId
();
242
TypeId
GetInstanceTypeId
()
const override
;
243
void
Print
(std::ostream& os)
const override
;
244
uint32_t
GetSerializedSize
()
const override
;
245
void
Serialize
(
Buffer::Iterator
start)
const override
;
246
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
247
248
/**
249
*
250
*
251
* @param bytes max allowed CONTROL PDU size
252
*
253
* @return true if one more NACK would fit in the CONTROL PDU; false otherwise
254
*/
255
bool
OneMoreNackWouldFitIn
(uint16_t bytes);
256
257
/**
258
* Add one more NACK to the CONTROL PDU
259
*
260
* @param nack
261
*/
262
void
PushNack
(
int
nack);
263
264
/**
265
*
266
*
267
* @param nack SN of the NACK
268
*
269
* @return true if the NACK is present in the STATUS PDU, false otherwise
270
*/
271
bool
IsNackPresent
(
SequenceNumber10
nack);
272
273
/**
274
* Retrieve one NACK from the CONTROL PDU
275
*
276
*
277
* @return the SN >= 0 of the next nack; returns -1 if no NACK is left
278
*/
279
int
PopNack
();
280
281
private
:
282
uint16_t
m_headerLength
;
///< header length
283
uint8_t
m_dataControlBit
;
///< data control bit
284
285
// Data PDU fields
286
uint8_t
m_resegmentationFlag
;
///< resegmentation flag
287
uint8_t
m_pollingBit
;
///< polling bit
288
uint8_t
m_framingInfo
;
///< 2 bits
289
SequenceNumber10
m_sequenceNumber
;
///< sequence number
290
uint8_t
m_lastSegmentFlag
;
///< last segment flag
291
uint16_t
m_segmentOffset
;
///< segment offset
292
uint16_t
m_lastOffset
;
///< last offset
293
294
std::list<uint8_t>
m_extensionBits
;
///< Includes extensionBit of the fixed part
295
std::list<uint16_t>
m_lengthIndicators
;
///< length indicators
296
297
// Control PDU fields
298
uint8_t
m_controlPduType
;
///< control PDU type
299
300
// Status PDU fields
301
SequenceNumber10
m_ackSn
;
///< ack sn
302
std::list<int>
m_nackSnList
;
///< nack sn list
303
304
std::list<uint8_t>
m_extensionBits1
;
///< Includes E1 after ACK_SN
305
std::list<uint8_t>
m_extensionBits2
;
///< extension bits 2
306
};
307
308
};
// namespace ns3
309
310
#endif
// LTE_RLC_AM_HEADER_H
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Header
Protocol header serialization and deserialization.
Definition
header.h:33
ns3::LteRlcAmHeader
The packet header for the AM Radio Link Control (RLC) protocol packets.
Definition
lte-rlc-am-header.h:30
ns3::LteRlcAmHeader::GetPollingBit
uint8_t GetPollingBit() const
Get polling bit function.
Definition
lte-rlc-am-header.cc:159
ns3::LteRlcAmHeader::LastSegmentFlag_t
LastSegmentFlag_t
LastSegmentFlag_t typedef.
Definition
lte-rlc-am-header.h:196
ns3::LteRlcAmHeader::LAST_PDU_SEGMENT
@ LAST_PDU_SEGMENT
Definition
lte-rlc-am-header.h:198
ns3::LteRlcAmHeader::NO_LAST_PDU_SEGMENT
@ NO_LAST_PDU_SEGMENT
Definition
lte-rlc-am-header.h:197
ns3::LteRlcAmHeader::PollingBit_t
PollingBit_t
PollingBit_t enumeration.
Definition
lte-rlc-am-header.h:176
ns3::LteRlcAmHeader::STATUS_REPORT_NOT_REQUESTED
@ STATUS_REPORT_NOT_REQUESTED
Definition
lte-rlc-am-header.h:177
ns3::LteRlcAmHeader::STATUS_REPORT_IS_REQUESTED
@ STATUS_REPORT_IS_REQUESTED
Definition
lte-rlc-am-header.h:178
ns3::LteRlcAmHeader::PopExtensionBit
uint8_t PopExtensionBit()
Pop extension bit function.
Definition
lte-rlc-am-header.cc:123
ns3::LteRlcAmHeader::SetSegmentOffset
void SetSegmentOffset(uint16_t segmentOffset)
Set segment offset function.
Definition
lte-rlc-am-header.cc:177
ns3::LteRlcAmHeader::PushExtensionBit
void PushExtensionBit(uint8_t extensionBit)
Push extension bit function.
Definition
lte-rlc-am-header.cc:100
ns3::LteRlcAmHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
lte-rlc-am-header.cc:472
ns3::LteRlcAmHeader::IsDataPdu
bool IsDataPdu() const
Is data PDU function.
Definition
lte-rlc-am-header.cc:64
ns3::LteRlcAmHeader::GetAckSn
SequenceNumber10 GetAckSn() const
Get ack sn function.
Definition
lte-rlc-am-header.cc:268
ns3::LteRlcAmHeader::SetPollingBit
void SetPollingBit(uint8_t pollingBit)
Set polling bit function.
Definition
lte-rlc-am-header.cc:153
ns3::LteRlcAmHeader::OneMoreNackWouldFitIn
bool OneMoreNackWouldFitIn(uint16_t bytes)
Definition
lte-rlc-am-header.cc:201
ns3::LteRlcAmHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
lte-rlc-am-header.cc:343
ns3::LteRlcAmHeader::m_headerLength
uint16_t m_headerLength
header length
Definition
lte-rlc-am-header.h:282
ns3::LteRlcAmHeader::SetLastSegmentFlag
void SetLastSegmentFlag(uint8_t lsf)
Set last segment flag function.
Definition
lte-rlc-am-header.cc:165
ns3::LteRlcAmHeader::Print
void Print(std::ostream &os) const override
Definition
lte-rlc-am-header.cc:290
ns3::LteRlcAmHeader::ExtensionBit_t
ExtensionBit_t
ExtensionBit_t typedef.
Definition
lte-rlc-am-header.h:136
ns3::LteRlcAmHeader::DATA_FIELD_FOLLOWS
@ DATA_FIELD_FOLLOWS
Definition
lte-rlc-am-header.h:137
ns3::LteRlcAmHeader::E_LI_FIELDS_FOLLOWS
@ E_LI_FIELDS_FOLLOWS
Definition
lte-rlc-am-header.h:138
ns3::LteRlcAmHeader::GetLastOffset
uint16_t GetLastOffset() const
Get last offset function.
Definition
lte-rlc-am-header.cc:189
ns3::LteRlcAmHeader::m_sequenceNumber
SequenceNumber10 m_sequenceNumber
sequence number
Definition
lte-rlc-am-header.h:289
ns3::LteRlcAmHeader::m_lastOffset
uint16_t m_lastOffset
last offset
Definition
lte-rlc-am-header.h:292
ns3::LteRlcAmHeader::LteRlcAmHeader
LteRlcAmHeader()
Constructor.
Definition
lte-rlc-am-header.cc:20
ns3::LteRlcAmHeader::PushNack
void PushNack(int nack)
Add one more NACK to the CONTROL PDU.
Definition
lte-rlc-am-header.cc:217
ns3::LteRlcAmHeader::m_dataControlBit
uint8_t m_dataControlBit
data control bit
Definition
lte-rlc-am-header.h:283
ns3::LteRlcAmHeader::m_extensionBits
std::list< uint8_t > m_extensionBits
Includes extensionBit of the fixed part.
Definition
lte-rlc-am-header.h:294
ns3::LteRlcAmHeader::SetFramingInfo
void SetFramingInfo(uint8_t framingInfo)
Set sequence number.
Definition
lte-rlc-am-header.cc:76
ns3::LteRlcAmHeader::STATUS_PDU
static constexpr uint8_t STATUS_PDU
Control PDU type status.
Definition
lte-rlc-am-header.h:67
ns3::LteRlcAmHeader::DataControlPdu_t
DataControlPdu_t
DataControlPdu_t enumeration.
Definition
lte-rlc-am-header.h:61
ns3::LteRlcAmHeader::DATA_PDU
@ DATA_PDU
Definition
lte-rlc-am-header.h:63
ns3::LteRlcAmHeader::CONTROL_PDU
@ CONTROL_PDU
Definition
lte-rlc-am-header.h:62
ns3::LteRlcAmHeader::GetLastSegmentFlag
uint8_t GetLastSegmentFlag() const
Get last segment flag function.
Definition
lte-rlc-am-header.cc:171
ns3::LteRlcAmHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
lte-rlc-am-header.cc:284
ns3::LteRlcAmHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
lte-rlc-am-header.cc:349
ns3::LteRlcAmHeader::FramingInfoByte_t
FramingInfoByte_t
FramingInfoByte_t enumeration.
Definition
lte-rlc-am-header.h:101
ns3::LteRlcAmHeader::NO_FIRST_BYTE
@ NO_FIRST_BYTE
Definition
lte-rlc-am-header.h:103
ns3::LteRlcAmHeader::FIRST_BYTE
@ FIRST_BYTE
Definition
lte-rlc-am-header.h:102
ns3::LteRlcAmHeader::NO_LAST_BYTE
@ NO_LAST_BYTE
Definition
lte-rlc-am-header.h:105
ns3::LteRlcAmHeader::LAST_BYTE
@ LAST_BYTE
Definition
lte-rlc-am-header.h:104
ns3::LteRlcAmHeader::m_ackSn
SequenceNumber10 m_ackSn
ack sn
Definition
lte-rlc-am-header.h:301
ns3::LteRlcAmHeader::PopLengthIndicator
uint16_t PopLengthIndicator()
Pop length indicator function.
Definition
lte-rlc-am-header.cc:132
ns3::LteRlcAmHeader::m_controlPduType
uint8_t m_controlPduType
control PDU type
Definition
lte-rlc-am-header.h:298
ns3::LteRlcAmHeader::ResegmentationFlag_t
ResegmentationFlag_t
ResegmentationFlag_t typedef.
Definition
lte-rlc-am-header.h:156
ns3::LteRlcAmHeader::PDU
@ PDU
Definition
lte-rlc-am-header.h:157
ns3::LteRlcAmHeader::SEGMENT
@ SEGMENT
Definition
lte-rlc-am-header.h:158
ns3::LteRlcAmHeader::m_segmentOffset
uint16_t m_segmentOffset
segment offset
Definition
lte-rlc-am-header.h:291
ns3::LteRlcAmHeader::m_extensionBits2
std::list< uint8_t > m_extensionBits2
extension bits 2
Definition
lte-rlc-am-header.h:305
ns3::LteRlcAmHeader::SetAckSn
void SetAckSn(SequenceNumber10 ackSn)
Set ack sn function.
Definition
lte-rlc-am-header.cc:195
ns3::LteRlcAmHeader::m_extensionBits1
std::list< uint8_t > m_extensionBits1
Includes E1 after ACK_SN.
Definition
lte-rlc-am-header.h:304
ns3::LteRlcAmHeader::IsControlPdu
bool IsControlPdu() const
Is control PDU function.
Definition
lte-rlc-am-header.cc:70
ns3::LteRlcAmHeader::SetDataPdu
void SetDataPdu()
Set data PDU function.
Definition
lte-rlc-am-header.cc:49
ns3::LteRlcAmHeader::m_framingInfo
uint8_t m_framingInfo
2 bits
Definition
lte-rlc-am-header.h:288
ns3::LteRlcAmHeader::m_resegmentationFlag
uint8_t m_resegmentationFlag
resegmentation flag
Definition
lte-rlc-am-header.h:286
ns3::LteRlcAmHeader::PushLengthIndicator
void PushLengthIndicator(uint16_t lengthIndicator)
Push length indicator function.
Definition
lte-rlc-am-header.cc:117
ns3::LteRlcAmHeader::GetResegmentationFlag
uint8_t GetResegmentationFlag() const
Get resegmentation flag function.
Definition
lte-rlc-am-header.cc:147
ns3::LteRlcAmHeader::SetResegmentationFlag
void SetResegmentationFlag(uint8_t resegFlag)
Pop extension bit function.
Definition
lte-rlc-am-header.cc:141
ns3::LteRlcAmHeader::GetSegmentOffset
uint16_t GetSegmentOffset() const
Get segment offset function.
Definition
lte-rlc-am-header.cc:183
ns3::LteRlcAmHeader::m_pollingBit
uint8_t m_pollingBit
polling bit
Definition
lte-rlc-am-header.h:287
ns3::LteRlcAmHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
lte-rlc-am-header.cc:274
ns3::LteRlcAmHeader::m_lastSegmentFlag
uint8_t m_lastSegmentFlag
last segment flag
Definition
lte-rlc-am-header.h:290
ns3::LteRlcAmHeader::IsNackPresent
bool IsNackPresent(SequenceNumber10 nack)
Definition
lte-rlc-am-header.cc:235
ns3::LteRlcAmHeader::m_nackSnList
std::list< int > m_nackSnList
nack sn list
Definition
lte-rlc-am-header.h:302
ns3::LteRlcAmHeader::GetFramingInfo
uint8_t GetFramingInfo() const
Get framing info.
Definition
lte-rlc-am-header.cc:88
ns3::LteRlcAmHeader::GetSequenceNumber
SequenceNumber10 GetSequenceNumber() const
Get sequence number.
Definition
lte-rlc-am-header.cc:94
ns3::LteRlcAmHeader::PopNack
int PopNack()
Retrieve one NACK from the CONTROL PDU.
Definition
lte-rlc-am-header.cc:251
ns3::LteRlcAmHeader::~LteRlcAmHeader
~LteRlcAmHeader() override
Definition
lte-rlc-am-header.cc:34
ns3::LteRlcAmHeader::SetControlPdu
void SetControlPdu(uint8_t controlPduType)
Set control PDU function.
Definition
lte-rlc-am-header.cc:56
ns3::LteRlcAmHeader::m_lengthIndicators
std::list< uint16_t > m_lengthIndicators
length indicators
Definition
lte-rlc-am-header.h:295
ns3::LteRlcAmHeader::SetSequenceNumber
void SetSequenceNumber(SequenceNumber10 sequenceNumber)
Set sequence number.
Definition
lte-rlc-am-header.cc:82
ns3::SequenceNumber10
SequenceNumber10 class.
Definition
lte-rlc-sequence-number.h:23
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
uint32_t
lte-rlc-sequence-number.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lte
model
lte-rlc-am-header.h
Generated on Fri Nov 8 2024 19:36:33 for ns-3 by
1.11.0