A Discrete-Event Network Simulator
API
eps-bearer.cc
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 #include "eps-bearer.h"
22 #include <ns3/fatal-error.h>
23 #include <ns3/attribute-construction-list.h>
24 
25 namespace ns3 {
26 
27 NS_OBJECT_ENSURE_REGISTERED (EpsBearer);
28 
30  : gbrDl (0),
31  gbrUl (0),
32  mbrDl (0),
33  mbrUl (0)
34 {
35 }
36 
38  : priorityLevel (0),
39  preemptionCapability (false),
40  preemptionVulnerability (false)
41 {
42 }
43 
44 TypeId
46 {
47  static TypeId tid = TypeId ("ns3::EpsBearer")
49  .SetGroupName("Lte")
50  .AddConstructor<EpsBearer> ()
51  .AddAttribute ("Release", "Change from 11 to 15 if you need bearer definition as per Release 15."
52  " Reference document: TS 23.203. The change does not impact other LTE code than "
53  " bearers definition.",
54  UintegerValue (11),
57  MakeUintegerChecker<uint32_t> ())
58  ;
59  return tid;
60 }
61 
62 TypeId
64 {
65  return EpsBearer::GetTypeId ();
66 }
67 
69  : ObjectBase (),
70  qci (NGBR_VIDEO_TCP_DEFAULT)
71 {
72 
74 }
75 
77  : ObjectBase (),
78  qci (x)
79 {
81 }
82 
84  : ObjectBase (),
85  qci (x), gbrQosInfo (y)
86 {
88 }
89 
91 {
92  qci = o.qci;
95 }
96 
97 void
99 {
100  switch (release)
101  {
102  case 8:
103  case 9:
104  case 10:
105  case 11:
107  break;
108  case 15:
110  break;
111  default:
112  NS_FATAL_ERROR ("Not recognized release " << static_cast<uint32_t> (release) <<
113  " please use a value between 8 and 11, or 15");
114  }
115  m_release = release;
116 }
117 
118 bool
120 {
121  return IsGbr (*m_requirements, qci);
122 }
123 
124 uint8_t
126 {
127  return GetPriority (*m_requirements, qci);
128 }
129 
130 uint16_t
132 {
134 }
135 
136 double
138 {
140 }
141 
144 {
145  /* Needed to support GCC 4.9. Otherwise, use list constructors, for example:
146  * EpsBearer::BearerRequirementsMap
147  * EpsBearer::GetRequirementsRel15 ()
148  * {
149  * return
150  * {
151  * { GBR_CONV_VOICE , { true, 20, 100, 1.0e-2, 0, 2000} },
152  * ...
153  * };
154  * }
155  */
157 
158  if (ret.size () == 0)
159  {
160  ret.insert (std::make_pair (GBR_CONV_VOICE, std::make_tuple (true, 2, 100, 1.0e-2, 0, 0)));
161  ret.insert (std::make_pair (GBR_CONV_VIDEO, std::make_tuple (true, 4, 150, 1.0e-3, 0, 0)));
162  ret.insert (std::make_pair (GBR_GAMING, std::make_tuple (true, 3, 50, 1.0e-3, 0, 0)));
163  ret.insert (std::make_pair (GBR_NON_CONV_VIDEO, std::make_tuple (true, 5, 300, 1.0e-6, 0, 0)));
164  ret.insert (std::make_pair (NGBR_IMS, std::make_tuple (false, 1, 100, 1.0e-6, 0, 0)));
165  ret.insert (std::make_pair (NGBR_VIDEO_TCP_OPERATOR, std::make_tuple (false, 6, 300, 1.0e-6, 0, 0)));
166  ret.insert (std::make_pair (NGBR_VOICE_VIDEO_GAMING, std::make_tuple (false, 7, 100, 1.0e-3, 0, 0)));
167  ret.insert (std::make_pair (NGBR_VIDEO_TCP_PREMIUM, std::make_tuple (false, 8, 300, 1.0e-6, 0, 0)));
168  ret.insert (std::make_pair (NGBR_VIDEO_TCP_DEFAULT, std::make_tuple (false, 9, 300, 1.0e-6, 0, 0)));
169  }
170  return &ret;
171 }
172 
175 {
176  // Needed to support GCC 4.9. Otherwise, use list constructors (see GetRequirementsRel10)
178 
179  if (ret.size () == 0)
180  {
181  ret.insert (std::make_pair (GBR_CONV_VOICE, std::make_tuple (true, 20, 100, 1.0e-2, 0, 2000)));
182  ret.insert (std::make_pair (GBR_CONV_VIDEO, std::make_tuple (true, 40, 150, 1.0e-3, 0, 2000)));
183  ret.insert (std::make_pair (GBR_GAMING, std::make_tuple (true, 30, 50, 1.0e-3, 0, 2000)));
184  ret.insert (std::make_pair (GBR_NON_CONV_VIDEO, std::make_tuple (true, 50, 300, 1.0e-6, 0, 2000)));
185  ret.insert (std::make_pair (GBR_MC_PUSH_TO_TALK, std::make_tuple (true, 7, 75, 1.0e-2, 0, 2000)));
186  ret.insert (std::make_pair (GBR_NMC_PUSH_TO_TALK, std::make_tuple (true, 20, 100, 1.0e-2, 0, 2000)));
187  ret.insert (std::make_pair (GBR_MC_VIDEO, std::make_tuple (true, 15, 100, 1.0e-3, 0, 2000)));
188  ret.insert (std::make_pair (GBR_V2X, std::make_tuple (true, 25, 50, 1.0e-2, 0, 2000)));
189  ret.insert (std::make_pair (NGBR_IMS, std::make_tuple (false, 10, 100, 1.0e-6, 0, 0)));
190  ret.insert (std::make_pair (NGBR_VIDEO_TCP_OPERATOR, std::make_tuple (false, 60, 300, 1.0e-6, 0, 0)));
191  ret.insert (std::make_pair (NGBR_VOICE_VIDEO_GAMING, std::make_tuple (false, 70, 100, 1.0e-3, 0, 0)));
192  ret.insert (std::make_pair (NGBR_VIDEO_TCP_PREMIUM, std::make_tuple (false, 80, 300, 1.0e-6, 0, 0)));
193  ret.insert (std::make_pair (NGBR_VIDEO_TCP_DEFAULT, std::make_tuple (false, 90, 300, 1.0e-6, 0, 0)));
194  ret.insert (std::make_pair (NGBR_MC_DELAY_SIGNAL, std::make_tuple (false, 5, 60, 1.0e-6, 0, 0)));
195  ret.insert (std::make_pair (NGBR_MC_DATA, std::make_tuple (false, 55, 200, 1.0e-6, 0, 0)));
196  ret.insert (std::make_pair (NGBR_V2X, std::make_tuple (false, 65, 5, 1.0e-2, 0, 0)));
197  ret.insert (std::make_pair (NGBR_LOW_LAT_EMBB, std::make_tuple (false, 68, 10, 1.0e-6, 0, 0)));
198  ret.insert (std::make_pair (DGBR_DISCRETE_AUT_SMALL, std::make_tuple (false, 19, 10, 1.0e-4, 255, 2000)));
199  ret.insert (std::make_pair (DGBR_DISCRETE_AUT_LARGE, std::make_tuple (false, 22, 10, 1.0e-4, 1358, 2000)));
200  ret.insert (std::make_pair (DGBR_ITS, std::make_tuple (false, 24, 30, 1.0e-5, 1354, 2000)));
201  ret.insert (std::make_pair (DGBR_ELECTRICITY, std::make_tuple (false, 21, 5, 1.0e-5, 255, 2000)));
202  }
203  return &ret;
204 }
205 
206 } // namespace ns3
GBR Mission Critical Video User Plane.
Definition: eps-bearer.h:114
GBR Real Time Gaming.
Definition: eps-bearer.h:110
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
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
Non-GBR Mission Critical Delay Sensitive Signalling (e.g., MC-PTT)
Definition: eps-bearer.h:121
virtual TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: eps-bearer.cc:63
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
static BearerRequirementsMap * GetRequirementsRel11()
Retrieve requirements for Rel.
Definition: eps-bearer.cc:143
Anchor the ns-3 type and attribute system.
Definition: object-base.h:119
GBR Non-Mission-Critical User Plane Push To Talk voice.
Definition: eps-bearer.h:113
uint8_t GetPriority() const
Definition: eps-bearer.cc:125
Delay-Critical GBR Electricity Distribution High Voltage (TS 22.261)
Definition: eps-bearer.h:128
Non-GBR IMS Signalling.
Definition: eps-bearer.h:116
GBR Conversational Video (Live streaming)
Definition: eps-bearer.h:109
GBR Mission Critical User Plane Push To Talk voice.
Definition: eps-bearer.h:112
EpsBearer()
Default constructor.
Definition: eps-bearer.cc:68
Non-GBR V2X Messages.
Definition: eps-bearer.h:123
Hold an unsigned integer type.
Definition: uinteger.h:44
List of Attribute name, value and checker triples used to construct Objects.
void SetRelease(uint8_t release)
SetRelease.
Definition: eps-bearer.cc:98
GBR Non-Conversational Video (Buffered Streaming)
Definition: eps-bearer.h:111
Delay-Critical GBR Discrete Automation Large Packets (TS 22.261)
Definition: eps-bearer.h:126
GBR V2X Messages.
Definition: eps-bearer.h:115
AllocationRetentionPriority()
Default constructor, initializes member variables to zero or equivalent.
Definition: eps-bearer.cc:37
Delay-Critical GBR Discrete Automation Small Packets (TS 22.261)
Definition: eps-bearer.h:125
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Non-GBR Low Latency eMBB applications.
Definition: eps-bearer.h:124
uint16_t GetPacketDelayBudgetMs() const
Definition: eps-bearer.cc:131
void ConstructSelf(const AttributeConstructionList &attributes)
Complete construction of ObjectBase; invoked by derived classes.
Definition: object-base.cc:80
bool IsGbr() const
Definition: eps-bearer.cc:119
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
enum ns3::EpsBearer::Qci qci
Qos class indicator.
GbrQosInformation()
Default constructor, initializes member variables to zero or equivalent.
Definition: eps-bearer.cc:29
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:117
BearerRequirementsMap * m_requirements
Requirements pointer per bearer.
Definition: eps-bearer.h:324
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition: eps-bearer.h:131
Delay-Critical GBR Intelligent Transport Systems (TS 22.261)
Definition: eps-bearer.h:127
Non-GBR Mission Critical Data.
Definition: eps-bearer.h:122
static BearerRequirementsMap * GetRequirementsRel15()
Retrieve requirements for Rel.
Definition: eps-bearer.cc:174
GBR Conversational Voice.
Definition: eps-bearer.h:108
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:119
static TypeId GetTypeId(void)
Get the type ID.
Definition: eps-bearer.cc:45
Qci
QoS Class Indicator.
Definition: eps-bearer.h:106
Non-GBR Voice, Video, Interactive Streaming.
Definition: eps-bearer.h:118
3GPP TS 36.413 9.2.1.18 GBR QoS Information
Definition: eps-bearer.h:35
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:120
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: uinteger.h:45
a unique identifier for an interface.
Definition: type-id.h:58
uint8_t GetRelease() const
GetRelease.
Definition: eps-bearer.h:184
uint8_t m_release
Release (10 or 15)
Definition: eps-bearer.h:326
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
double GetPacketErrorLossRate() const
Definition: eps-bearer.cc:137