A Discrete-Event Network Simulator
API
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 
28 namespace ns3
29 {
30 
36 {
41 
42  uint64_t gbrDl;
43  uint64_t gbrUl;
44  uint64_t mbrDl;
45  uint64_t mbrUl;
46 };
47 
53 {
58  uint8_t priorityLevel;
61 };
62 
90 class EpsBearer : public ObjectBase
91 {
92  public:
97  static TypeId GetTypeId();
98 
99  TypeId GetInstanceTypeId() const override;
100 
105  enum Qci : uint8_t
106  {
114  GBR_V2X = 75,
120  NGBR_IMS = 5,
122  6,
125  8,
127  9,
129  69,
131  NGBR_V2X = 79,
134  82,
136  83,
137  DGBR_ITS = 84,
139  85,
140  DGBR_V2X = 86,
142  87,
144  88,
146  89,
148  90,
149  };
150 
152 
155 
160  EpsBearer();
161 
167  EpsBearer(Qci x);
168 
176 
181  EpsBearer(const EpsBearer& o);
182 
186  ~EpsBearer() override
187  {
188  }
189 
202  void SetRelease(uint8_t release);
203 
208  uint8_t GetRelease() const
209  {
210  return m_release;
211  }
212 
217  uint8_t GetResourceType() const;
218 
224  uint8_t GetPriority() const;
225 
233  uint16_t GetPacketDelayBudgetMs() const;
234 
242  double GetPacketErrorLossRate() const;
243 
244  private:
251  struct QciHash
252  {
258  std::size_t operator()(const Qci& s) const noexcept
259  {
260  return std::hash<uint8_t>{}(s);
261  }
262  };
263 
270  typedef std::unordered_map<Qci,
271  std::tuple<uint8_t, uint8_t, uint16_t, double, uint32_t, uint32_t>,
272  QciHash>
274 
281  static uint8_t GetResourceType(const BearerRequirementsMap& map, Qci qci)
282  {
283  return std::get<0>(map.at(qci));
284  }
285 
292  static uint8_t GetPriority(const BearerRequirementsMap& map, Qci qci)
293  {
294  return std::get<1>(map.at(qci));
295  }
296 
304  {
305  return std::get<2>(map.at(qci));
306  }
307 
315  {
316  return std::get<3>(map.at(qci));
317  }
318 
325  static uint32_t GetMaxDataBurst(const BearerRequirementsMap& map, Qci qci)
326  {
327  return std::get<4>(map.at(qci));
328  }
329 
336  static uint32_t GetAvgWindow(const BearerRequirementsMap& map, Qci qci)
337  {
338  return std::get<5>(map.at(qci));
339  }
340 
353 
366 
372 
379 
380  uint8_t m_release{30};
381 };
382 
383 } // namespace ns3
384 
385 #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:336
static double GetPacketErrorLossRate(const BearerRequirementsMap &map, Qci qci)
Get packet error rate for the selected QCI.
Definition: eps-bearer.h:314
void SetRelease(uint8_t release)
SetRelease.
Definition: eps-bearer.cc:101
BearerRequirementsMap m_requirements
Requirements pointer per bearer.
Definition: eps-bearer.h:378
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:325
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:292
static const BearerRequirementsMap & GetRequirementsRel11()
Retrieve requirements for Rel.
Definition: eps-bearer.cc:150
Qci qci
Qos class indicator.
Definition: eps-bearer.h:151
std::unordered_map< Qci, std::tuple< uint8_t, uint8_t, uint16_t, double, uint32_t, uint32_t >, QciHash > BearerRequirementsMap
Map between QCI and requirements.
Definition: eps-bearer.h:273
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:281
static uint16_t GetPacketDelayBudgetMs(const BearerRequirementsMap &map, Qci qci)
Get packet delay in ms for the selected QCI.
Definition: eps-bearer.h:303
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:380
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
std::size_t operator()(const Qci &s) const noexcept
Hash the QCI like a normal uint8_t.
Definition: eps-bearer.h:258
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