28#include <ns3/fatal-error.h>
30#include <ns3/node-list.h>
32#include <ns3/nstime.h>
33#include <ns3/simulator.h>
46 : m_ueRrcSapProvider(nullptr),
47 m_enbRrcSapProvider(nullptr)
121 packet->
AddHeader(rrcConnectionRequestHeader);
124 transmitPdcpPduParameters.
pdcpPdu = packet;
126 transmitPdcpPduParameters.
lcid = 0;
137 rrcConnectionSetupCompleteHeader.
SetMessage(msg);
139 packet->
AddHeader(rrcConnectionSetupCompleteHeader);
142 transmitPdcpSduParameters.
pdcpSdu = packet;
144 transmitPdcpSduParameters.
lcid = 1;
164 rrcConnectionReconfigurationCompleteHeader.
SetMessage(msg);
166 packet->
AddHeader(rrcConnectionReconfigurationCompleteHeader);
169 transmitPdcpSduParameters.
pdcpSdu = packet;
171 transmitPdcpSduParameters.
lcid = 1;
189 packet->
AddHeader(measurementReportHeader);
192 transmitPdcpSduParameters.
pdcpSdu = packet;
194 transmitPdcpSduParameters.
lcid = 1;
203 uint16_t cellId =
m_rrc->GetCellId();
209 NS_LOG_DEBUG(
"RNTI " << rnti <<
" sending UE context remove request to cell id " << cellId);
228 rrcConnectionReestablishmentRequestHeader.
SetMessage(msg);
230 packet->
AddHeader(rrcConnectionReestablishmentRequestHeader);
233 transmitPdcpPduParameters.
pdcpPdu = packet;
235 transmitPdcpPduParameters.
lcid = 0;
247 rrcConnectionReestablishmentCompleteHeader.
SetMessage(msg);
249 packet->
AddHeader(rrcConnectionReestablishmentCompleteHeader);
252 transmitPdcpSduParameters.
pdcpSdu = packet;
254 transmitPdcpSduParameters.
lcid = 1;
264 uint16_t cellId =
m_rrc->GetCellId();
276 for (
int j = 0; (j < nDevs) && (!found); j++)
293 NS_ASSERT_MSG(found,
" Unable to find eNB with CellId =" << cellId);
325 rrcConnectionReestablishmentMsg = rrcConnectionReestablishmentHeader.
GetMessage();
330 p->
RemoveHeader(rrcConnectionReestablishmentRejectHeader);
331 rrcConnectionReestablishmentRejectMsg =
332 rrcConnectionReestablishmentRejectHeader.
GetMessage();
339 rrcConnectionRejectMsg = rrcConnectionRejectHeader.
GetMessage();
345 rrcConnectionSetupMsg = rrcConnectionSetupHeader.
GetMessage();
371 rrcConnectionReconfigurationMsg = rrcConnectionReconfigurationHeader.
GetMessage();
376 rrcConnectionReleaseMsg = rrcConnectionReleaseHeader.
GetMessage();
385 : m_enbRrcSapProvider(nullptr)
401 for (std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator it =
406 delete it->second.srb0SapUser;
407 delete it->second.srb1SapUser;
415 static TypeId tid =
TypeId(
"ns3::LteEnbRrcProtocolReal")
443 std::map<uint16_t, LteUeRrcSapProvider*>::const_iterator it;
452 std::map<uint16_t, LteUeRrcSapProvider*>::iterator it;
504 std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator csupIt =
512 completeSetupUeParameters.
srb0SapUser = srb0SapUser;
513 completeSetupUeParameters.
srb1SapUser = srb1SapUser;
519 completeSetupUeParameters = csupIt->second;
528 std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator it =
531 delete it->second.srb0SapUser;
532 delete it->second.srb1SapUser;
548 for (
int j = 0; j < nDevs; ++j)
554 NS_LOG_LOGIC(
"considering UE IMSI " << ueDev->GetImsi() <<
" that has cellId "
555 << ueRrc->GetCellId());
556 if (ueRrc->GetCellId() == cellId)
558 NS_LOG_LOGIC(
"sending SI to IMSI " << ueDev->GetImsi());
563 ueRrc->GetLteUeRrcSapProvider(),
579 packet->
AddHeader(rrcConnectionSetupHeader);
582 transmitPdcpPduParameters.
pdcpPdu = packet;
583 transmitPdcpPduParameters.
rnti = rnti;
584 transmitPdcpPduParameters.
lcid = 0;
597 packet->
AddHeader(rrcConnectionRejectHeader);
600 transmitPdcpPduParameters.
pdcpPdu = packet;
601 transmitPdcpPduParameters.
rnti = rnti;
602 transmitPdcpPduParameters.
lcid = 0;
615 rrcConnectionReconfigurationHeader.
SetMessage(msg);
617 packet->
AddHeader(rrcConnectionReconfigurationHeader);
620 transmitPdcpSduParameters.
pdcpSdu = packet;
621 transmitPdcpSduParameters.
rnti = rnti;
622 transmitPdcpSduParameters.
lcid = 1;
635 rrcConnectionReestablishmentHeader.
SetMessage(msg);
637 packet->
AddHeader(rrcConnectionReestablishmentHeader);
640 transmitPdcpPduParameters.
pdcpPdu = packet;
641 transmitPdcpPduParameters.
rnti = rnti;
642 transmitPdcpPduParameters.
lcid = 0;
655 rrcConnectionReestablishmentRejectHeader.
SetMessage(msg);
657 packet->
AddHeader(rrcConnectionReestablishmentRejectHeader);
660 transmitPdcpPduParameters.
pdcpPdu = packet;
661 transmitPdcpPduParameters.
rnti = rnti;
662 transmitPdcpPduParameters.
lcid = 0;
717 p->
RemoveHeader(rrcConnectionReestablishmentRequestHeader);
719 rrcConnectionReestablishmentRequestMsg =
720 rrcConnectionReestablishmentRequestHeader.
GetMessage();
723 rrcConnectionReestablishmentRequestMsg);
728 rrcConnectionRequestMsg = rrcConnectionRequestHeader.
GetMessage();
758 measurementReportMsg = measurementReportHeader.
GetMessage();
763 rrcConnectionReconfigurationCompleteMsg =
764 rrcConnectionReconfigurationCompleteHeader.
GetMessage();
767 rrcConnectionReconfigurationCompleteMsg);
771 rrcConnectionReestablishmentCompleteMsg =
772 rrcConnectionReestablishmentCompleteHeader.
GetMessage();
775 rrcConnectionReestablishmentCompleteMsg);
779 rrcConnectionSetupCompletedMsg = rrcConnectionSetupCompleteHeader.
GetMessage();
781 rrcConnectionSetupCompletedMsg);
This class manages the serialization/deserialization of HandoverPreparationInfo IE.
void SetMessage(LteRrcSap::HandoverPreparationInfo msg)
Receives a HandoverPreparationInfo IE and stores the contents into the class attributes.
LteRrcSap::HandoverPreparationInfo GetMessage() const
Returns a HandoverPreparationInfo IE from the values in the class attributes.
The eNodeB device implementation.
bool HasCellId(uint16_t cellId) const
Ptr< LteEnbRrc > GetRrc() const
Models the transmission of RRC messages from the UE to the eNB in a real fashion, by creating real RR...
void DoSendRrcConnectionRelease(uint16_t rnti, LteRrcSap::RrcConnectionRelease msg)
Send RRC connection release function.
static TypeId GetTypeId()
Get the type ID.
std::map< uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters > m_completeSetupUeParametersMap
complete setup UE parameters map
friend class LtePdcpSpecificLtePdcpSapUser< LteEnbRrcProtocolReal >
allow LtePdcpSpecificLtePdcpSapUser<LteEnbRrcProtocolReal> class friend access
void DoSetupUe(uint16_t rnti, LteEnbRrcSapUser::SetupUeParameters params)
Setup UE function.
LteUeRrcSapProvider * GetUeRrcSapProvider(uint16_t rnti)
Get UE RRC SAP provider function.
void SetCellId(uint16_t cellId)
Set cell ID function.
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
void DoSendRrcConnectionReestablishmentReject(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentReject msg)
Send RRC connection reestabishment reject function.
void DoSendSystemInformation(uint16_t cellId, LteRrcSap::SystemInformation msg)
Send system information function.
void DoReceivePdcpPdu(uint16_t rnti, Ptr< Packet > p)
Receive PDCP PDU function.
LteEnbRrcSapProvider * m_enbRrcSapProvider
ENB RRC SAP provider.
Ptr< Packet > DoEncodeHandoverCommand(LteRrcSap::RrcConnectionReconfiguration msg)
Encode handover command function.
LteEnbRrcSapUser * GetLteEnbRrcSapUser()
Get LTE ENB RRC SAP user function.
void DoSendRrcConnectionSetup(uint16_t rnti, LteRrcSap::RrcConnectionSetup msg)
Send RRC connection setup function.
friend class MemberLteEnbRrcSapUser< LteEnbRrcProtocolReal >
allow MemberLteEnbRrcSapUser<LteEnbRrcProtocolReal> class friend access
uint16_t m_cellId
the cell ID
~LteEnbRrcProtocolReal() override
void DoRemoveUe(uint16_t rnti)
Remove UE function.
Ptr< Packet > DoEncodeHandoverPreparationInformation(LteRrcSap::HandoverPreparationInfo msg)
Encode handover preparation information function.
void SetLteEnbRrcSapProvider(LteEnbRrcSapProvider *p)
Set LTE ENB RRC SAP provider function.
LteEnbRrcSapUser * m_enbRrcSapUser
ENB RRC SAP user.
void DoSendRrcConnectionReject(uint16_t rnti, LteRrcSap::RrcConnectionReject msg)
Send RRC connection reject function.
friend class RealProtocolRlcSapUser
allow RealProtocolRlcSapUser class friend access
void DoDispose() override
Destructor implementation.
std::map< uint16_t, LteEnbRrcSapUser::SetupUeParameters > m_setupUeParametersMap
setup UE parameters map
LteRrcSap::RrcConnectionReconfiguration DoDecodeHandoverCommand(Ptr< Packet > p)
Decode handover command function.
LteRrcSap::HandoverPreparationInfo DoDecodeHandoverPreparationInformation(Ptr< Packet > p)
Decode handover preparation information function.
void DoSendRrcConnectionReestablishment(uint16_t rnti, LteRrcSap::RrcConnectionReestablishment msg)
Send RRC connection reestabishment function.
void SetUeRrcSapProvider(uint16_t rnti, LteUeRrcSapProvider *p)
Set UE RRC SAP provider function.
void DoSendRrcConnectionReconfiguration(uint16_t rnti, LteRrcSap::RrcConnectionReconfiguration msg)
Send RRC connection reconfiguration function.
std::map< uint16_t, LteUeRrcSapProvider * > m_enbRrcSapProviderMap
ENB RRC SAP provider map.
Part of the RRC protocol.
virtual void RecvRrcConnectionReestablishmentRequest(uint16_t rnti, RrcConnectionReestablishmentRequest msg)=0
Receive an RRCConnectionReestablishmentRequest message from a UE during an RRC connection re-establis...
virtual void RecvRrcConnectionReestablishmentComplete(uint16_t rnti, RrcConnectionReestablishmentComplete msg)=0
Receive an RRCConnectionReestablishmentComplete message from a UE during an RRC connection re-establi...
virtual void RecvRrcConnectionReconfigurationCompleted(uint16_t rnti, RrcConnectionReconfigurationCompleted msg)=0
Receive an RRCConnectionReconfigurationComplete message from a UE during an RRC connection reconfigur...
virtual void RecvRrcConnectionRequest(uint16_t rnti, RrcConnectionRequest msg)=0
Receive an RRCConnectionRequest message from a UE during an RRC connection establishment procedure (S...
virtual void RecvRrcConnectionSetupCompleted(uint16_t rnti, RrcConnectionSetupCompleted msg)=0
Receive an RRCConnectionSetupComplete message from a UE during an RRC connection establishment proced...
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 CompleteSetupUe(uint16_t rnti, CompleteSetupUeParameters params)=0
Complete setup UE function.
virtual void RecvIdealUeContextRemoveRequest(uint16_t rnti)=0
Receive ideal UE context remove request from the UE RRC.
Part of the RRC protocol.
virtual void TransmitPdcpSdu(TransmitPdcpSduParameters params)=0
Send RRC PDU parameters to the PDCP for transmission.
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36....
virtual void TransmitPdcpPdu(TransmitPdcpPduParameters params)=0
Send a PDCP PDU to the RLC for transmission This method is to be called when upper PDCP entity has a ...
Service Access Point (SAP) offered by the UM-RLC and AM-RLC entities to the PDCP entity See 3GPP 36....
The LteUeNetDevice class implements the UE net device.
Models the transmission of RRC messages from the UE to the eNB in a real fashion, by creating real RR...
LteEnbRrcSapProvider * m_enbRrcSapProvider
ENB RRC SAP provider.
LteUeRrcSapProvider * m_ueRrcSapProvider
UE RRC SAP provider.
LteUeRrcSapUser::SetupParameters m_setupParameters
setup parameters
void SetEnbRrcSapProvider()
Set ENB RRC SAP provider.
void DoSendRrcConnectionReconfigurationCompleted(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Send RRC connection reconfiguration setup completed function.
~LteUeRrcProtocolReal() override
void SetLteUeRrcSapProvider(LteUeRrcSapProvider *p)
Set LTE UE RRC SAP provider function.
static TypeId GetTypeId()
Get the type ID.
void DoSendRrcConnectionSetupCompleted(LteRrcSap::RrcConnectionSetupCompleted msg)
Send RRC connection setup completed function.
friend class MemberLteUeRrcSapUser< LteUeRrcProtocolReal >
allow MemberLteUeRrcSapUser<LteUeRrcProtocolReal> class friend access
void DoReceivePdcpPdu(Ptr< Packet > p)
Receive PDCP PDU function.
Ptr< LteUeRrc > m_rrc
the RRC
void DoSendRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Send RRC connection reestablishment complete function.
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
void DoSetup(LteUeRrcSapUser::SetupParameters params)
Setup function.
void SetUeRrc(Ptr< LteUeRrc > rrc)
Set UE RRC function.
LteUeRrcSapUser * m_ueRrcSapUser
UE RRC SAP user.
void DoSendMeasurementReport(LteRrcSap::MeasurementReport msg)
Send measurement report function.
friend class LtePdcpSpecificLtePdcpSapUser< LteUeRrcProtocolReal >
allow LtePdcpSpecificLtePdcpSapUser<LteUeRrcProtocolReal> class friend access
void DoSendRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Send RRC connection reestablishment request function.
LteUeRrcSapUser * GetLteUeRrcSapUser()
Get LTE UE RRC SAP user function.
void DoSendIdealUeContextRemoveRequest(uint16_t rnti)
Send ideal UE context remove request function.
void DoDispose() override
Destructor implementation.
void DoSendRrcConnectionRequest(LteRrcSap::RrcConnectionRequest msg)
Send RRC connection request function.
LteUeRrcSapProvider::CompleteSetupParameters m_completeSetupParameters
complete setup parameters
friend class LteRlcSpecificLteRlcSapUser< LteUeRrcProtocolReal >
allow LteRlcSpecificLteRlcSapUser<LteUeRrcProtocolReal> class friend access
Part of the RRC protocol.
virtual void RecvRrcConnectionReconfiguration(RrcConnectionReconfiguration msg)=0
Receive an RRCConnectionReconfiguration message from the serving eNodeB during an RRC connection reco...
virtual void RecvRrcConnectionReject(RrcConnectionReject msg)=0
Receive an RRCConnectionReject message from the serving eNodeB during an RRC connection establishment...
virtual void RecvSystemInformation(SystemInformation msg)=0
Receive a SystemInformation message from the serving eNodeB during a system information acquisition p...
virtual void CompleteSetup(CompleteSetupParameters params)=0
Complete setup function.
virtual void RecvRrcConnectionRelease(RrcConnectionRelease msg)=0
Receive an RRCConnectionRelease message from the serving eNodeB during an RRC connection release proc...
virtual void RecvRrcConnectionSetup(RrcConnectionSetup msg)=0
Receive an RRCConnectionSetup message from the serving eNodeB during an RRC connection establishment ...
virtual void RecvRrcConnectionReestablishment(RrcConnectionReestablishment msg)=0
Receive an RRCConnectionReestablishment message from the serving eNodeB during an RRC connection re-e...
Part of the RRC protocol.
uint32_t GetNDevices() const
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
A base class which provides memory management and object aggregation.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Smart pointer class similar to boost::intrusive_ptr.
LteEnbRrcProtocolReal * m_pdcp
PDCP.
void ReceivePdcpPdu(Ptr< Packet > p) override
Called by the RLC entity to notify the PDCP entity of the reception of a new PDCP PDU.
This class only serves to discriminate which message type has been received in downlink (eNb to ue) f...
This class only serves to discriminate which message type has been received in downlink (eNb to ue) f...
This class only serves to discriminate which message type has been received in uplink (ue to eNb) for...
This class only serves to discriminate which message type has been received in uplink (ue to eNb) for...
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#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_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_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#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.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
const Time RRC_REAL_MSG_DELAY
RRC real message delay.
CompleteSetupUeParameters structure.
LtePdcpSapUser * srb1SapUser
SRB1 SAP user.
LteRlcSapUser * srb0SapUser
SRB0 SAP user.
SetupUeParameters structure.
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Ptr< Packet > pdcpSdu
the RRC PDU
uint16_t rnti
the C-RNTI identifying the UE
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Ptr< Packet > pdcpSdu
the RRC PDU
uint16_t rnti
the C-RNTI identifying the UE
Parameters for LteRlcSapProvider::TransmitPdcpPdu.
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Ptr< Packet > pdcpPdu
the PDCP PDU
uint16_t rnti
the C-RNTI identifying the UE
HandoverPreparationInfo structure.
MeasurementReport structure.
RrcConnectionReconfigurationCompleted structure.
RrcConnectionReconfiguration structure.
RrcConnectionReestablishmentComplete structure.
RrcConnectionReestablishment structure.
RrcConnectionReestablishmentReject structure.
RrcConnectionReestablishmentRequest structure.
RrcConnectionReject structure.
RrcConnectionRelease structure.
RrcConnectionRequest structure.
RrcConnectionSetupCompleted structure.
RrcConnectionSetup structure.
LtePdcpSapUser * srb1SapUser
SRB1 SAP user.
LteRlcSapUser * srb0SapUser
SRB0 SAP user.
SetupParameters structure.
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.
LtePdcpSapProvider * srb1SapProvider
SRB1 SAP provider.