A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
component-carrier.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Danilo Abrignani
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Danilo Abrignani <danilo.abrignani@unibo.it>
7 */
8
9#include "component-carrier.h"
10
11#include <ns3/abort.h>
12#include <ns3/boolean.h>
13#include <ns3/log.h>
14#include <ns3/uinteger.h>
15
16namespace ns3
17{
18
19NS_LOG_COMPONENT_DEFINE("ComponentCarrier");
20
21NS_OBJECT_ENSURE_REGISTERED(ComponentCarrier);
22
23TypeId
25{
26 static TypeId tid =
27 TypeId("ns3::ComponentCarrier")
29 .AddConstructor<ComponentCarrier>()
30 .AddAttribute(
31 "UlBandwidth",
32 "Uplink Transmission Bandwidth Configuration in number of Resource Blocks",
33 UintegerValue(25),
37 .AddAttribute(
38 "DlBandwidth",
39 "Downlink Transmission Bandwidth Configuration in number of Resource Blocks",
40 UintegerValue(25),
44 .AddAttribute("DlEarfcn",
45 "Downlink E-UTRA Absolute Radio Frequency Channel Number (EARFCN) "
46 "as per 3GPP 36.101 Section 5.7.3.",
47 UintegerValue(100),
51 .AddAttribute("UlEarfcn",
52 "Uplink E-UTRA Absolute Radio Frequency Channel Number (EARFCN) "
53 "as per 3GPP 36.101 Section 5.7.3.",
54 UintegerValue(18100),
57 MakeUintegerChecker<uint32_t>(18000, 262143))
58 .AddAttribute(
59 "CsgId",
60 "The Closed Subscriber Group (CSG) identity that this eNodeB belongs to",
64 .AddAttribute(
65 "CsgIndication",
66 "If true, only UEs which are members of the CSG (i.e. same CSG ID) "
67 "can gain access to the eNodeB, therefore enforcing closed access mode. "
68 "Otherwise, the eNodeB operates as a non-CSG cell and implements open access mode.",
69 BooleanValue(false),
73 .AddAttribute(
74 "PrimaryCarrier",
75 "If true, this Carrier Component will be the Primary Carrier Component (PCC) "
76 "Only one PCC per eNodeB is (currently) allowed",
77 BooleanValue(false),
80 return tid;
81}
82
88
93
94void
100
101uint16_t
106
107void
109{
110 NS_LOG_FUNCTION(this << bw);
111 switch (bw)
112 {
113 case 6:
114 case 15:
115 case 25:
116 case 50:
117 case 75:
118 case 100:
119 m_ulBandwidth = bw;
120 break;
121
122 default:
123 NS_FATAL_ERROR("Invalid bandwidth value " << bw);
124 break;
125 }
126}
127
128uint16_t
133
134void
136{
137 NS_LOG_FUNCTION(this << bw);
138 switch (bw)
139 {
140 case 6:
141 case 15:
142 case 25:
143 case 50:
144 case 75:
145 case 100:
146 m_dlBandwidth = bw;
147 break;
148
149 default:
150 NS_FATAL_ERROR("Invalid bandwidth value " << bw);
151 break;
152 }
153}
154
157{
158 return m_dlEarfcn;
159}
160
161void
163{
164 NS_LOG_FUNCTION(this << earfcn);
165 m_dlEarfcn = earfcn;
166}
167
170{
171 return m_ulEarfcn;
172}
173
174void
176{
177 NS_LOG_FUNCTION(this << earfcn);
178 m_ulEarfcn = earfcn;
179}
180
183{
184 return m_csgId;
185}
186
187void
189{
190 NS_LOG_FUNCTION(this << csgId);
191 m_csgId = csgId;
192}
193
194bool
199
200void
202{
203 NS_LOG_FUNCTION(this << csgIndication);
204 m_csgIndication = csgIndication;
205}
206
207bool
209{
210 return m_primaryCarrier;
211}
212
213void
215{
216 NS_LOG_FUNCTION(this << primaryCarrier);
217 m_primaryCarrier = primaryCarrier;
218}
219
220//====================================================
221
223
224TypeId
226{
227 static TypeId tid = TypeId("ns3::ComponentCarrierBaseStation")
229 .AddConstructor<ComponentCarrierBaseStation>();
230 return tid;
231}
232
238
243
244uint16_t
249
250void
252{
253 NS_LOG_FUNCTION(this << cellId);
254 m_cellId = cellId;
255}
256
257} // namespace ns3
Defines a Base station, that is a ComponentCarrier but with a cell Id.
~ComponentCarrierBaseStation() override
~ComponentCarrierBaseStation
uint16_t GetCellId() const
Get cell identifier.
static TypeId GetTypeId()
Get the type ID.
void SetCellId(uint16_t cellId)
Set physical cell identifier.
uint16_t m_cellId
Cell identifier.
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
void SetCsgIndication(bool csgIndication)
Enable or disable the CSG indication flag.
void SetDlEarfcn(uint32_t earfcn)
uint32_t GetDlEarfcn() const
uint16_t GetUlBandwidth() const
bool GetCsgIndication() const
Returns the CSG indication flag of the eNodeB.
uint16_t GetDlBandwidth() const
bool m_csgIndication
CSG indication.
void SetUlEarfcn(uint32_t earfcn)
uint32_t GetCsgId() const
Returns the CSG ID of the eNodeB.
void SetAsPrimary(bool primaryCarrier)
Set as primary carrier.
static TypeId GetTypeId()
Get the type ID.
uint16_t m_dlBandwidth
downlink bandwidth in RBs *‍/
void DoDispose() override
Destructor implementation.
void SetCsgId(uint32_t csgId)
Associate the eNodeB device with a particular CSG.
uint32_t m_ulEarfcn
uplink carrier frequency *‍/
uint32_t GetUlEarfcn() const
virtual void SetUlBandwidth(uint16_t bw)
bool m_primaryCarrier
whether the carrier is primary
bool IsPrimary() const
Checks if the carrier is the primary carrier.
uint16_t m_ulBandwidth
uplink bandwidth in RBs *‍/
uint32_t m_dlEarfcn
downlink carrier frequency *‍/
virtual void SetDlBandwidth(uint16_t bw)
A base class which provides memory management and object aggregation.
Definition object.h:78
virtual void DoDispose()
Destructor implementation.
Definition object.cc:433
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Hold an unsigned integer type.
Definition uinteger.h:34
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition uinteger.h:35
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition boolean.h:70