A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
eps-bearer.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: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef EPS_BEARER
10#define EPS_BEARER
11
12#include "ns3/object-base.h"
13#include "ns3/uinteger.h"
14
15#include <unordered_map>
16
17namespace ns3
18{
19
20/**
21 * 3GPP TS 36.413 9.2.1.18 GBR QoS Information
22 *
23 */
25{
26 /**
27 * Default constructor, initializes member variables to zero or equivalent
28 */
30
31 uint64_t gbrDl; /**< Guaranteed Bit Rate (bit/s) in downlink */
32 uint64_t gbrUl; /**< Guaranteed Bit Rate (bit/s) in uplink */
33 uint64_t mbrDl; /**< Maximum Bit Rate (bit/s) in downlink */
34 uint64_t mbrUl; /**< Maximum Bit Rate (bit/s) in uplink */
35};
36
37/**
38 * 3GPP 23.203 Section 6.1.7.3 Allocation and Retention Priority characteristics
39 *
40 */
42{
43 /**
44 * Default constructor, initializes member variables to zero or equivalent
45 */
47 uint8_t priorityLevel; ///< 1-15; 1 = highest
48 bool preemptionCapability; ///< true if bearer can preempt others
49 bool preemptionVulnerability; ///< true if bearer can be preempted by others
50};
51
52/**
53 * @brief This class contains the specification of EPS Bearers.
54 *
55 * See the following references:
56 * 3GPP TS 23.401, Section 4.7.2 The EPS bearer
57 * 3GPP TS 23.401, Section 4.7.3 Bearer level QoS parameters
58 * 3GPP TS 36.413 Section 9.2.1.15 E-RAB Level QoS Parameters
59 *
60 * It supports the selection of different specifications depending on the
61 * release. To change the release, change the attribute "Release". Please remember
62 * that we must expose to all releases the most recent Qci. Asking for Qci parameters
63 * for a release in which it has not been created will result in a crash.
64 *
65 * For example, if you select Release 11 (or if you don't select anything, as
66 * it is the default selection) and then ask for the packet error rate of
67 * the NGBR_MC_DELAY_SIGNAL Qci, the program will crash.
68 *
69 * Please note that from Release 8 (the latest when the LENA project finished)
70 * to Release 11, the bearers ID and requirements are the same. From Release 12,
71 * they started to change, and the latest version is now Release 18. However,
72 * we do not support intermediate types between releases 11 and 15: in other words,
73 * you can select from Release 8 to Release 11, or Release 15 or 18.
74 * Any other value will result in a program crash.
75 *
76 * The release version only affect Bearer definitions. Other part of the LTE
77 * module are not affected when changing the Release attribute.
78 */
79class EpsBearer : public ObjectBase
80{
81 public:
82 /**
83 * @brief Get the type ID.
84 * @return the object TypeId
85 */
86 static TypeId GetTypeId();
87
88 TypeId GetInstanceTypeId() const override;
89
90 /**
91 * QoS Class Indicator. See 3GPP 23.203 Section 6.1.7.2 for standard values.
92 * Updated to Release 18.
93 */
94 enum Qci : uint8_t
95 {
96 GBR_CONV_VOICE = 1, ///< GBR Conversational Voice
97 GBR_CONV_VIDEO = 2, ///< GBR Conversational Video (Live streaming)
98 GBR_GAMING = 3, ///< GBR Real Time Gaming
99 GBR_NON_CONV_VIDEO = 4, ///< GBR Non-Conversational Video (Buffered Streaming)
100 GBR_MC_PUSH_TO_TALK = 65, ///< GBR Mission Critical User Plane Push To Talk voice
101 GBR_NMC_PUSH_TO_TALK = 66, ///< GBR Non-Mission-Critical User Plane Push To Talk voice
102 GBR_MC_VIDEO = 67, ///< GBR Mission Critical Video User Plane
103 GBR_V2X = 75, ///< GBR V2X Messages
104 GBR_LIVE_UL_71 = 71, ///< GBR Live UL streaming
105 GBR_LIVE_UL_72 = 72, ///< GBR Live UL streaming
106 GBR_LIVE_UL_73 = 73, ///< GBR Live UL streaming
107 GBR_LIVE_UL_74 = 74, ///< GBR Live UL streaming
108 GBR_LIVE_UL_76 = 76, ///< GBR Live UL streaming
109 NGBR_IMS = 5, ///< Non-GBR IMS Signalling
111 6, ///< Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
112 NGBR_VOICE_VIDEO_GAMING = 7, ///< Non-GBR Voice, Video, Interactive Streaming
114 8, ///< Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
116 9, ///< Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
118 69, ///< Non-GBR Mission Critical Delay Sensitive Signalling (e.g., MC-PTT)
119 NGBR_MC_DATA = 70, ///< Non-GBR Mission Critical Data
120 NGBR_V2X = 79, ///< Non-GBR V2X Messages
121 NGBR_LOW_LAT_EMBB = 80, ///< Non-GBR Low Latency eMBB applications
123 82, ///< Delay-Critical GBR Discrete Automation Small Packets (TS 22.261)
125 83, ///< Delay-Critical GBR Discrete Automation Large Packets (TS 22.261)
126 DGBR_ITS = 84, ///< Delay-Critical GBR Intelligent Transport Systems (TS 22.261)
128 85, ///< Delay-Critical GBR Electricity Distribution High Voltage (TS 22.261)
129 DGBR_V2X = 86, ///< Delay-Critical GBR V2X Messages (TS 23.501)
131 87, ///< Delay-Critical GBR Interactive Service - Motion tracking data (TS 23.501)
133 88, ///< Delay-Critical GBR Interactive Service - Motion tracking data (TS 23.501)
135 89, ///< Delay-Critical GBR Visual Content for cloud/edge/split rendering (TS 23.501)
137 90, ///< Delay-Critical GBR Visual Content for cloud/edge/split rendering (TS 23.501)
138 };
139
140 Qci qci; ///< Qos class indicator
141
142 GbrQosInformation gbrQosInfo; ///< GBR QOS information
143 AllocationRetentionPriority arp; ///< allocation retention priority
144
145 /**
146 * Default constructor. QCI will be initialized to NGBR_VIDEO_TCP_DEFAULT
147 *
148 */
149 EpsBearer();
150
151 /**
152 *
153 * @param x the QoS Class Indicator
154 *
155 */
156 EpsBearer(Qci x);
157
158 /**
159 *
160 * @param x the QoS Class Indicator
161 * @param y the GbrQosInformation
162 *
163 */
165
166 /**
167 * @brief EpsBearer copy constructor
168 * @param o other instance
169 */
170 EpsBearer(const EpsBearer& o);
171
172 /**
173 * @brief Deconstructor
174 */
175 ~EpsBearer() override
176 {
177 }
178
179 /**
180 * @brief SetRelease
181 * @param release The release the user want for this bearer
182 *
183 * Releases introduces new types, and change values for existing ones.
184 * While we can't do much for the added type (we must expose them even
185 * if the user want to work with older releases) by calling this method
186 * we can, at least, select the specific parameters value the bearer returns.
187 *
188 * For instance, if the user select release 10 (the default) the priority
189 * of CONV_VIDEO will be 2. With release 15, such priority will be 20.
190 */
191 void SetRelease(uint8_t release);
192
193 /**
194 * @brief GetRelease
195 * @return The release currently set for this bearer type
196 */
197 uint8_t GetRelease() const
198 {
199 return m_release;
200 }
201
202 /**
203 *
204 * @return the resource type (NON-GBR, GBR, DC-GBR) of the selected QCI
205 */
206 uint8_t GetResourceType() const;
207
208 /**
209 *
210 * @return the priority associated with the QCI of this bearer as per 3GPP 23.203
211 * Section 6.1.7.2
212 */
213 uint8_t GetPriority() const;
214
215 /**
216 *
217 *
218 *
219 * @return the packet delay budget associated with the QCI of this bearer as per 3GPP 23.203
220 * Section 6.1.7.2
221 */
222 uint16_t GetPacketDelayBudgetMs() const;
223
224 /**
225 *
226 *
227 *
228 * @return the packet error loss rate associated with the QCI of this bearer as per 3GPP 23.203
229 * Section 6.1.7.2
230 */
231 double GetPacketErrorLossRate() const;
232
233 private:
234 /**
235 * @brief Struct containing bearer requirements
236 */
238 {
239 uint8_t resourceType{0}; //!< resource type
240 uint8_t priority{0}; //!< priority
241 uint16_t packetDelayBudgetMs{0}; //!< packet delay budget in ms
242 double packetErrorLossRate{0.0}; //!< packet error rate
243 uint32_t maxDataBurst{0}; //!< default maximum data burst
244 uint32_t avgWindow{0}; //!< default averaging window (0 when does not apply)
245 };
246
247 /**
248 * @brief Map between QCI and requirements
249 */
250 using BearerRequirementsMap = std::unordered_map<Qci, BearerRequirements>;
251
252 /**
253 * @brief Get the resource type (NON-GBR, GBR, DC-GBR) of the selected QCI
254 * @param map Map between QCI and requirements
255 * @param qci QCI to look for
256 * @return the resource type (NON-GBR, GBR, DC-GBR) of the selected QCI
257 */
258 static uint8_t GetResourceType(const BearerRequirementsMap& map, Qci qci)
259 {
260 return map.at(qci).resourceType;
261 }
262
263 /**
264 * @brief Get priority for the selected QCI
265 * @param map Map between QCI and requirements
266 * @param qci QCI to look for
267 * @return priority for the selected QCI
268 */
269 static uint8_t GetPriority(const BearerRequirementsMap& map, Qci qci)
270 {
271 return map.at(qci).priority;
272 }
273
274 /**
275 * @brief Get packet delay in ms for the selected QCI
276 * @param map Map between QCI and requirements
277 * @param qci QCI to look for
278 * @return packet delay in ms for the selected QCI
279 */
281 {
282 return map.at(qci).packetDelayBudgetMs;
283 }
284
285 /**
286 * @brief Get packet error rate for the selected QCI
287 * @param map Map between QCI and requirements
288 * @param qci QCI to look for
289 * @return packet error rate for the selected QCI
290 */
292 {
293 return map.at(qci).packetErrorLossRate;
294 }
295
296 /**
297 * @brief Get maximum data burst for the selected QCI
298 * @param map Map between QCI and requirements
299 * @param qci QCI to look for
300 * @return maximum data burst for the selected QCI
301 */
303 {
304 return map.at(qci).maxDataBurst;
305 }
306
307 /**
308 * @brief Get default averaging window for the selected QCI
309 * @param map Map between QCI and requirements
310 * @param qci QCI to look for
311 * @return default averaging window for the selected QCI
312 */
314 {
315 return map.at(qci).avgWindow;
316 }
317
318 /**
319 * @brief Retrieve requirements for Rel. 11
320 * @return the BearerRequirementsMap for Release 11
321 */
323
324 /**
325 * @brief Retrieve requirements for Rel. 15
326 * @return the BearerRequirementsMap for Release 15
327 */
329
330 /**
331 * @brief Retrieve requirements for Rel. 18
332 * @return the BearerRequirementsMap for Release 18
333 */
335
336 BearerRequirementsMap m_requirements; //!< Map of requirements per bearer
337
338 uint8_t m_release{30}; //!< Release (8 to 11 or 15 or 18)
339};
340
341} // namespace ns3
342
343#endif // EPS_BEARER
This class contains the specification of EPS Bearers.
Definition eps-bearer.h:80
static uint32_t GetAvgWindow(const BearerRequirementsMap &map, Qci qci)
Get default averaging window for the selected QCI.
Definition eps-bearer.h:313
static double GetPacketErrorLossRate(const BearerRequirementsMap &map, Qci qci)
Get packet error rate for the selected QCI.
Definition eps-bearer.h:291
void SetRelease(uint8_t release)
SetRelease.
Definition eps-bearer.cc:90
BearerRequirementsMap m_requirements
Map of requirements per bearer.
Definition eps-bearer.h:336
AllocationRetentionPriority arp
allocation retention priority
Definition eps-bearer.h:143
static const BearerRequirementsMap & GetRequirementsRel15()
Retrieve requirements for Rel.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition eps-bearer.cc:54
static const BearerRequirementsMap & GetRequirementsRel18()
Retrieve requirements for Rel.
uint8_t GetPriority() const
uint8_t GetRelease() const
GetRelease.
Definition eps-bearer.h:197
uint8_t GetResourceType() const
static uint32_t GetMaxDataBurst(const BearerRequirementsMap &map, Qci qci)
Get maximum data burst for the selected QCI.
Definition eps-bearer.h:302
uint16_t GetPacketDelayBudgetMs() const
double GetPacketErrorLossRate() const
std::unordered_map< Qci, BearerRequirements > BearerRequirementsMap
Map between QCI and requirements.
Definition eps-bearer.h:250
static uint8_t GetPriority(const BearerRequirementsMap &map, Qci qci)
Get priority for the selected QCI.
Definition eps-bearer.h:269
static const BearerRequirementsMap & GetRequirementsRel11()
Retrieve requirements for Rel.
Qci qci
Qos class indicator.
Definition eps-bearer.h:140
static uint8_t GetResourceType(const BearerRequirementsMap &map, Qci qci)
Get the resource type (NON-GBR, GBR, DC-GBR) of the selected QCI.
Definition eps-bearer.h:258
static uint16_t GetPacketDelayBudgetMs(const BearerRequirementsMap &map, Qci qci)
Get packet delay in ms for the selected QCI.
Definition eps-bearer.h:280
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition eps-bearer.h:142
~EpsBearer() override
Deconstructor.
Definition eps-bearer.h:175
uint8_t m_release
Release (8 to 11 or 15 or 18)
Definition eps-bearer.h:338
static TypeId GetTypeId()
Get the type ID.
Definition eps-bearer.cc:35
EpsBearer()
Default constructor.
Definition eps-bearer.cc:59
Qci
QoS Class Indicator.
Definition eps-bearer.h:95
@ DGBR_VISUAL_CONTENT_90
Delay-Critical GBR Visual Content for cloud/edge/split rendering (TS 23.501)
Definition eps-bearer.h:136
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition eps-bearer.h:96
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition eps-bearer.h:115
@ DGBR_DISCRETE_AUT_LARGE
Delay-Critical GBR Discrete Automation Large Packets (TS 22.261)
Definition eps-bearer.h:124
@ GBR_MC_PUSH_TO_TALK
GBR Mission Critical User Plane Push To Talk voice.
Definition eps-bearer.h:100
@ GBR_NON_CONV_VIDEO
GBR Non-Conversational Video (Buffered Streaming)
Definition eps-bearer.h:99
@ GBR_V2X
GBR V2X Messages.
Definition eps-bearer.h:103
@ GBR_GAMING
GBR Real Time Gaming.
Definition eps-bearer.h:98
@ GBR_MC_VIDEO
GBR Mission Critical Video User Plane.
Definition eps-bearer.h:102
@ GBR_LIVE_UL_76
GBR Live UL streaming.
Definition eps-bearer.h:108
@ DGBR_ITS
Delay-Critical GBR Intelligent Transport Systems (TS 22.261)
Definition eps-bearer.h:126
@ NGBR_V2X
Non-GBR V2X Messages.
Definition eps-bearer.h:120
@ NGBR_LOW_LAT_EMBB
Non-GBR Low Latency eMBB applications.
Definition eps-bearer.h:121
@ GBR_CONV_VIDEO
GBR Conversational Video (Live streaming)
Definition eps-bearer.h:97
@ DGBR_DISCRETE_AUT_SMALL
Delay-Critical GBR Discrete Automation Small Packets (TS 22.261)
Definition eps-bearer.h:122
@ DGBR_ELECTRICITY
Delay-Critical GBR Electricity Distribution High Voltage (TS 22.261)
Definition eps-bearer.h:127
@ DGBR_INTER_SERV_88
Delay-Critical GBR Interactive Service - Motion tracking data (TS 23.501)
Definition eps-bearer.h:132
@ NGBR_VOICE_VIDEO_GAMING
Non-GBR Voice, Video, Interactive Streaming.
Definition eps-bearer.h:112
@ NGBR_MC_DATA
Non-GBR Mission Critical Data.
Definition eps-bearer.h:119
@ GBR_LIVE_UL_72
GBR Live UL streaming.
Definition eps-bearer.h:105
@ NGBR_VIDEO_TCP_OPERATOR
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition eps-bearer.h:110
@ NGBR_MC_DELAY_SIGNAL
Non-GBR Mission Critical Delay Sensitive Signalling (e.g., MC-PTT)
Definition eps-bearer.h:117
@ NGBR_IMS
Non-GBR IMS Signalling.
Definition eps-bearer.h:109
@ NGBR_VIDEO_TCP_PREMIUM
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition eps-bearer.h:113
@ GBR_LIVE_UL_73
GBR Live UL streaming.
Definition eps-bearer.h:106
@ DGBR_V2X
Delay-Critical GBR V2X Messages (TS 23.501)
Definition eps-bearer.h:129
@ DGBR_VISUAL_CONTENT_89
Delay-Critical GBR Visual Content for cloud/edge/split rendering (TS 23.501)
Definition eps-bearer.h:134
@ DGBR_INTER_SERV_87
Delay-Critical GBR Interactive Service - Motion tracking data (TS 23.501)
Definition eps-bearer.h:130
@ GBR_NMC_PUSH_TO_TALK
GBR Non-Mission-Critical User Plane Push To Talk voice.
Definition eps-bearer.h:101
@ GBR_LIVE_UL_74
GBR Live UL streaming.
Definition eps-bearer.h:107
@ GBR_LIVE_UL_71
GBR Live UL streaming.
Definition eps-bearer.h:104
Anchor the ns-3 type and attribute system.
a unique identifier for an interface.
Definition type-id.h:49
Every class exported by the ns3 library is enclosed in the ns3 namespace.
@ release
3GPP 23.203 Section 6.1.7.3 Allocation and Retention Priority characteristics
Definition eps-bearer.h:42
bool preemptionVulnerability
true if bearer can be preempted by others
Definition eps-bearer.h:49
bool preemptionCapability
true if bearer can preempt others
Definition eps-bearer.h:48
uint8_t priorityLevel
1-15; 1 = highest
Definition eps-bearer.h:47
AllocationRetentionPriority()
Default constructor, initializes member variables to zero or equivalent.
Definition eps-bearer.cc:27
Struct containing bearer requirements.
Definition eps-bearer.h:238
double packetErrorLossRate
packet error rate
Definition eps-bearer.h:242
uint32_t maxDataBurst
default maximum data burst
Definition eps-bearer.h:243
uint32_t avgWindow
default averaging window (0 when does not apply)
Definition eps-bearer.h:244
uint16_t packetDelayBudgetMs
packet delay budget in ms
Definition eps-bearer.h:241
uint8_t resourceType
resource type
Definition eps-bearer.h:239
3GPP TS 36.413 9.2.1.18 GBR QoS Information
Definition eps-bearer.h:25
uint64_t gbrDl
Guaranteed Bit Rate (bit/s) in downlink.
Definition eps-bearer.h:31
GbrQosInformation()
Default constructor, initializes member variables to zero or equivalent.
Definition eps-bearer.cc:19
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition eps-bearer.h:32
uint64_t mbrDl
Maximum Bit Rate (bit/s) in downlink.
Definition eps-bearer.h:33
uint64_t mbrUl
Maximum Bit Rate (bit/s) in uplink.
Definition eps-bearer.h:34