5G-LENA nr-v3.3-159-ga6832aa7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
bwp-manager-algorithm.cc
1// Copyright (c) 2018 Natale Patriciello <natale.patriciello@gmail.com>
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#include "bwp-manager-algorithm.h"
6
7#include "ns3/log.h"
8
9namespace ns3
10{
11
12NS_LOG_COMPONENT_DEFINE("BwpManagerAlgorithm");
13NS_OBJECT_ENSURE_REGISTERED(BwpManagerAlgorithm);
14
15TypeId
17{
18 static TypeId tid =
19 TypeId("ns3::BwpManagerAlgorithm").SetParent<ObjectBase>().SetGroupName("nr");
20 return tid;
21}
22
23NS_OBJECT_ENSURE_REGISTERED(BwpManagerAlgorithmStatic);
24
25#define DECLARE_ATTR(NAME, DESC, GETTER, SETTER) \
26 .AddAttribute(NAME, \
27 DESC, \
28 UintegerValue(0), \
29 MakeUintegerAccessor(&BwpManagerAlgorithmStatic::GETTER, \
30 &BwpManagerAlgorithmStatic::SETTER), \
31 MakeUintegerChecker<uint8_t>(0, 5))
32
33TypeId
35{
36 static TypeId tid =
37 TypeId("ns3::BwpManagerAlgorithmStatic")
38 .SetParent<BwpManagerAlgorithm>()
39 .SetGroupName("nr")
40 .AddConstructor<BwpManagerAlgorithmStatic>() DECLARE_ATTR(
41 "GBR_CONV_VOICE",
42 "BWP index to which flows of this Qci type should be forwarded.",
44 SetConvVoiceBwp) DECLARE_ATTR("GBR_CONV_VIDEO",
45 "BWP index to which flows of GBR_CONV_VIDEO Qci type "
46 "should be forwarded.",
48 SetConvVideoBwp) DECLARE_ATTR("GBR_GAMING",
49 "BWP index to which "
50 "flows of GBR_GAMING "
51 "Qci type should be "
52 "forwarded.",
55 DECLARE_ATTR(
56 "GBR_NON_CONV_VIDEO",
57 "BWP index to which flows of GBR_NON_CONV_VIDEO Qci "
58 "type should be forwarded.",
60 SetNonConvVideoBwp) DECLARE_ATTR("GBR_MC_PUSH_TO_TALK",
61 "BWP index to which flows of "
62 "GBR_MC_PUSH_TO_TALK Qci type should "
63 "be forwarded.",
65 SetMcPttBwp) DECLARE_ATTR("GBR_NMC_PUSH_TO_"
66 "TALK",
67 "BWP index to which "
68 "flows of "
69 "GBR_NMC_PUSH_TO_"
70 "TALK Qci type "
71 "should be "
72 "forwarded.",
75 DECLARE_ATTR(
76 "GBR_MC_VIDEO",
77 "BWP index to which flows of GBR_MC_VIDEO "
78 "Qci type should be forwarded.",
80 SetMcVideoBwp) DECLARE_ATTR("GBR_V2X",
81 "BWP index to which flows of GBR_V2X Qci type "
82 "should be forwarded.",
84 SetGbrV2xBwp) DECLARE_ATTR("NGBR_IMS",
85 "BWP index to which "
86 "flows of NGBR_IMS "
87 "Qci type should be "
88 "forwarded.",
91 DECLARE_ATTR("NGBR_VIDEO_TCP_OPERATOR",
92 "BWP index to which flows of NGBR_VIDEO_TCP_OPERATOR Qci type "
93 "should be forwarded.",
95 SetVideoTcpOpBwp) DECLARE_ATTR("NGBR_VOICE_VIDEO_GAMING",
96 "BWP index to which flows of "
97 "NGBR_VOICE_VIDEO_GAMING Qci "
98 "type should be forwarded.",
101 DECLARE_ATTR(
102 "NGBR_VIDEO_TCP_PREMIUM",
103 "BWP index to which flows of NGBR_VIDEO_TCP_PREMIUM Qci "
104 "type should be forwarded.",
106 SetVideoTcpPremiumBwp) DECLARE_ATTR("NGBR_VIDEO_TCP_DEFAULT",
107 "BWP index to which flows of "
108 "NGBR_VIDEO_TCP_DEFAULT "
109 "Qci type should be forwarded.",
112 DECLARE_ATTR(
113 "NGBR_MC_DELAY_SIGNAL",
114 "BWP index to which flows of NGBR_MC_DELAY_SIGNAL "
115 "Qci type should be forwarded.",
117 SetMcDelaySignalBwp) DECLARE_ATTR("NGBR_MC_DATA",
118 "BWP index to which flows of "
119 "NGBR_MC_DATA Qci "
120 "type should be forwarded.",
123 DECLARE_ATTR(
124 "NGBR_V2X",
125 "BWP index to which flows of NGBR_V2X "
126 "Qci type should be forwarded.",
128 SetNgbrV2xBwp) DECLARE_ATTR("NGBR_LOW_LAT_EMBB",
129 "BWP index to which flows of "
130 "NGBR_LOW_LAT_EMBB Qci type "
131 "should be forwarded.",
134 DECLARE_ATTR(
135 "DGBR_DISCRETE_AUT_SMALL",
136 "BWP index to which flows of DGBR_DISCRETE_AUT_SMALL "
137 "Qci "
138 "type should be forwarded.",
140 SetDiscreteAutSmallBwp) DECLARE_ATTR("DGBR_DISCRETE_"
141 "AUT_LARGE",
142 "BWP index to "
143 "which flows of "
144 "DGBR_DISCRETE_"
145 "AUT_LARGE Qci "
146 "type "
147 "should be "
148 "forwarded.",
151 DECLARE_ATTR(
152 "DGBR_ITS",
153 "BWP index to which flows of DGBR_ITS Qci type "
154 "should be "
155 "forwarded.",
156 GetItsBwp,
157 SetItsBwp) DECLARE_ATTR("DGBR_ELECTRICITY",
158 "BWP index to which flows "
159 "of DGBR_ELECTRICITY Qci "
160 "type should be forwarded.",
163 DECLARE_ATTR("GBR_LIVE_UL_71",
164 "BWP index to which flows of "
165 "GBR_LIVE_UL_71 Qci "
166 "type should be forwarded.",
169 DECLARE_ATTR("GBR_LIVE_UL_72",
170 "BWP index to which flows of "
171 "GBR_LIVE_UL_72 Qci "
172 "type should be forwarded.",
175 DECLARE_ATTR("GBR_LIVE_UL_73",
176 "BWP index to which flows of "
177 "GBR_LIVE_UL_73 Qci "
178 "type should be forwarded.",
181 DECLARE_ATTR(
182 "GBR_LIVE_UL_74",
183 "BWP index to which flows of "
184 "GBR_LIVE_UL_74 Qci "
185 "type should be forwarded.",
188 DECLARE_ATTR(
189 "GBR_LIVE_UL_76",
190 "BWP index to which flows of "
191 "GBR_LIVE_UL_76 Qci "
192 "type should be forwarded.",
195 DECLARE_ATTR(
196 "DGBR_INTER_SERV_87",
197 "BWP index to which flows "
198 "of DGBR_INTER_SERV_87 Qci "
199 "type should be forwarded.",
202 DECLARE_ATTR(
203 "DGBR_INTER_SERV_88",
204 "BWP index to which "
205 "flows of "
206 "DGBR_INTER_SERV_88 "
207 "Qci "
208 "type should be "
209 "forwarded.",
212 DECLARE_ATTR(
213 "DGBR_VISUAL_"
214 "CONTENT_89",
215 "BWP index to "
216 "which flows of "
217 "DGBR_VISUAL_"
218 "CONTENT_89 Qci "
219 "type should be "
220 "forwarded.",
223 DECLARE_ATTR(
224 "DGBR_VISUAL_"
225 "CONTENT_90",
226 "BWP index to "
227 "which flows "
228 "of "
229 "DGBR_VISUAL_"
230 "CONTENT_90 "
231 "Qci "
232 "type should "
233 "be forwarded.",
236 return tid;
237}
238
239uint8_t
241{
242 return m_qciToBwpMap.at(v == 0 ? 1 : v);
243}
244
245} // namespace ns3
Interface for a Bwp selection algorithm based on the bearer.
static TypeId GetTypeId()
GetTypeId.
The BwpManagerAlgorithmStatic class.
void SetLiveUlStream73Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetInterService88Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetNgbrV2xBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetNmcPttBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetMcPttBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetVideoTcpDefaultBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetGbrV2xBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetLiveUlStream72Bwp() const
Get the BWP index of the QCI in the function name.
void SetLiveUlStream72Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetVideoTcpPremiumBwp() const
Get the BWP index of the QCI in the function name.
void SetVisualContent90Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetVisualContent89Bwp() const
Get the BWP index of the QCI in the function name.
void SetImsBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetMcPttBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetLiveUlStream74Bwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetVideoGamingBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetNonConvVideoBwp() const
Get the BWP index of the QCI in the function name.
void SetLiveUlStream76Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetDiscreteAutSmallBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetImsBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetVideoTcpDefaultBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetNmcPttBwp() const
Get the BWP index of the QCI in the function name.
void SetLowLatEmbbBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetLiveUlStream71Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetLiveUlStream71Bwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetVideoTcpOpBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetLowLatEmbbBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetInterService87Bwp() const
Get the BWP index of the QCI in the function name.
void SetDiscreteAutLargeBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetNgbrV2xBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetItsBwp() const
Get the BWP index of the QCI in the function name.
void SetVideoTcpPremiumBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetInterService88Bwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetElectricityBwp() const
Get the BWP index of the QCI in the function name.
void SetMcDelaySignalBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetLiveUlStream73Bwp() const
Get the BWP index of the QCI in the function name.
void SetVisualContent89Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetLiveUlStream76Bwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetVisualContent90Bwp() const
Get the BWP index of the QCI in the function name.
void SetLiveUlStream74Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetInterService87Bwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetDiscreteAutLargeBwp() const
Get the BWP index of the QCI in the function name.
void SetElectricityBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetItsBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetMcDataBwp() const
Get the BWP index of the QCI in the function name.
void SetMcDataBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetConvVoiceBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetMcVideoBwp() const
Get the BWP index of the QCI in the function name.
static TypeId GetTypeId()
GetTypeId.
uint8_t GetConvVoiceBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetGbrV2xBwp() const
Get the BWP index of the QCI in the function name.
uint8_t GetConvVideoBwp() const
Get the BWP index of the QCI in the function name.
void SetMcVideoBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetGamingBwp() const
Get the BWP index of the QCI in the function name.
void SetVideoGamingBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetGamingBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetConvVideoBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetBwpForEpsBearer(const NrEpsBearer::Qci &v) const override
Get the bandwidth part id for the Qci specified.
void SetDiscreteAutSmallBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetNonConvVideoBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
void SetVideoTcpOpBwp(uint8_t bwpIndex)
Set BWP index of the QCI in the function name.
uint8_t GetMcDelaySignalBwp() const
Get the BWP index of the QCI in the function name.