A Discrete-Event Network Simulator
API
eps-bearer.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 
22 #ifndef EPS_BEARER
23 #define EPS_BEARER
24 
25 #include <ns3/uinteger.h>
26 #include <ns3/object-base.h>
27 #include <unordered_map>
28 
29 namespace ns3 {
30 
36 {
41 
42  uint64_t gbrDl;
43  uint64_t gbrUl;
44  uint64_t mbrDl;
45  uint64_t mbrUl;
46 };
47 
48 
54 {
59  uint8_t priorityLevel;
62 };
63 
91 class EpsBearer : public ObjectBase
92 {
93 public:
98  static TypeId GetTypeId (void);
99 
100  virtual TypeId GetInstanceTypeId (void) const override;
101 
106  enum Qci : uint8_t
107  {
115  GBR_V2X = 75,
116  NGBR_IMS = 5,
123  NGBR_V2X = 79,
127  DGBR_ITS = 84,
129  } qci;
130 
133 
138  EpsBearer ();
139 
145  EpsBearer (Qci x);
146 
154 
159  EpsBearer (const EpsBearer &o);
160 
164  virtual ~EpsBearer () { }
165 
178  void SetRelease (uint8_t release);
179 
184  uint8_t GetRelease () const { return m_release; }
185 
190  bool IsGbr () const;
191 
196  uint8_t GetPriority () const;
197 
204  uint16_t GetPacketDelayBudgetMs () const;
205 
212  double GetPacketErrorLossRate () const;
213 
214 private:
221  struct QciHash
222  {
228  std::size_t
229  operator () (Qci const& s) const noexcept
230  {
231  return std::hash<uint8_t> {} (s);
232  }
233  };
234 
241  typedef std::unordered_map<Qci, std::tuple<bool, uint8_t, uint16_t, double, uint32_t, uint32_t>, QciHash > BearerRequirementsMap;
242 
249  static uint32_t
250  IsGbr (const BearerRequirementsMap &map, Qci qci) {return std::get<0> (map.at (qci));}
251 
258  static uint8_t
259  GetPriority (const BearerRequirementsMap &map, Qci qci) {return std::get<1> (map.at (qci));}
266  static uint16_t
267  GetPacketDelayBudgetMs (const BearerRequirementsMap &map, Qci qci) {return std::get<2> (map.at (qci));}
274  static double
275  GetPacketErrorLossRate (const BearerRequirementsMap &map, Qci qci) {return std::get<3> (map.at (qci));}
282  static uint32_t
283  GetMaxDataBurst (const BearerRequirementsMap &map, Qci qci) {return std::get<4> (map.at (qci));}
290  static uint32_t
291  GetAvgWindow (const BearerRequirementsMap &map, Qci qci) {return std::get<5> (map.at (qci));}
292 
305 
318 
325 
326  uint8_t m_release {30};
327 };
328 
329 } // namespace ns3
330 
331 
332 #endif // EPS_BEARER
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::AllocationRetentionPriority
3GPP 23.203 Section 6.1.7.3 Allocation and Retention Priority characteristics
Definition: eps-bearer.h:54
ns3::EpsBearer::GetRelease
uint8_t GetRelease() const
GetRelease.
Definition: eps-bearer.h:184
ns3::EpsBearer::arp
AllocationRetentionPriority arp
allocation retention priority
Definition: eps-bearer.h:132
ns3::EpsBearer::m_requirements
BearerRequirementsMap * m_requirements
Requirements pointer per bearer.
Definition: eps-bearer.h:324
ns3::GbrQosInformation::GbrQosInformation
GbrQosInformation()
Default constructor, initializes member variables to zero or equivalent.
Definition: eps-bearer.cc:29
ns3::EpsBearer::m_release
uint8_t m_release
Release (10 or 15)
Definition: eps-bearer.h:326
ns3::EpsBearer::GetPacketDelayBudgetMs
uint16_t GetPacketDelayBudgetMs() const
Definition: eps-bearer.cc:131
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::EpsBearer::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: eps-bearer.cc:45
ns3::EpsBearer::~EpsBearer
virtual ~EpsBearer()
Deconstructor.
Definition: eps-bearer.h:164
ns3::EpsBearer::NGBR_VIDEO_TCP_PREMIUM
@ NGBR_VIDEO_TCP_PREMIUM
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:119
ns3::EpsBearer::GBR_V2X
@ GBR_V2X
GBR V2X Messages.
Definition: eps-bearer.h:115
ns3::EpsBearer::DGBR_ELECTRICITY
@ DGBR_ELECTRICITY
Delay-Critical GBR Electricity Distribution High Voltage (TS 22.261)
Definition: eps-bearer.h:128
ns3::EpsBearer::NGBR_VIDEO_TCP_OPERATOR
@ NGBR_VIDEO_TCP_OPERATOR
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:117
ns3::GbrQosInformation::gbrDl
uint64_t gbrDl
Guaranteed Bit Rate (bit/s) in downlink.
Definition: eps-bearer.h:42
ns3::EpsBearer::Qci
Qci
QoS Class Indicator.
Definition: eps-bearer.h:107
ns3::EpsBearer::NGBR_IMS
@ NGBR_IMS
Non-GBR IMS Signalling.
Definition: eps-bearer.h:116
ns3::EpsBearer::DGBR_DISCRETE_AUT_SMALL
@ DGBR_DISCRETE_AUT_SMALL
Delay-Critical GBR Discrete Automation Small Packets (TS 22.261)
Definition: eps-bearer.h:125
ns3::EpsBearer::IsGbr
static uint32_t IsGbr(const BearerRequirementsMap &map, Qci qci)
Is the selected QCI GBR?
Definition: eps-bearer.h:250
ns3::EpsBearer::GetRequirementsRel11
static BearerRequirementsMap * GetRequirementsRel11()
Retrieve requirements for Rel.
Definition: eps-bearer.cc:143
ns3::EpsBearer::GBR_NMC_PUSH_TO_TALK
@ GBR_NMC_PUSH_TO_TALK
GBR Non-Mission-Critical User Plane Push To Talk voice.
Definition: eps-bearer.h:113
ns3::EpsBearer::NGBR_V2X
@ NGBR_V2X
Non-GBR V2X Messages.
Definition: eps-bearer.h:123
ns3::GbrQosInformation::mbrUl
uint64_t mbrUl
Maximum Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:45
ns3::AllocationRetentionPriority::preemptionVulnerability
bool preemptionVulnerability
true if bearer can be preempted by others
Definition: eps-bearer.h:61
ns3::AllocationRetentionPriority::preemptionCapability
bool preemptionCapability
true if bearer can preempt others
Definition: eps-bearer.h:60
ns3::EpsBearer::GBR_GAMING
@ GBR_GAMING
GBR Real Time Gaming.
Definition: eps-bearer.h:110
ns3::EpsBearer::DGBR_ITS
@ DGBR_ITS
Delay-Critical GBR Intelligent Transport Systems (TS 22.261)
Definition: eps-bearer.h:127
ns3::GbrQosInformation
3GPP TS 36.413 9.2.1.18 GBR QoS Information
Definition: eps-bearer.h:36
ns3::EpsBearer::GetPriority
uint8_t GetPriority() const
Definition: eps-bearer.cc:125
ns3::EpsBearer::DGBR_DISCRETE_AUT_LARGE
@ DGBR_DISCRETE_AUT_LARGE
Delay-Critical GBR Discrete Automation Large Packets (TS 22.261)
Definition: eps-bearer.h:126
ns3::EpsBearer::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: eps-bearer.cc:63
ns3::release
@ release
Definition: ff-mac-common.h:70
ns3::EpsBearer::NGBR_LOW_LAT_EMBB
@ NGBR_LOW_LAT_EMBB
Non-GBR Low Latency eMBB applications.
Definition: eps-bearer.h:124
ns3::EpsBearer::gbrQosInfo
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition: eps-bearer.h:131
ns3::EpsBearer::SetRelease
void SetRelease(uint8_t release)
SetRelease.
Definition: eps-bearer.cc:98
ns3::EpsBearer::GetMaxDataBurst
static uint32_t GetMaxDataBurst(const BearerRequirementsMap &map, Qci qci)
Get maximum data burst for the selected QCI.
Definition: eps-bearer.h:283
ns3::EpsBearer::NGBR_VOICE_VIDEO_GAMING
@ NGBR_VOICE_VIDEO_GAMING
Non-GBR Voice, Video, Interactive Streaming.
Definition: eps-bearer.h:118
ns3::EpsBearer::NGBR_MC_DATA
@ NGBR_MC_DATA
Non-GBR Mission Critical Data.
Definition: eps-bearer.h:122
ns3::GbrQosInformation::mbrDl
uint64_t mbrDl
Maximum Bit Rate (bit/s) in downlink.
Definition: eps-bearer.h:44
ns3::EpsBearer::GetRequirementsRel15
static BearerRequirementsMap * GetRequirementsRel15()
Retrieve requirements for Rel.
Definition: eps-bearer.cc:174
ns3::GbrQosInformation::gbrUl
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:43
ns3::EpsBearer
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:92
ns3::EpsBearer::QciHash::operator()
std::size_t operator()(Qci const &s) const noexcept
Hash the QCI like a normal uint8_t.
Definition: eps-bearer.h:229
ns3::EpsBearer::GetAvgWindow
static uint32_t GetAvgWindow(const BearerRequirementsMap &map, Qci qci)
Get default averaging window for the selected QCI.
Definition: eps-bearer.h:291
ns3::EpsBearer::GBR_MC_PUSH_TO_TALK
@ GBR_MC_PUSH_TO_TALK
GBR Mission Critical User Plane Push To Talk voice.
Definition: eps-bearer.h:112
ns3::EpsBearer::GBR_CONV_VOICE
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition: eps-bearer.h:108
ns3::EpsBearer::GetPacketErrorLossRate
static double GetPacketErrorLossRate(const BearerRequirementsMap &map, Qci qci)
Get packet error rate for the selected QCI.
Definition: eps-bearer.h:275
ns3::EpsBearer::GetPriority
static uint8_t GetPriority(const BearerRequirementsMap &map, Qci qci)
Get priority for the selected QCI.
Definition: eps-bearer.h:259
sample-rng-plot.x
list x
Definition: sample-rng-plot.py:34
ns3::EpsBearer::GetPacketDelayBudgetMs
static uint16_t GetPacketDelayBudgetMs(const BearerRequirementsMap &map, Qci qci)
Get packet delay in ms for the selected QCI.
Definition: eps-bearer.h:267
ns3::EpsBearer::NGBR_MC_DELAY_SIGNAL
@ NGBR_MC_DELAY_SIGNAL
Non-GBR Mission Critical Delay Sensitive Signalling (e.g., MC-PTT)
Definition: eps-bearer.h:121
ns3::EpsBearer::qci
enum ns3::EpsBearer::Qci qci
Qos class indicator.
ns3::EpsBearer::BearerRequirementsMap
std::unordered_map< Qci, std::tuple< bool, uint8_t, uint16_t, double, uint32_t, uint32_t >, QciHash > BearerRequirementsMap
Map between QCI and requirements.
Definition: eps-bearer.h:241
ns3::EpsBearer::NGBR_VIDEO_TCP_DEFAULT
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:120
ns3::EpsBearer::GBR_CONV_VIDEO
@ GBR_CONV_VIDEO
GBR Conversational Video (Live streaming)
Definition: eps-bearer.h:109
ns3::EpsBearer::GetPacketErrorLossRate
double GetPacketErrorLossRate() const
Definition: eps-bearer.cc:137
ns3::EpsBearer::EpsBearer
EpsBearer()
Default constructor.
Definition: eps-bearer.cc:68
ns3::EpsBearer::QciHash
Hashing QCI.
Definition: eps-bearer.h:222
ns3::EpsBearer::GBR_MC_VIDEO
@ GBR_MC_VIDEO
GBR Mission Critical Video User Plane.
Definition: eps-bearer.h:114
ns3::AllocationRetentionPriority::AllocationRetentionPriority
AllocationRetentionPriority()
Default constructor, initializes member variables to zero or equivalent.
Definition: eps-bearer.cc:37
ns3::ObjectBase
Anchor the ns-3 type and attribute system.
Definition: object-base.h:120
ns3::EpsBearer::IsGbr
bool IsGbr() const
Definition: eps-bearer.cc:119
ns3::AllocationRetentionPriority::priorityLevel
uint8_t priorityLevel
1-15; 1 = highest
Definition: eps-bearer.h:59
ns3::EpsBearer::GBR_NON_CONV_VIDEO
@ GBR_NON_CONV_VIDEO
GBR Non-Conversational Video (Buffered Streaming)
Definition: eps-bearer.h:111