21 #include <ns3/fatal-error.h>
23 #include <ns3/nstime.h>
24 #include <ns3/node-list.h>
26 #include <ns3/simulator.h>
45 : m_ueRrcSapProvider (0),
46 m_enbRrcSapProvider (0)
66 static TypeId tid =
TypeId (
"ns3::LteUeRrcProtocolIdeal")
68 .AddConstructor<LteUeRrcProtocolIdeal> ()
171 uint16_t cellId =
m_rrc->GetCellId ();
178 (i != listEnd) && (!found);
184 (j < nDevs) && (!found);
202 NS_ASSERT_MSG (found,
" Unable to find eNB with CellId =" << cellId);
212 : m_enbRrcSapProvider (0)
233 static TypeId tid =
TypeId (
"ns3::LteEnbRrcProtocolIdeal")
235 .AddConstructor<LteEnbRrcProtocolIdeal> ()
261 std::map<uint16_t, LteUeRrcSapProvider*>::const_iterator it;
270 std::map<uint16_t, LteUeRrcSapProvider*>::iterator it;
335 for (
int j = 0; j < nDevs; ++j)
341 NS_LOG_LOGIC (
"considering UE IMSI " << ueDev->GetImsi () <<
" that has cellId " << ueRrc->GetCellId ());
342 if (ueRrc->GetCellId () ==
m_cellId)
344 NS_LOG_LOGIC (
"sending SI to IMSI " << ueDev->GetImsi ());
345 ueRrc->GetLteUeRrcSapProvider ()->RecvSystemInformation (msg);
348 ueRrc->GetLteUeRrcSapProvider (),
437 virtual void Print (std::ostream &os)
const;
462 static TypeId tid =
TypeId (
"ns3::IdealHandoverPreparationInfoHeader")
464 .AddConstructor<IdealHandoverPreparationInfoHeader> ()
543 virtual void Print (std::ostream &os)
const;
568 static TypeId tid =
TypeId (
"ns3::IdealHandoverCommandHeader")
570 .AddConstructor<IdealHandoverCommandHeader> ()
625 std::map<uint32_t, LteRrcSap::RrcConnectionReconfiguration>::iterator it =
g_handoverCommandMsgMap.find (msgId);
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
LteUeRrcSapProvider * m_ueRrcSapProvider
void DoSendRrcConnectionReestablishmentReject(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentReject msg)
LteEnbRrcSapProvider * m_enbRrcSapProvider
Simulation virtual time values and global simulation resolution.
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 "...
virtual void RecvRrcConnectionSetupCompleted(uint16_t rnti, RrcConnectionSetupCompleted msg)=0
Receive an RRCConnectionSetupComplete message from a UE during an RRC connection establishment proced...
Part of the RRC protocol.
void DoSendRrcConnectionReconfigurationCompleted(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
void DoSendRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
static std::map< uint32_t, LteRrcSap::HandoverPreparationInfo > g_handoverPreparationInfoMsgMap
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
uint16_t GetCellId() const
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
void DoSendRrcConnectionReconfiguration(uint16_t rnti, LteRrcSap::RrcConnectionReconfiguration msg)
Part of the RRC protocol.
void DoSendRrcConnectionRelease(uint16_t rnti, LteRrcSap::RrcConnectionRelease msg)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual uint32_t GetSerializedSize(void) const
void SetUeRrc(Ptr< LteUeRrc > rrc)
void SetLteEnbRrcSapProvider(LteEnbRrcSapProvider *p)
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Template for the implementation of the LteEnbRrcSapUser as a member of an owner class of type C to wh...
LteEnbRrcSapUser * m_enbRrcSapUser
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
void DoSendRrcConnectionSetup(uint16_t rnti, LteRrcSap::RrcConnectionSetup msg)
void SetMsgId(uint32_t id)
static uint32_t g_handoverPreparationInfoMsgIdCounter
void SetLteUeRrcSapProvider(LteUeRrcSapProvider *p)
static TypeId GetTypeId(void)
virtual void RecvRrcConnectionRelease(RrcConnectionRelease msg)=0
Receive an RRCConnectionRelease message from the serving eNodeB during an RRC connection release proc...
iterator in a Buffer instance
void DoSetupUe(uint16_t rnti, LteEnbRrcSapUser::SetupUeParameters params)
virtual ~LteEnbRrcProtocolIdeal()
virtual void RecvRrcConnectionReestablishmentReject(RrcConnectionReestablishmentReject msg)=0
Receive an RRCConnectionReestablishmentReject message from the serving eNodeB during an RRC connectio...
virtual void RecvRrcConnectionReject(RrcConnectionReject msg)=0
Receive an RRCConnectionReject message from the serving eNodeB during an RRC connection establishment...
static const Time RRC_IDEAL_MSG_DELAY
void DoSendSystemInformation(LteRrcSap::SystemInformation msg)
virtual void Serialize(Buffer::Iterator start) const
Ptr< Packet > DoEncodeHandoverPreparationInformation(LteRrcSap::HandoverPreparationInfo msg)
void DoSendRrcConnectionSetupCompleted(LteRrcSap::RrcConnectionSetupCompleted msg)
static TypeId GetTypeId(void)
static Iterator End(void)
virtual void RecvRrcConnectionReconfiguration(RrcConnectionReconfiguration msg)=0
Receive an RRCConnectionReconfiguration message from the serving eNodeB during an RRC connection reco...
virtual void RecvRrcConnectionReestablishment(RrcConnectionReestablishment msg)=0
Receive an RRCConnectionReestablishment message from the serving eNodeB during an RRC connection re-e...
virtual void Print(std::ostream &os) const
Ptr< NetDevice > GetDevice(uint32_t index) const
void SetCellId(uint16_t cellId)
virtual uint32_t Deserialize(Buffer::Iterator start)
void DoSendRrcConnectionRequest(LteRrcSap::RrcConnectionRequest msg)
virtual void Print(std::ostream &os) const
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
std::map< uint16_t, LteUeRrcSapProvider * > m_enbRrcSapProviderMap
LteUeRrcSapUser * m_ueRrcSapUser
LteRrcSap::HandoverPreparationInfo DoDecodeHandoverPreparationInformation(Ptr< Packet > p)
Models the transmission of RRC messages from the UE to the eNB in an ideal fashion, without errors and without consuming any radio resources.
virtual void Serialize(Buffer::Iterator start) const
void SetEnbRrcSapProvider()
uint32_t GetNDevices(void) const
Part of the RRC protocol.
void SetMsgId(uint32_t id)
Ptr< LteEnbRrc > GetRrc() const
LteUeRrcSapUser * GetLteUeRrcSapUser()
virtual void RecvRrcConnectionSetup(RrcConnectionSetup msg)=0
Receive an RRCConnectionSetup message from the serving eNodeB during an RRC connection establishment ...
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
virtual void RecvRrcConnectionRequest(uint16_t rnti, RrcConnectionRequest msg)=0
Receive an RRCConnectionRequest message from a UE during an RRC connection establishment procedure (S...
static TypeId GetTypeId(void)
virtual void RecvSystemInformation(SystemInformation msg)=0
Receive a SystemInformation message from the serving eNodeB during a system information acquisition p...
LteUeRrcSapProvider * GetUeRrcSapProvider(uint16_t rnti)
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
LteRrcSap::RrcConnectionReconfiguration DoDecodeHandoverCommand(Ptr< Packet > p)
void DoSendRrcConnectionReject(uint16_t rnti, LteRrcSap::RrcConnectionReject msg)
static std::map< uint32_t, LteRrcSap::RrcConnectionReconfiguration > g_handoverCommandMsgMap
void DoSetup(LteUeRrcSapUser::SetupParameters params)
virtual void RecvRrcConnectionReestablishmentRequest(uint16_t rnti, RrcConnectionReestablishmentRequest msg)=0
Receive an RRCConnectionReestablishmentRequest message from a UE during an RRC connection re-establis...
void DoSendRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
static Iterator Begin(void)
void DoSendRrcConnectionReestablishment(uint16_t rnti, LteRrcSap::RrcConnectionReestablishment msg)
void SetUeRrcSapProvider(uint16_t rnti, LteUeRrcSapProvider *p)
virtual void RecvMeasurementReport(uint16_t rnti, MeasurementReport msg)=0
Receive a MeasurementReport message from a UE during a measurement reporting procedure (Section 5...
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
virtual uint32_t Deserialize(Buffer::Iterator start)
LteEnbRrcSapProvider * m_enbRrcSapProvider
static TypeId GetTypeId(void)
virtual TypeId GetInstanceTypeId(void) const
static uint32_t g_handoverCommandMsgIdCounter
virtual void RecvRrcConnectionReestablishmentComplete(uint16_t rnti, RrcConnectionReestablishmentComplete msg)=0
Receive an RRCConnectionReestablishmentComplete message from a UE during an RRC connection re-establi...
Template for the implementation of the LteUeRrcSapUser as a member of an owner class of type C to whi...
a base class which provides memory management and object aggregation
Ptr< Packet > DoEncodeHandoverCommand(LteRrcSap::RrcConnectionReconfiguration msg)
Part of the RRC protocol.
virtual TypeId GetInstanceTypeId(void) const
LteEnbRrcSapUser * GetLteEnbRrcSapUser()
void WriteU32(uint32_t data)
The eNodeB device implementation.
virtual void RecvRrcConnectionReconfigurationCompleted(uint16_t rnti, RrcConnectionReconfigurationCompleted msg)=0
Receive an RRCConnectionReconfigurationComplete message from a UE during an RRC connection reconfigur...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
virtual ~LteUeRrcProtocolIdeal()
void DoSendMeasurementReport(LteRrcSap::MeasurementReport msg)
void DoRemoveUe(uint16_t rnti)
void AddHeader(const Header &header)
Add header to this packet.
virtual uint32_t GetSerializedSize(void) const
Models the transmission of RRC messages from the UE to the eNB in an ideal fashion, without errors and without consuming any radio resources.
The LteUeNetDevice class implements the UE net device.