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
25namespace ns3 {
26
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
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
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
97void
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 }
116}
117
118bool
120{
121 return IsGbr (*m_requirements, qci);
122}
123
124uint8_t
126{
127 return GetPriority (*m_requirements, qci);
128}
129
130uint16_t
132{
134}
135
136double
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
List of Attribute name, value and checker triples used to construct Objects.
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:92
static BearerRequirementsMap * GetRequirementsRel15()
Retrieve requirements for Rel.
Definition: eps-bearer.cc:174
void SetRelease(uint8_t release)
SetRelease.
Definition: eps-bearer.cc:98
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
static BearerRequirementsMap * GetRequirementsRel11()
Retrieve requirements for Rel.
Definition: eps-bearer.cc:143
BearerRequirementsMap * m_requirements
Requirements pointer per bearer.
Definition: eps-bearer.h:324
uint8_t GetPriority() const
Definition: eps-bearer.cc:125
uint8_t GetRelease() const
GetRelease.
Definition: eps-bearer.h:184
static TypeId GetTypeId(void)
Get the type ID.
Definition: eps-bearer.cc:45
enum ns3::EpsBearer::Qci qci
Qos class indicator.
uint16_t GetPacketDelayBudgetMs() const
Definition: eps-bearer.cc:131
double GetPacketErrorLossRate() const
Definition: eps-bearer.cc:137
bool IsGbr() const
Definition: eps-bearer.cc:119
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition: eps-bearer.h:131
virtual TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: eps-bearer.cc:63
uint8_t m_release
Release (10 or 15)
Definition: eps-bearer.h:326
EpsBearer()
Default constructor.
Definition: eps-bearer.cc:68
Qci
QoS Class Indicator.
Definition: eps-bearer.h:107
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition: eps-bearer.h:108
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:120
@ DGBR_DISCRETE_AUT_LARGE
Delay-Critical GBR Discrete Automation Large Packets (TS 22.261)
Definition: eps-bearer.h:126
@ GBR_MC_PUSH_TO_TALK
GBR Mission Critical User Plane Push To Talk voice.
Definition: eps-bearer.h:112
@ GBR_NON_CONV_VIDEO
GBR Non-Conversational Video (Buffered Streaming)
Definition: eps-bearer.h:111
@ GBR_V2X
GBR V2X Messages.
Definition: eps-bearer.h:115
@ GBR_GAMING
GBR Real Time Gaming.
Definition: eps-bearer.h:110
@ GBR_MC_VIDEO
GBR Mission Critical Video User Plane.
Definition: eps-bearer.h:114
@ DGBR_ITS
Delay-Critical GBR Intelligent Transport Systems (TS 22.261)
Definition: eps-bearer.h:127
@ NGBR_V2X
Non-GBR V2X Messages.
Definition: eps-bearer.h:123
@ NGBR_LOW_LAT_EMBB
Non-GBR Low Latency eMBB applications.
Definition: eps-bearer.h:124
@ GBR_CONV_VIDEO
GBR Conversational Video (Live streaming)
Definition: eps-bearer.h:109
@ DGBR_DISCRETE_AUT_SMALL
Delay-Critical GBR Discrete Automation Small Packets (TS 22.261)
Definition: eps-bearer.h:125
@ DGBR_ELECTRICITY
Delay-Critical GBR Electricity Distribution High Voltage (TS 22.261)
Definition: eps-bearer.h:128
@ 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:122
@ NGBR_VIDEO_TCP_OPERATOR
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:117
@ NGBR_MC_DELAY_SIGNAL
Non-GBR Mission Critical Delay Sensitive Signalling (e.g., MC-PTT)
Definition: eps-bearer.h:121
@ NGBR_IMS
Non-GBR IMS Signalling.
Definition: eps-bearer.h:116
@ 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:113
Anchor the ns-3 type and attribute system.
Definition: object-base.h:167
void ConstructSelf(const AttributeConstructionList &attributes)
Complete construction of ObjectBase; invoked by derived classes.
Definition: object-base.cc:159
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
Hold an unsigned integer type.
Definition: uinteger.h:44
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:45
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
#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:37
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:29