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.203, Section 4.7.2 The EPS bearer
57 * 3GPP TS 23.203, 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 Map between QCI and requirements
236 *
237 * The tuple is formed by: resource type, priority, packet delay budget, packet error rate,
238 * default maximum data burst, default averaging window (0 when does not apply)
239 */
241 std::unordered_map<Qci, std::tuple<uint8_t, uint8_t, uint16_t, double, uint32_t, uint32_t>>;
242
243 /**
244 * \brief Get the resource type (NON-GBR, GBR, DC-GBR) of the selected QCI
245 * \param map Map between QCI and requirements
246 * \param qci QCI to look for
247 * \return the resource type (NON-GBR, GBR, DC-GBR) of the selected QCI
248 */
249 static uint8_t GetResourceType(const BearerRequirementsMap& map, Qci qci)
250 {
251 return std::get<0>(map.at(qci));
252 }
253
254 /**
255 * \brief Get priority for the selected QCI
256 * \param map Map between QCI and requirements
257 * \param qci QCI to look for
258 * \return priority for the selected QCI
259 */
260 static uint8_t GetPriority(const BearerRequirementsMap& map, Qci qci)
261 {
262 return std::get<1>(map.at(qci));
263 }
264
265 /**
266 * \brief Get packet delay in ms for the selected QCI
267 * \param map Map between QCI and requirements
268 * \param qci QCI to look for
269 * \return packet delay in ms for the selected QCI
270 */
272 {
273 return std::get<2>(map.at(qci));
274 }
275
276 /**
277 * \brief Get packet error rate for the selected QCI
278 * \param map Map between QCI and requirements
279 * \param qci QCI to look for
280 * \return packet error rate for the selected QCI
281 */
283 {
284 return std::get<3>(map.at(qci));
285 }
286
287 /**
288 * \brief Get maximum data burst for the selected QCI
289 * \param map Map between QCI and requirements
290 * \param qci QCI to look for
291 * \return maximum data burst for the selected QCI
292 */
294 {
295 return std::get<4>(map.at(qci));
296 }
297
298 /**
299 * \brief Get default averaging window for the selected QCI
300 * \param map Map between QCI and requirements
301 * \param qci QCI to look for
302 * \return default averaging window for the selected QCI
303 */
305 {
306 return std::get<5>(map.at(qci));
307 }
308
309 /**
310 * \brief Retrieve requirements for Rel. 11
311 * \return the BearerRequirementsMap for Release 11
312 *
313 * It returns a pointer to a non-const static data. That is not thread-safe,
314 * nor safe to do in general. However, a const-correct version would have
315 * to initialize two static maps, and then returning either one or the other.
316 * But that's a huge memory increase, and EpsBearer is used everywhere.
317 *
318 * To be revisited when GCC 4.9 will not be supported anymore.
319 */
321
322 /**
323 * \brief Retrieve requirements for Rel. 15
324 * \return the BearerRequirementsMap for Release 15
325 *
326 * It returns a pointer to a non-const static data. That is not thread-safe,
327 * nor safe to do in general. However, a const-correct version would have
328 * to initialize two static maps, and then returning either one or the other.
329 * But that's a huge memory increase, and EpsBearer is used everywhere.
330 *
331 * To be revisited when GCC 4.9 will not be supported anymore.
332 */
334
335 /**
336 * \brief Retrieve requirements for Rel. 18
337 * \return the BearerRequirementsMap for Release 18
338 */
340
341 /**
342 * \brief Requirements pointer per bearer
343 *
344 * It will point to a static map.
345 */
347
348 uint8_t m_release{30}; //!< Release (10 or 15 or 18)
349};
350
351} // namespace ns3
352
353#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:304
static double GetPacketErrorLossRate(const BearerRequirementsMap &map, Qci qci)
Get packet error rate for the selected QCI.
Definition eps-bearer.h:282
void SetRelease(uint8_t release)
SetRelease.
Definition eps-bearer.cc:90
BearerRequirementsMap m_requirements
Requirements pointer per bearer.
Definition eps-bearer.h:346
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:293
uint16_t GetPacketDelayBudgetMs() const
double GetPacketErrorLossRate() const
std::unordered_map< Qci, std::tuple< uint8_t, uint8_t, uint16_t, double, uint32_t, uint32_t > > BearerRequirementsMap
Map between QCI and requirements.
Definition eps-bearer.h:240
static uint8_t GetPriority(const BearerRequirementsMap &map, Qci qci)
Get priority for the selected QCI.
Definition eps-bearer.h:260
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:249
static uint16_t GetPacketDelayBudgetMs(const BearerRequirementsMap &map, Qci qci)
Get packet delay in ms for the selected QCI.
Definition eps-bearer.h:271
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition eps-bearer.h:142
~EpsBearer() override
Deconstructor.
Definition eps-bearer.h:175
uint8_t m_release
Release (10 or 15 or 18)
Definition eps-bearer.h:348
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:48
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
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