36 #include <ns3/abort.h>
37 #include <ns3/callback.h>
39 #include <ns3/ipv4-l3-protocol.h>
40 #include <ns3/ipv6-l3-protocol.h>
41 #include <ns3/llc-snap-header.h>
44 #include <ns3/object-factory.h>
45 #include <ns3/object-map.h>
46 #include <ns3/packet-burst.h>
47 #include <ns3/packet.h>
48 #include <ns3/pointer.h>
49 #include <ns3/simulator.h>
50 #include <ns3/trace-source-accessor.h>
51 #include <ns3/uinteger.h>
64 TypeId(
"ns3::LteEnbNetDevice")
66 .AddConstructor<LteEnbNetDevice>()
67 .AddAttribute(
"LteEnbRrc",
68 "The RRC associated to this EnbNetDevice",
71 MakePointerChecker<LteEnbRrc>())
72 .AddAttribute(
"LteHandoverAlgorithm",
73 "The handover algorithm associated to this EnbNetDevice",
76 MakePointerChecker<LteHandoverAlgorithm>())
79 "The automatic neighbour relation function associated to this EnbNetDevice",
82 MakePointerChecker<LteAnr>())
83 .AddAttribute(
"LteFfrAlgorithm",
84 "The FFR algorithm associated to this EnbNetDevice",
87 MakePointerChecker<LteFfrAlgorithm>())
88 .AddAttribute(
"LteEnbComponentCarrierManager",
89 "The RRC associated to this EnbNetDevice",
92 MakePointerChecker<LteEnbComponentCarrierManager>())
93 .AddAttribute(
"ComponentCarrierMap",
94 "List of component carriers.",
97 MakeObjectMapChecker<ComponentCarrierEnb>())
100 "Uplink Transmission Bandwidth Configuration in number of Resource Blocks",
104 MakeUintegerChecker<uint8_t>())
107 "Downlink Transmission Bandwidth Configuration in number of Resource Blocks",
111 MakeUintegerChecker<uint8_t>())
112 .AddAttribute(
"CellId",
116 MakeUintegerChecker<uint16_t>())
117 .AddAttribute(
"DlEarfcn",
118 "Downlink E-UTRA Absolute Radio Frequency Channel Number (EARFCN) "
119 "as per 3GPP 36.101 Section 5.7.3.",
122 MakeUintegerChecker<uint32_t>(0, 262143))
123 .AddAttribute(
"UlEarfcn",
124 "Uplink E-UTRA Absolute Radio Frequency Channel Number (EARFCN) "
125 "as per 3GPP 36.101 Section 5.7.3.",
128 MakeUintegerChecker<uint32_t>(0, 262143))
131 "The Closed Subscriber Group (CSG) identity that this eNodeB belongs to",
134 MakeUintegerChecker<uint32_t>())
137 "If true, only UEs which are members of the CSG (i.e. same CSG ID) "
138 "can gain access to the eNodeB, therefore enforcing closed access mode. "
139 "Otherwise, the eNodeB operates as a non-CSG cell and implements open access mode.",
148 : m_isConstructed(false),
149 m_isConfigured(false),
151 m_componentCarrierManager(nullptr)
181 for (uint32_t i = 0; i <
m_ccMap.size(); i++)
205 return DynamicCast<ComponentCarrierEnb>(
m_ccMap.at(index))->GetMac();
211 return DynamicCast<ComponentCarrierEnb>(
m_ccMap.at(index))->GetPhy();
232 std::vector<uint16_t>
235 std::vector<uint16_t> cellIds;
237 cellIds.reserve(
m_ccMap.size());
240 cellIds.push_back(it.second->GetCellId());
248 return m_rrc->HasCellId(cellId);
359 std::map<uint8_t, Ptr<ComponentCarrierBaseStation>>
380 it->second->Initialize();
400 "unsupported protocol " << protocolNumber
401 <<
", only IPv4 and IPv6 are supported");
402 return m_rrc->SendData(packet);
a polymophic address class
static const uint16_t PROT_NUMBER
Protocol number (0x0800)
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
void SetUlEarfcn(uint32_t earfcn)
std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > GetCcMap() const
bool HasCellId(uint16_t cellId) const
void UpdateConfig()
Propagate attributes and configuration to sub-modules.
uint32_t m_dlEarfcn
DEPRECATE - It is maintained for backward compatibility after adding CA feature- downlink carrier fre...
void SetCsgId(uint32_t csgId)
Associate the eNodeB device with a particular CSG.
Ptr< LteHandoverAlgorithm > m_handoverAlgorithm
the handover algorithm
void SetDlEarfcn(uint32_t earfcn)
bool m_isConfigured
is configured?
bool GetCsgIndication() const
Returns the CSG indication flag of the eNodeB.
void SetUlBandwidth(uint16_t bw)
uint16_t m_dlBandwidth
DEPRECATE - It is maintained for backward compatibility after adding CA feature- downlink bandwidth i...
bool m_isConstructed
is constructed?
uint32_t GetCsgId() const
Returns the CSG ID of the eNodeB.
uint16_t GetDlBandwidth() const
uint32_t GetUlEarfcn() const
uint32_t GetDlEarfcn() const
Ptr< LteEnbRrc > GetRrc() const
void SetCsgIndication(bool csgIndication)
Enable or disable the CSG indication flag.
Ptr< LteEnbRrc > m_rrc
the RRC
void SetCcMap(std::map< uint8_t, Ptr< ComponentCarrierBaseStation >> ccm)
Set the ComponentCarrier Map of the Enb.
Ptr< LteEnbPhy > GetPhy() const
uint16_t m_cellId
Cell Identifier.
uint16_t GetUlBandwidth() const
void DoInitialize() override
Initialize() implementation.
std::vector< uint16_t > GetCellIds() const
Ptr< LteEnbComponentCarrierManager > GetComponentCarrierManager() const
bool m_csgIndication
CSG indication.
void SetDlBandwidth(uint16_t bw)
uint32_t m_ulEarfcn
DEPRECATE - It is maintained for backward compatibility after adding CA feature- uplink carrier frequ...
Ptr< LteFfrAlgorithm > m_ffrAlgorithm
DEPRECATED - It is maintained for backward compatibility after adding CA feature.
Ptr< LteEnbComponentCarrierManager > m_componentCarrierManager
the component carrier manager of this eNb
~LteEnbNetDevice() override
static TypeId GetTypeId()
Get the type ID.
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
Ptr< LteEnbMac > GetMac() const
std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > m_ccMap
ComponentCarrier map.
uint16_t GetCellId() const
uint16_t m_ulBandwidth
DEPRECATE - It is maintained for backward compatibility after adding CA feature- uplink bandwidth in ...
void DoDispose() override
Destructor implementation.
LteNetDevice provides basic implementation for all LTE network devices.
void DoDispose() override
Destructor implementation.
Hold objects of type Ptr<T>.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
ObjectPtrContainerValue ObjectMapValue
ObjectMapValue is an alias for ObjectPtrContainerValue.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.