18#include <ns3/fatal-error.h>
20#include <ns3/node-list.h>
22#include <ns3/nstime.h>
23#include <ns3/simulator.h>
36 : m_ueRrcSapProvider(nullptr),
37 m_enbRrcSapProvider(nullptr)
111 packet->AddHeader(rrcConnectionRequestHeader);
114 transmitPdcpPduParameters.
pdcpPdu = packet;
116 transmitPdcpPduParameters.
lcid = 0;
128 rrcConnectionSetupCompleteHeader.
SetMessage(msg);
130 packet->AddHeader(rrcConnectionSetupCompleteHeader);
133 transmitPdcpSduParameters.
pdcpSdu = packet;
135 transmitPdcpSduParameters.
lcid = 1;
155 rrcConnectionReconfigurationCompleteHeader.
SetMessage(msg);
157 packet->AddHeader(rrcConnectionReconfigurationCompleteHeader);
160 transmitPdcpSduParameters.
pdcpSdu = packet;
162 transmitPdcpSduParameters.
lcid = 1;
180 packet->AddHeader(measurementReportHeader);
183 transmitPdcpSduParameters.
pdcpSdu = packet;
185 transmitPdcpSduParameters.
lcid = 1;
194 uint16_t cellId =
m_rrc->GetCellId();
200 NS_LOG_DEBUG(
"RNTI " << rnti <<
" sending UE context remove request to cell id " << cellId);
219 rrcConnectionReestablishmentRequestHeader.
SetMessage(msg);
221 packet->AddHeader(rrcConnectionReestablishmentRequestHeader);
224 transmitPdcpPduParameters.
pdcpPdu = packet;
226 transmitPdcpPduParameters.
lcid = 0;
238 rrcConnectionReestablishmentCompleteHeader.
SetMessage(msg);
240 packet->AddHeader(rrcConnectionReestablishmentCompleteHeader);
243 transmitPdcpSduParameters.
pdcpSdu = packet;
245 transmitPdcpSduParameters.
lcid = 1;
255 uint16_t cellId =
m_rrc->GetCellId();
266 int nDevs = node->GetNDevices();
267 for (
int j = 0; (j < nDevs) && (!found); j++)
276 if (enbDev->HasCellId(cellId))
284 NS_ASSERT_MSG(found,
" Unable to find eNB with CellId =" << cellId);
296 p->PeekHeader(rrcDlCcchMessage);
315 p->RemoveHeader(rrcConnectionReestablishmentHeader);
316 rrcConnectionReestablishmentMsg = rrcConnectionReestablishmentHeader.
GetMessage();
321 p->RemoveHeader(rrcConnectionReestablishmentRejectHeader);
322 rrcConnectionReestablishmentRejectMsg =
323 rrcConnectionReestablishmentRejectHeader.
GetMessage();
329 p->RemoveHeader(rrcConnectionRejectHeader);
330 rrcConnectionRejectMsg = rrcConnectionRejectHeader.
GetMessage();
335 p->RemoveHeader(rrcConnectionSetupHeader);
336 rrcConnectionSetupMsg = rrcConnectionSetupHeader.
GetMessage();
347 params.pdcpSdu->PeekHeader(rrcDlDcchMessage);
361 params.pdcpSdu->RemoveHeader(rrcConnectionReconfigurationHeader);
362 rrcConnectionReconfigurationMsg = rrcConnectionReconfigurationHeader.
GetMessage();
366 params.pdcpSdu->RemoveHeader(rrcConnectionReleaseHeader);
367 rrcConnectionReleaseMsg = rrcConnectionReleaseHeader.
GetMessage();
376 : m_enbRrcSapProvider(nullptr)
396 delete it->second.srb0SapUser;
397 delete it->second.srb1SapUser;
405 static TypeId tid =
TypeId(
"ns3::LteEnbRrcProtocolReal")
499 completeSetupUeParameters.
srb0SapUser = srb0SapUser;
500 completeSetupUeParameters.
srb1SapUser = srb1SapUser;
506 completeSetupUeParameters = csupIt->second;
517 delete it->second.srb0SapUser;
518 delete it->second.srb1SapUser;
533 int nDevs = node->GetNDevices();
534 for (
int j = 0; j < nDevs; ++j)
540 NS_LOG_LOGIC(
"considering UE IMSI " << ueDev->GetImsi() <<
" that has cellId "
541 << ueRrc->GetCellId());
542 if (ueRrc->GetCellId() == cellId)
544 NS_LOG_LOGIC(
"sending SI to IMSI " << ueDev->GetImsi());
549 ueRrc->GetLteUeRrcSapProvider(),
565 packet->AddHeader(rrcConnectionSetupHeader);
568 transmitPdcpPduParameters.
pdcpPdu = packet;
569 transmitPdcpPduParameters.
rnti = rnti;
570 transmitPdcpPduParameters.
lcid = 0;
583 packet->AddHeader(rrcConnectionRejectHeader);
586 transmitPdcpPduParameters.
pdcpPdu = packet;
587 transmitPdcpPduParameters.
rnti = rnti;
588 transmitPdcpPduParameters.
lcid = 0;
601 rrcConnectionReconfigurationHeader.
SetMessage(msg);
603 packet->AddHeader(rrcConnectionReconfigurationHeader);
606 transmitPdcpSduParameters.
pdcpSdu = packet;
607 transmitPdcpSduParameters.
rnti = rnti;
608 transmitPdcpSduParameters.
lcid = 1;
621 rrcConnectionReestablishmentHeader.
SetMessage(msg);
623 packet->AddHeader(rrcConnectionReestablishmentHeader);
626 transmitPdcpPduParameters.
pdcpPdu = packet;
627 transmitPdcpPduParameters.
rnti = rnti;
628 transmitPdcpPduParameters.
lcid = 0;
641 rrcConnectionReestablishmentRejectHeader.
SetMessage(msg);
643 packet->AddHeader(rrcConnectionReestablishmentRejectHeader);
646 transmitPdcpPduParameters.
pdcpPdu = packet;
647 transmitPdcpPduParameters.
rnti = rnti;
648 transmitPdcpPduParameters.
lcid = 0;
693 p->PeekHeader(rrcUlCcchMessage);
703 p->RemoveHeader(rrcConnectionReestablishmentRequestHeader);
705 rrcConnectionReestablishmentRequestMsg =
706 rrcConnectionReestablishmentRequestHeader.
GetMessage();
709 rrcConnectionReestablishmentRequestMsg);
712 p->RemoveHeader(rrcConnectionRequestHeader);
714 rrcConnectionRequestMsg = rrcConnectionRequestHeader.
GetMessage();
725 params.pdcpSdu->PeekHeader(rrcUlDcchMessage);
743 params.pdcpSdu->RemoveHeader(measurementReportHeader);
744 measurementReportMsg = measurementReportHeader.
GetMessage();
748 params.pdcpSdu->RemoveHeader(rrcConnectionReconfigurationCompleteHeader);
749 rrcConnectionReconfigurationCompleteMsg =
750 rrcConnectionReconfigurationCompleteHeader.
GetMessage();
753 rrcConnectionReconfigurationCompleteMsg);
756 params.pdcpSdu->RemoveHeader(rrcConnectionReestablishmentCompleteHeader);
757 rrcConnectionReestablishmentCompleteMsg =
758 rrcConnectionReestablishmentCompleteHeader.
GetMessage();
761 rrcConnectionReestablishmentCompleteMsg);
764 params.pdcpSdu->RemoveHeader(rrcConnectionSetupCompleteHeader);
765 rrcConnectionSetupCompletedMsg = rrcConnectionSetupCompleteHeader.
GetMessage();
767 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.
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.
friend class MemberLteUeRrcSapUser< LteUeRrcProtocolReal >
allow MemberLteUeRrcSapUser<LteUeRrcProtocolReal> class friend access
void DoSendRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg) const
Send RRC connection reestablishment request function.
void DoReceivePdcpPdu(Ptr< Packet > p)
Receive PDCP PDU function.
void DoSendRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg) const
Send RRC connection reestablishment complete function.
Ptr< LteUeRrc > m_rrc
the RRC
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
void DoSetup(LteUeRrcSapUser::SetupParameters params)
Setup function.
void DoSendRrcConnectionSetupCompleted(LteRrcSap::RrcConnectionSetupCompleted msg) const
Send RRC connection setup completed 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
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.
A base class which provides memory management and object aggregation.
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.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
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.
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.