26 #include "ns3/llc-snap-header.h"
27 #include "ns3/simulator.h"
28 #include "ns3/callback.h"
30 #include "ns3/packet.h"
32 #include "ns3/packet-burst.h"
33 #include "ns3/uinteger.h"
34 #include "ns3/trace-source-accessor.h"
35 #include "ns3/pointer.h"
37 #include "ns3/lte-enb-net-device.h"
41 #include "ns3/ipv4-header.h"
46 #include <ns3/ipv4-l3-protocol.h>
49 #include <ns3/lte-ue-component-carrier-manager.h>
50 #include <ns3/object-map.h>
51 #include <ns3/object-factory.h>
64 TypeId (
"ns3::LteUeNetDevice")
66 .AddConstructor<LteUeNetDevice> ()
67 .AddAttribute (
"EpcUeNas",
68 "The NAS associated to this UeNetDevice",
71 MakePointerChecker <EpcUeNas> ())
72 .AddAttribute (
"LteUeRrc",
73 "The RRC associated to this UeNetDevice",
76 MakePointerChecker <LteUeRrc> ())
77 .AddAttribute (
"LteUeComponentCarrierManager",
78 "The ComponentCarrierManager associated to this UeNetDevice",
81 MakePointerChecker <LteUeComponentCarrierManager> ())
82 .AddAttribute (
"ComponentCarrierMapUe",
"List of all component Carrier.",
85 MakeObjectMapChecker<ComponentCarrierUe> ())
86 .AddAttribute (
"Imsi",
87 "International Mobile Subscriber Identity assigned to this UE",
90 MakeUintegerChecker<uint64_t> ())
91 .AddAttribute (
"DlEarfcn",
92 "Downlink E-UTRA Absolute Radio Frequency Channel Number (EARFCN) "
93 "as per 3GPP 36.101 Section 5.7.3. ",
97 MakeUintegerChecker<uint32_t> (0, 262143))
98 .AddAttribute (
"CsgId",
99 "The Closed Subscriber Group (CSG) identity that this UE is associated with, "
100 "i.e., giving the UE access to cells which belong to this particular CSG. "
101 "This restriction only applies to initial cell selection and EPC-enabled simulation. "
102 "This does not revoke the UE's access to non-CSG cells. ",
106 MakeUintegerChecker<uint32_t> ())
114 : m_isConstructed (false)
135 for (uint32_t i = 0; i <
m_ccMap.size (); i++)
171 return m_ccMap.at (0)->GetMac ();
187 return m_ccMap.at (0)->GetPhy ();
255 std::map < uint8_t, Ptr<ComponentCarrierUe> >
274 std::map< uint8_t, Ptr<ComponentCarrierUe> >::iterator it;
277 it->second->GetPhy ()->Initialize ();
278 it->second->GetMac ()->Initialize ();
280 m_rrc->Initialize ();
289 NS_LOG_INFO (
"unsupported protocol " << protocolNumber <<
", only IPv4 is supported");
292 return m_nas->Send (packet);
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Ptr< LteUeRrc > m_rrc
the RRC
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual ~LteUeNetDevice(void)
virtual void DoDispose(void)
Destructor implementation.
Ptr< LteUeRrc > GetRrc() const
Get the RRC.
uint64_t GetImsi() const
Get the IMSI.
std::map< uint8_t, Ptr< ComponentCarrierUe > > GetCcMap(void)
Get the ComponentCarrier Map for the UE.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< LteEnbNetDevice > m_targetEnb
target ENB
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t m_csgId
the CSG ID
std::map< uint8_t, Ptr< ComponentCarrierUe > > m_ccMap
CC map.
a polymophic address class
Ptr< EpcUeNas > m_nas
the NAS
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoDispose()
Destructor implementation.
Ptr< LteUeComponentCarrierManager > GetComponentCarrierManager(void) const
Get the componentn carrier manager.
void SetTargetEnb(Ptr< LteEnbNetDevice > enb)
Set the targer eNB where the UE is registered.
virtual void DoInitialize(void)
Initialize() implementation.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Hold an unsigned integer type.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetCsgId(uint32_t csgId)
Enlist the UE device as a member of a particular CSG.
uint32_t m_dlEarfcn
downlink carrier frequency
Hold objects of type Ptr.
void SetDlEarfcn(uint32_t earfcn)
Ptr< LteEnbNetDevice > GetTargetEnb(void)
Get the targer eNB where the UE is registered.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
Ptr< EpcUeNas > GetNas(void) const
Get the NAS.
uint32_t GetDlEarfcn() const
void SetCcMap(std::map< uint8_t, Ptr< ComponentCarrierUe > > ccm)
Set the ComponentCarrier Map for the UE.
void UpdateConfig()
Propagate attributes and configuration to sub-modules.
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Container for a set of ns3::Object pointers.
Ptr< LteUePhy > GetPhy(void) const
Get the Phy.
LteNetDevice provides basic implementation for all LTE network devices.
uint32_t GetCsgId() const
Returns the CSG ID the UE is currently a member of.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
Ptr< LteUeMac > GetMac(void) const
Get the MAC.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
bool m_isConstructed
is constructed?
static const uint16_t PROT_NUMBER
Protocol number (0x0800)
Ptr< LteUeComponentCarrierManager > m_componentCarrierManager
the component carrier manager