5G-LENA nr-v3.3-81-g75c7590d
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
cc-bwp-helper.h
1// Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef CC_BWP_HELPER_H
6#define CC_BWP_HELPER_H
7
8#include <ns3/propagation-loss-model.h>
9#include <ns3/ptr.h>
10#include <ns3/spectrum-channel.h>
11#include <ns3/spectrum-propagation-loss-model.h>
12
13#include <memory>
14#include <vector>
15
16namespace ns3
17{
18
19/*
20 * Upper limits of the number of component carriers used for Carrier
21 * Aggregation (CA). In NR, this number depends on the CC contiguousness.
22 * Eventually, the number of CCs may also depend on the operation frequency
23 */
24static const uint8_t MAX_CC_INTRA_BAND =
25 8;
26static const uint8_t MAX_CC_INTER_BAND =
27 16;
29
46{
47 uint8_t m_bwpId{0};
48 double m_centralFrequency{0.0};
49 double m_lowerFrequency{0.0};
50 double m_higherFrequency{0.0};
51 double m_channelBandwidth{0.0};
52
53 BandwidthPartInfo() = default;
54
59 void SetChannel(Ptr<SpectrumChannel> channel);
60
65 Ptr<SpectrumChannel> GetChannel() const;
66
67 private:
68 Ptr<SpectrumChannel>
69 m_channel;
70};
71
76typedef std::unique_ptr<BandwidthPartInfo> BandwidthPartInfoPtr;
81typedef std::unique_ptr<const BandwidthPartInfo> BandwidthPartInfoConstPtr;
86typedef std::vector<std::reference_wrapper<BandwidthPartInfoPtr>> BandwidthPartInfoPtrVector;
87
88std::ostream& operator<<(std::ostream& os, const BandwidthPartInfo& item);
89
95{
96 uint8_t m_ccId{0};
98 double m_lowerFrequency{0};
101
102 std::vector<BandwidthPartInfoPtr> m_bwp;
103
109 bool AddBwp(BandwidthPartInfoPtr&& bwp);
110};
111
116typedef std::unique_ptr<ComponentCarrierInfo> ComponentCarrierInfoPtr;
117
118std::ostream& operator<<(std::ostream& os, const ComponentCarrierInfo& item);
119
128{
129 uint8_t m_bandId{0};
130 double m_centralFrequency{0.0};
131 double m_lowerFrequency{0.0};
132 double m_higherFrequency{0.0};
134
135 std::vector<ComponentCarrierInfoPtr> m_cc;
136
144
151 BandwidthPartInfoPtr& GetBwpAt(uint32_t ccId, uint32_t bwpId) const;
152
158};
159
160std::ostream& operator<<(std::ostream& os, const OperationBandInfo& item);
161
172{
173 public:
187 {
194 SimpleOperationBandConf(double centralFreq = 28e9,
195 double channelBw = 400e6,
196 uint8_t numCc = 1)
197 : m_centralFrequency(centralFreq),
198 m_channelBandwidth(channelBw),
199 m_numCc(numCc)
200 {
201 }
202
203 double m_centralFrequency{28e9};
204 double m_channelBandwidth{400e6};
205 uint8_t m_numCc{1};
206 uint8_t m_numBwp{1};
207 };
208
218 OperationBandInfo CreateOperationBandContiguousCc(const SimpleOperationBandConf& conf);
219
226 const std::vector<SimpleOperationBandConf>& configuration);
227
235 const std::vector<std::reference_wrapper<OperationBandInfo>>& operationBands);
236
243 static void PlotNrCaBwpConfiguration(const std::vector<OperationBandInfo*>& bands,
244 const std::string& filename);
245
252 static void PlotLteCaConfiguration(const std::vector<OperationBandInfo*>& bands,
253 const std::string& filename);
254
255 private:
256 void InitializeCc(std::unique_ptr<ComponentCarrierInfo>& cc,
257 double ccBandwidth,
258 double lowerFreq,
259 uint8_t ccPosition,
260 uint8_t ccId) const;
261 void InitializeBwp(BandwidthPartInfoPtr& bwp,
262 double bwOfBwp,
263 double lowerFreq,
264 uint8_t bwpPosition,
265 uint8_t bwpId) const;
266 std::unique_ptr<ComponentCarrierInfo> CreateCc(double ccBandwidth,
267 double lowerFreq,
268 uint8_t ccPosition,
269 uint8_t ccId,
270 uint8_t bwpNumber);
282 static void PlotFrequencyBand(std::ofstream& outFile,
283 uint16_t index,
284 double xmin,
285 double xmax,
286 double ymin,
287 double ymax,
288 const std::string& label);
289
290 uint8_t m_operationBandCounter{0};
291 uint8_t m_componentCarrierCounter{0};
292 uint8_t m_bandwidthPartCounter{0};
293};
294
295} // namespace ns3
296
297#endif /* CC_BWP_HELPER_H */
Manages the correct creation of operation bands, component carriers and bandwidth parts.
OperationBandInfo CreateOperationBandContiguousCc(const SimpleOperationBandConf &conf)
Create an operation band with the CC specified.
static BandwidthPartInfoPtrVector GetAllBwps(const std::vector< std::reference_wrapper< OperationBandInfo > > &operationBands)
Get all the BWP pointers from the specified vector of operation bands.
static void PlotLteCaConfiguration(const std::vector< OperationBandInfo * > &bands, const std::string &filename)
Plots the CA/BWP configuration using GNUPLOT. There must be a valid configuration.
static void PlotNrCaBwpConfiguration(const std::vector< OperationBandInfo * > &bands, const std::string &filename)
Plots the CA/BWP configuration using GNUPLOT. There must be a valid configuration.
OperationBandInfo CreateOperationBandNonContiguousCc(const std::vector< SimpleOperationBandConf > &configuration)
Creates an operation band with non-contiguous CC.
std::unique_ptr< const BandwidthPartInfo > BandwidthPartInfoConstPtr
unique_ptr of a const BandwidthPartInfo
std::unique_ptr< BandwidthPartInfo > BandwidthPartInfoPtr
unique_ptr of BandwidthPartInfo
std::vector< std::reference_wrapper< BandwidthPartInfoPtr > > BandwidthPartInfoPtrVector
vector of unique_ptr of BandwidthPartInfo
static const uint8_t MAX_CC_INTRA_BAND
. 16, 8
std::unique_ptr< ComponentCarrierInfo > ComponentCarrierInfoPtr
unique_ptr of ComponentCarrierInfo
static const uint8_t MAX_CC_INTER_BAND
double m_centralFrequency
BWP central frequency.
double m_lowerFrequency
BWP lower frequency.
uint8_t m_bwpId
BWP id.
Ptr< SpectrumChannel > GetChannel() const
Get the spectrum channel associated with the BWP.
double m_channelBandwidth
BWP bandwidth.
void SetChannel(Ptr< SpectrumChannel > channel)
Set the spectrum channel for the BWP.
double m_higherFrequency
BWP higher frequency.
Minimum configuration requirements for a OperationBand.
uint8_t m_numCc
Number of CC in this OpBand.
uint8_t m_numBwp
Number of BWP per CC.
double m_channelBandwidth
Total Bandwidth of the operation band.
SimpleOperationBandConf(double centralFreq=28e9, double channelBw=400e6, uint8_t numCc=1)
Default constructor.
Component carrier configuration element.
double m_higherFrequency
BWP higher frequency.
bool AddBwp(BandwidthPartInfoPtr &&bwp)
Adds a bandwidth part configuration to the carrier.
double m_lowerFrequency
BWP lower frequency.
std::vector< BandwidthPartInfoPtr > m_bwp
Space for BWP.
double m_channelBandwidth
BWP bandwidth.
double m_centralFrequency
BWP central frequency.
Operation band information structure.
double m_channelBandwidth
Operation band bandwidth.
BandwidthPartInfoPtr & GetBwpAt(uint32_t ccId, uint32_t bwpId) const
Get the BWP at the cc/bwp specified.
std::vector< ComponentCarrierInfoPtr > m_cc
Operation band component carriers.
BandwidthPartInfoPtrVector GetBwps() const
Get the list of all the BWPs to pass to NrHelper.
bool AddCc(ComponentCarrierInfoPtr &&cc)
Adds the component carrier definition given as an input reference to the current operation band confi...
double m_lowerFrequency
Operation band lower frequency.
double m_centralFrequency
Operation band central frequency.
double m_higherFrequency
Operation band higher frequency.
uint8_t m_bandId
Operation band id.