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