A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
component-carrier.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Danilo Abrignani
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Danilo Abrignani <danilo.abrignani@unibo.it>
18 */
19
20#ifndef COMPONENT_CARRIER_H
21#define COMPONENT_CARRIER_H
22
23#include <ns3/object.h>
24
25namespace ns3
26{
27
28/**
29 * \ingroup lte
30 *
31 * ComponentCarrier Object, it defines a single Carrier
32 * This is the parent class for both ComponentCarrierBaseStation
33 * and ComponentCarrierUe.
34 * This class contains the main physical configuration
35 * parameters for a carrier. Does not contain pointers to
36 * the MAC/PHY objects of the carrier.
37 */
39{
40 public:
41 /**
42 * \brief Get the type ID.
43 * \return the object TypeId
44 */
45 static TypeId GetTypeId();
46
48
49 ~ComponentCarrier() override;
50 void DoDispose() override;
51
52 /**
53 * \return the uplink bandwidth in RBs
54 */
55 uint16_t GetUlBandwidth() const;
56
57 /**
58 * \param bw the uplink bandwidth in RBs
59 */
60 virtual void SetUlBandwidth(uint16_t bw);
61
62 /**
63 * \return the downlink bandwidth in RBs
64 */
65 uint16_t GetDlBandwidth() const;
66
67 /**
68 * \param bw the downlink bandwidth in RBs
69 */
70 virtual void SetDlBandwidth(uint16_t bw);
71
72 /**
73 * \return the downlink carrier frequency (EARFCN)
74 */
75 uint32_t GetDlEarfcn() const;
76
77 /**
78 * \param earfcn the downlink carrier frequency (EARFCN)
79 */
80 void SetDlEarfcn(uint32_t earfcn);
81
82 /**
83 * \return the uplink carrier frequency (EARFCN)
84 */
85 uint32_t GetUlEarfcn() const;
86
87 /**
88 * \param earfcn the uplink carrier frequency (EARFCN)
89 */
90 void SetUlEarfcn(uint32_t earfcn);
91
92 /**
93 * \brief Returns the CSG ID of the eNodeB.
94 * \return the Closed Subscriber Group identity
95 * \sa LteEnbNetDevice::SetCsgId
96 */
97 uint32_t GetCsgId() const;
98
99 /**
100 * \brief Associate the eNodeB device with a particular CSG.
101 * \param csgId the intended Closed Subscriber Group identity
102 *
103 * CSG identity is a number identifying a Closed Subscriber Group which the
104 * cell belongs to. eNodeB is associated with a single CSG identity.
105 *
106 * The same CSG identity can also be associated to several UEs, which is
107 * equivalent as enlisting these UEs as the members of this particular CSG.
108 *
109 * \sa LteEnbNetDevice::SetCsgIndication
110 */
111 void SetCsgId(uint32_t csgId);
112
113 /**
114 * \brief Returns the CSG indication flag of the eNodeB.
115 * \return the CSG indication flag
116 * \sa LteEnbNetDevice::SetCsgIndication
117 */
118 bool GetCsgIndication() const;
119
120 /**
121 * \brief Enable or disable the CSG indication flag.
122 * \param csgIndication if TRUE, only CSG members are allowed to access this
123 * cell
124 *
125 * When the CSG indication field is set to TRUE, only UEs which are members of
126 * the CSG (i.e. same CSG ID) can gain access to the eNodeB, therefore
127 * enforcing closed access mode. Otherwise, the eNodeB operates as a non-CSG
128 * cell and implements open access mode.
129 *
130 * \note This restriction only applies to initial cell selection and
131 * EPC-enabled simulation.
132 *
133 * \sa LteEnbNetDevice::SetCsgIndication
134 */
135 void SetCsgIndication(bool csgIndication);
136
137 /**
138 * \brief Set as primary carrier
139 * \param primaryCarrier true to set as primary carrier
140 */
141 void SetAsPrimary(bool primaryCarrier);
142
143 /**
144 * \brief Checks if the carrier is the primary carrier
145 * \returns true if the carrier is primary
146 */
147 bool IsPrimary() const;
148
149 protected:
150 uint32_t m_csgId{0}; ///< CSG ID
151 bool m_csgIndication{false}; ///< CSG indication
152
153 bool m_primaryCarrier{false}; ///< whether the carrier is primary
154
155 uint16_t m_dlBandwidth{0}; ///< downlink bandwidth in RBs */
156 uint16_t m_ulBandwidth{0}; ///< uplink bandwidth in RBs */
157
158 uint32_t m_dlEarfcn{0}; ///< downlink carrier frequency */
159 uint32_t m_ulEarfcn{0}; ///< uplink carrier frequency */
160};
161
162/**
163 * \ingroup lte
164 *
165 * Defines a Base station, that is a ComponentCarrier but with a cell Id.
166 *
167 */
169{
170 public:
171 /**
172 * \brief Get the type ID.
173 * \return the object TypeId
174 */
175 static TypeId GetTypeId();
176
177 /**
178 * \brief Constructor
179 */
181
182 /**
183 * \brief ~ComponentCarrierBaseStation
184 */
186
187 /**
188 * Get cell identifier
189 * \return cell identifier
190 */
191 uint16_t GetCellId() const;
192
193 /**
194 * Set physical cell identifier
195 * \param cellId cell identifier
196 */
197 void SetCellId(uint16_t cellId);
198
199 protected:
200 uint16_t m_cellId{0}; ///< Cell identifier
201};
202
203} // namespace ns3
204
205#endif /* COMPONENT_CARRIER_H */
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:89
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.