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