5G-LENA nr-v3.3-159-ga6832aa7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-eps-bearer.cc
1// Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4//
5// Author: Nicola Baldo <nbaldo@cttc.es>
6
7#include "nr-eps-bearer.h"
8
9#include "ns3/attribute-construction-list.h"
10#include "ns3/fatal-error.h"
11
12namespace ns3
13{
14
15NS_OBJECT_ENSURE_REGISTERED(NrEpsBearer);
16
18 : gbrDl(0),
19 gbrUl(0),
20 mbrDl(0),
21 mbrUl(0)
22{
23}
24
26 : priorityLevel(0),
27 preemptionCapability(false),
28 preemptionVulnerability(false)
29{
30}
31
32TypeId
34{
35 static TypeId tid =
36 TypeId("ns3::NrEpsBearer")
37 .SetParent<ObjectBase>()
38 .SetGroupName("Nr")
39 .AddConstructor<NrEpsBearer>()
40 .AddAttribute(
41 "Release",
42 "Change from 11 to 18 if you need bearer definition as per newer Releases."
43 " Reference document: TS 23.203. The change does not impact other LTE code than "
44 " bearers definition.",
45 UintegerValue(11),
46 MakeUintegerAccessor(&NrEpsBearer::GetRelease, &NrEpsBearer::SetRelease),
47 MakeUintegerChecker<uint32_t>());
48 return tid;
49}
50
51TypeId
52NrEpsBearer::GetInstanceTypeId() const
53{
55}
56
58 : ObjectBase(),
59 qci(NGBR_VIDEO_TCP_DEFAULT)
60{
61 ObjectBase::ConstructSelf(AttributeConstructionList());
62}
63
65 : ObjectBase(),
66 qci(x)
67{
68 ObjectBase::ConstructSelf(AttributeConstructionList());
69}
70
72 : ObjectBase(),
73 qci(x),
74 gbrQosInfo(y)
75{
76 ObjectBase::ConstructSelf(AttributeConstructionList());
77}
78
80 : ObjectBase(o)
81{
82 qci = o.qci;
84 ObjectBase::ConstructSelf(AttributeConstructionList());
85}
86
87void
89{
90 switch (release)
91 {
92 case 8:
93 case 9:
94 case 10:
95 case 11:
96 m_requirements = GetRequirementsRel11();
97 break;
98 case 15:
99 m_requirements = GetRequirementsRel15();
100 break;
101 case 18:
102 m_requirements = GetRequirementsRel18();
103 break;
104 default:
105 NS_FATAL_ERROR("Not recognized release " << static_cast<uint32_t>(release)
106 << " please choose a value between"
107 " 8 and 11, or 15 or 18");
108 }
109 m_release = release;
110}
111
112uint8_t
114{
115 return GetResourceType(m_requirements, qci);
116}
117
118uint8_t
120{
121 return GetPriority(m_requirements, qci);
122}
123
124uint16_t
126{
127 return GetPacketDelayBudgetMs(m_requirements, qci);
128}
129
130double
132{
133 return GetPacketErrorLossRate(m_requirements, qci);
134}
135
136const NrEpsBearer::BearerRequirementsMap&
137NrEpsBearer::GetRequirementsRel11()
138{
139 /* Needed to support GCC 4.9. Otherwise, use list constructors, for example:
140 * NrEpsBearer::BearerRequirementsMap
141 * NrEpsBearer::GetRequirementsRel15 ()
142 * {
143 * return
144 * {
145 * { GBR_CONV_VOICE , { 1, 20, 100, 1.0e-2, 0, 2000} },
146 * ...
147 * };
148 * }
149 */
150 static NrEpsBearer::BearerRequirementsMap ret{
151 {GBR_CONV_VOICE, std::make_tuple(1, 2, 100, 1.0e-2, 0, 0)},
152 {GBR_CONV_VIDEO, std::make_tuple(1, 4, 150, 1.0e-3, 0, 0)},
153 {GBR_GAMING, std::make_tuple(1, 3, 50, 1.0e-3, 0, 0)},
154 {GBR_NON_CONV_VIDEO, std::make_tuple(1, 5, 300, 1.0e-6, 0, 0)},
155 {NGBR_IMS, std::make_tuple(0, 1, 100, 1.0e-6, 0, 0)},
156 {NGBR_VIDEO_TCP_OPERATOR, std::make_tuple(0, 6, 300, 1.0e-6, 0, 0)},
157 {NGBR_VOICE_VIDEO_GAMING, std::make_tuple(0, 7, 100, 1.0e-3, 0, 0)},
158 {NGBR_VIDEO_TCP_PREMIUM, std::make_tuple(0, 8, 300, 1.0e-6, 0, 0)},
159 {NGBR_VIDEO_TCP_DEFAULT, std::make_tuple(0, 9, 300, 1.0e-6, 0, 0)},
160 };
161 return ret;
162}
163
164const NrEpsBearer::BearerRequirementsMap&
165NrEpsBearer::GetRequirementsRel15()
166{
167 // Needed to support GCC 4.9. Otherwise, use list constructors (see GetRequirementsRel10)
168 static NrEpsBearer::BearerRequirementsMap ret{
169 {GBR_CONV_VOICE, std::make_tuple(1, 20, 100, 1.0e-2, 0, 2000)},
170 {GBR_CONV_VIDEO, std::make_tuple(1, 40, 150, 1.0e-3, 0, 2000)},
171 {GBR_GAMING, std::make_tuple(1, 30, 50, 1.0e-3, 0, 2000)},
172 {GBR_NON_CONV_VIDEO, std::make_tuple(1, 50, 300, 1.0e-6, 0, 2000)},
173 {GBR_MC_PUSH_TO_TALK, std::make_tuple(1, 7, 75, 1.0e-2, 0, 2000)},
174 {GBR_NMC_PUSH_TO_TALK, std::make_tuple(1, 20, 100, 1.0e-2, 0, 2000)},
175 {GBR_MC_VIDEO, std::make_tuple(1, 15, 100, 1.0e-3, 0, 2000)},
176 {GBR_V2X, std::make_tuple(1, 25, 50, 1.0e-2, 0, 2000)},
177 {NGBR_IMS, std::make_tuple(0, 10, 100, 1.0e-6, 0, 0)},
178 {NGBR_VIDEO_TCP_OPERATOR, std::make_tuple(0, 60, 300, 1.0e-6, 0, 0)},
179 {NGBR_VOICE_VIDEO_GAMING, std::make_tuple(0, 70, 100, 1.0e-3, 0, 0)},
180 {NGBR_VIDEO_TCP_PREMIUM, std::make_tuple(0, 80, 300, 1.0e-6, 0, 0)},
181 {NGBR_VIDEO_TCP_DEFAULT, std::make_tuple(0, 90, 300, 1.0e-6, 0, 0)},
182 {NGBR_MC_DELAY_SIGNAL, std::make_tuple(0, 5, 60, 1.0e-6, 0, 0)},
183 {NGBR_MC_DATA, std::make_tuple(0, 55, 200, 1.0e-6, 0, 0)},
184 {NGBR_V2X, std::make_tuple(0, 65, 5, 1.0e-2, 0, 0)},
185 {NGBR_LOW_LAT_EMBB, std::make_tuple(0, 68, 10, 1.0e-6, 0, 0)},
186 {DGBR_DISCRETE_AUT_SMALL, std::make_tuple(2, 19, 10, 1.0e-4, 255, 2000)},
187 {DGBR_DISCRETE_AUT_LARGE, std::make_tuple(2, 22, 10, 1.0e-4, 1358, 2000)},
188 {DGBR_ITS, std::make_tuple(2, 24, 30, 1.0e-5, 1354, 2000)},
189 {DGBR_ELECTRICITY, std::make_tuple(2, 21, 5, 1.0e-5, 255, 2000)},
190 };
191 return ret;
192}
193
194const NrEpsBearer::BearerRequirementsMap&
195NrEpsBearer::GetRequirementsRel18()
196{
197 // Needed to support GCC 4.9. Otherwise, use list constructors (see GetRequirementsRel10)
198 static NrEpsBearer::BearerRequirementsMap ret{
199 {GBR_CONV_VOICE, std::make_tuple(1, 20, 100, 1.0e-2, 0, 2000)},
200 {GBR_CONV_VIDEO, std::make_tuple(1, 40, 150, 1.0e-3, 0, 2000)},
201 {GBR_GAMING, std::make_tuple(1, 30, 50, 1.0e-3, 0, 2000)},
202 {GBR_NON_CONV_VIDEO, std::make_tuple(1, 50, 300, 1.0e-6, 0, 2000)},
203 {GBR_MC_PUSH_TO_TALK, std::make_tuple(1, 7, 75, 1.0e-2, 0, 2000)},
204 {GBR_NMC_PUSH_TO_TALK, std::make_tuple(1, 20, 100, 1.0e-2, 0, 2000)},
205 {GBR_MC_VIDEO, std::make_tuple(1, 15, 100, 1.0e-3, 0, 2000)},
206 {GBR_V2X, std::make_tuple(1, 25, 50, 1.0e-2, 0, 2000)},
207 {NGBR_IMS, std::make_tuple(0, 10, 100, 1.0e-6, 0, 0)},
208 {NGBR_VIDEO_TCP_OPERATOR, std::make_tuple(0, 60, 300, 1.0e-6, 0, 0)},
209 {NGBR_VOICE_VIDEO_GAMING, std::make_tuple(0, 70, 100, 1.0e-3, 0, 0)},
210 {NGBR_VIDEO_TCP_PREMIUM, std::make_tuple(0, 80, 300, 1.0e-6, 0, 0)},
211 {NGBR_VIDEO_TCP_DEFAULT, std::make_tuple(0, 90, 300, 1.0e-6, 0, 0)},
212 {NGBR_MC_DELAY_SIGNAL, std::make_tuple(0, 5, 60, 1.0e-6, 0, 0)},
213 {NGBR_MC_DATA, std::make_tuple(0, 55, 200, 1.0e-6, 0, 0)},
214 {NGBR_V2X, std::make_tuple(0, 65, 5, 1.0e-2, 0, 0)},
215 {NGBR_LOW_LAT_EMBB, std::make_tuple(0, 68, 10, 1.0e-6, 0, 0)},
216 {GBR_LIVE_UL_71, std::make_tuple(1, 56, 150, 1.0e-6, 0, 0)},
217 {GBR_LIVE_UL_72, std::make_tuple(1, 56, 300, 1.0e-4, 0, 0)},
218 {GBR_LIVE_UL_73, std::make_tuple(1, 56, 300, 1.0e-8, 0, 0)},
219 {GBR_LIVE_UL_74, std::make_tuple(1, 56, 500, 1.0e-8, 0, 0)},
220 {GBR_LIVE_UL_76, std::make_tuple(1, 56, 500, 1.0e-4, 0, 0)},
221 {DGBR_DISCRETE_AUT_SMALL, std::make_tuple(2, 19, 10, 1.0e-4, 255, 2000)},
222 {DGBR_DISCRETE_AUT_LARGE, std::make_tuple(2, 22, 10, 1.0e-4, 1358, 2000)},
223 {DGBR_ITS, std::make_tuple(2, 24, 30, 1.0e-5, 1354, 2000)},
224 {DGBR_ELECTRICITY, std::make_tuple(2, 21, 5, 1.0e-5, 255, 2000)},
225 {DGBR_V2X, std::make_tuple(2, 18, 5, 1.0e-4, 1354, 2000)},
226 {DGBR_INTER_SERV_87, std::make_tuple(2, 25, 5, 1.0e-3, 500, 2000)},
227 {DGBR_INTER_SERV_88, std::make_tuple(2, 25, 10, 1.0e-3, 1125, 2000)},
228 {DGBR_VISUAL_CONTENT_89, std::make_tuple(2, 25, 15, 1.0e-4, 17000, 2000)},
229 {DGBR_VISUAL_CONTENT_90, std::make_tuple(2, 25, 20, 1.0e-4, 63000, 2000)},
230 };
231 return ret;
232}
233
234} // namespace ns3
This class contains the specification of EPS Bearers.
uint16_t GetPacketDelayBudgetMs() const
uint8_t GetRelease() const
GetRelease.
Qci qci
Qos class indicator.
NrGbrQosInformation gbrQosInfo
GBR QOS information.
void SetRelease(uint8_t release)
SetRelease.
uint8_t GetPriority() const
uint8_t GetResourceType() const
double GetPacketErrorLossRate() const
@ NGBR_LOW_LAT_EMBB
Non-GBR Low Latency eMBB applications.
@ DGBR_VISUAL_CONTENT_89
Delay-Critical GBR Visual Content for cloud/edge/split rendering (TS 23.501)
@ GBR_V2X
GBR V2X Messages.
@ NGBR_V2X
Non-GBR V2X Messages.
@ GBR_NMC_PUSH_TO_TALK
GBR Non-Mission-Critical User Plane Push To Talk voice.
@ GBR_LIVE_UL_71
GBR Live UL streaming.
@ NGBR_MC_DELAY_SIGNAL
Non-GBR Mission Critical Delay Sensitive Signalling (e.g., MC-PTT)
@ DGBR_DISCRETE_AUT_SMALL
Delay-Critical GBR Discrete Automation Small Packets (TS 22.261)
@ GBR_CONV_VOICE
GBR Conversational Voice.
@ NGBR_VOICE_VIDEO_GAMING
Non-GBR Voice, Video, Interactive Streaming.
@ GBR_LIVE_UL_76
GBR Live UL streaming.
@ NGBR_VIDEO_TCP_OPERATOR
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
@ GBR_GAMING
GBR Real Time Gaming.
@ GBR_CONV_VIDEO
GBR Conversational Video (Live streaming)
@ GBR_LIVE_UL_72
GBR Live UL streaming.
@ DGBR_INTER_SERV_88
Delay-Critical GBR Interactive Service - Motion tracking data (TS 23.501)
@ DGBR_V2X
Delay-Critical GBR V2X Messages (TS 23.501)
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
@ DGBR_VISUAL_CONTENT_90
Delay-Critical GBR Visual Content for cloud/edge/split rendering (TS 23.501)
@ DGBR_ITS
Delay-Critical GBR Intelligent Transport Systems (TS 22.261)
@ NGBR_IMS
Non-GBR IMS Signalling.
@ NGBR_MC_DATA
Non-GBR Mission Critical Data.
@ GBR_MC_VIDEO
GBR Mission Critical Video User Plane.
@ DGBR_INTER_SERV_87
Delay-Critical GBR Interactive Service - Motion tracking data (TS 23.501)
@ NGBR_VIDEO_TCP_PREMIUM
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
@ GBR_LIVE_UL_74
GBR Live UL streaming.
@ GBR_LIVE_UL_73
GBR Live UL streaming.
@ DGBR_ELECTRICITY
Delay-Critical GBR Electricity Distribution High Voltage (TS 22.261)
@ DGBR_DISCRETE_AUT_LARGE
Delay-Critical GBR Discrete Automation Large Packets (TS 22.261)
@ GBR_MC_PUSH_TO_TALK
GBR Mission Critical User Plane Push To Talk voice.
@ GBR_NON_CONV_VIDEO
GBR Non-Conversational Video (Buffered Streaming)
static TypeId GetTypeId()
Get the type ID.