29#include <ns3/fatal-error.h> 
   31#include <ns3/node-list.h> 
   33#include <ns3/nstime.h> 
   34#include <ns3/simulator.h> 
   47    : m_ueRrcSapProvider(nullptr),
 
   48      m_enbRrcSapProvider(nullptr)
 
  122    packet->AddHeader(rrcConnectionRequestHeader);
 
  125    transmitPdcpPduParameters.
pdcpPdu = packet;
 
  127    transmitPdcpPduParameters.
lcid = 0;
 
  139    rrcConnectionSetupCompleteHeader.
SetMessage(msg);
 
  141    packet->AddHeader(rrcConnectionSetupCompleteHeader);
 
  144    transmitPdcpSduParameters.
pdcpSdu = packet;
 
  146    transmitPdcpSduParameters.
lcid = 1;
 
  166    rrcConnectionReconfigurationCompleteHeader.
SetMessage(msg);
 
  168    packet->AddHeader(rrcConnectionReconfigurationCompleteHeader);
 
  171    transmitPdcpSduParameters.
pdcpSdu = packet;
 
  173    transmitPdcpSduParameters.
lcid = 1;
 
  191    packet->AddHeader(measurementReportHeader);
 
  194    transmitPdcpSduParameters.
pdcpSdu = packet;
 
  196    transmitPdcpSduParameters.
lcid = 1;
 
  205    uint16_t cellId = 
m_rrc->GetCellId();
 
  211    NS_LOG_DEBUG(
"RNTI " << rnti << 
" sending UE context remove request to cell id " << cellId);
 
  230    rrcConnectionReestablishmentRequestHeader.
SetMessage(msg);
 
  232    packet->AddHeader(rrcConnectionReestablishmentRequestHeader);
 
  235    transmitPdcpPduParameters.
pdcpPdu = packet;
 
  237    transmitPdcpPduParameters.
lcid = 0;
 
  249    rrcConnectionReestablishmentCompleteHeader.
SetMessage(msg);
 
  251    packet->AddHeader(rrcConnectionReestablishmentCompleteHeader);
 
  254    transmitPdcpSduParameters.
pdcpSdu = packet;
 
  256    transmitPdcpSduParameters.
lcid = 1;
 
  266    uint16_t cellId = 
m_rrc->GetCellId();
 
  277        int nDevs = node->GetNDevices();
 
  278        for (
int j = 0; (j < nDevs) && (!found); j++)
 
  287                if (enbDev->HasCellId(cellId))
 
  295    NS_ASSERT_MSG(found, 
" Unable to find eNB with CellId =" << cellId);
 
  307    p->PeekHeader(rrcDlCcchMessage);
 
  326        p->RemoveHeader(rrcConnectionReestablishmentHeader);
 
  327        rrcConnectionReestablishmentMsg = rrcConnectionReestablishmentHeader.
GetMessage();
 
  332        p->RemoveHeader(rrcConnectionReestablishmentRejectHeader);
 
  333        rrcConnectionReestablishmentRejectMsg =
 
  334            rrcConnectionReestablishmentRejectHeader.
GetMessage();
 
  340        p->RemoveHeader(rrcConnectionRejectHeader);
 
  341        rrcConnectionRejectMsg = rrcConnectionRejectHeader.
GetMessage();
 
  346        p->RemoveHeader(rrcConnectionSetupHeader);
 
  347        rrcConnectionSetupMsg = rrcConnectionSetupHeader.
GetMessage();
 
  358    params.pdcpSdu->PeekHeader(rrcDlDcchMessage);
 
  372        params.pdcpSdu->RemoveHeader(rrcConnectionReconfigurationHeader);
 
  373        rrcConnectionReconfigurationMsg = rrcConnectionReconfigurationHeader.
GetMessage();
 
  377        params.pdcpSdu->RemoveHeader(rrcConnectionReleaseHeader);
 
  378        rrcConnectionReleaseMsg = rrcConnectionReleaseHeader.
GetMessage();
 
  387    : m_enbRrcSapProvider(nullptr)
 
  407        delete it->second.srb0SapUser;
 
  408        delete it->second.srb1SapUser;
 
  416    static TypeId tid = 
TypeId(
"ns3::LteEnbRrcProtocolReal")
 
  510        completeSetupUeParameters.
srb0SapUser = srb0SapUser;
 
  511        completeSetupUeParameters.
srb1SapUser = srb1SapUser;
 
  517        completeSetupUeParameters = csupIt->second;
 
  528    delete it->second.srb0SapUser;
 
  529    delete it->second.srb1SapUser;
 
  544        int nDevs = node->GetNDevices();
 
  545        for (
int j = 0; j < nDevs; ++j)
 
  551                NS_LOG_LOGIC(
"considering UE IMSI " << ueDev->GetImsi() << 
" that has cellId " 
  552                                                    << ueRrc->GetCellId());
 
  553                if (ueRrc->GetCellId() == cellId)
 
  555                    NS_LOG_LOGIC(
"sending SI to IMSI " << ueDev->GetImsi());
 
  560                                                   ueRrc->GetLteUeRrcSapProvider(),
 
  576    packet->AddHeader(rrcConnectionSetupHeader);
 
  579    transmitPdcpPduParameters.
pdcpPdu = packet;
 
  580    transmitPdcpPduParameters.
rnti = rnti;
 
  581    transmitPdcpPduParameters.
lcid = 0;
 
  594    packet->AddHeader(rrcConnectionRejectHeader);
 
  597    transmitPdcpPduParameters.
pdcpPdu = packet;
 
  598    transmitPdcpPduParameters.
rnti = rnti;
 
  599    transmitPdcpPduParameters.
lcid = 0;
 
  612    rrcConnectionReconfigurationHeader.
SetMessage(msg);
 
  614    packet->AddHeader(rrcConnectionReconfigurationHeader);
 
  617    transmitPdcpSduParameters.
pdcpSdu = packet;
 
  618    transmitPdcpSduParameters.
rnti = rnti;
 
  619    transmitPdcpSduParameters.
lcid = 1;
 
  632    rrcConnectionReestablishmentHeader.
SetMessage(msg);
 
  634    packet->AddHeader(rrcConnectionReestablishmentHeader);
 
  637    transmitPdcpPduParameters.
pdcpPdu = packet;
 
  638    transmitPdcpPduParameters.
rnti = rnti;
 
  639    transmitPdcpPduParameters.
lcid = 0;
 
  652    rrcConnectionReestablishmentRejectHeader.
SetMessage(msg);
 
  654    packet->AddHeader(rrcConnectionReestablishmentRejectHeader);
 
  657    transmitPdcpPduParameters.
pdcpPdu = packet;
 
  658    transmitPdcpPduParameters.
rnti = rnti;
 
  659    transmitPdcpPduParameters.
lcid = 0;
 
  704    p->PeekHeader(rrcUlCcchMessage);
 
  714        p->RemoveHeader(rrcConnectionReestablishmentRequestHeader);
 
  716        rrcConnectionReestablishmentRequestMsg =
 
  717            rrcConnectionReestablishmentRequestHeader.
GetMessage();
 
  720            rrcConnectionReestablishmentRequestMsg);
 
  723        p->RemoveHeader(rrcConnectionRequestHeader);
 
  725        rrcConnectionRequestMsg = rrcConnectionRequestHeader.
GetMessage();
 
  736    params.pdcpSdu->PeekHeader(rrcUlDcchMessage);
 
  754        params.pdcpSdu->RemoveHeader(measurementReportHeader);
 
  755        measurementReportMsg = measurementReportHeader.
GetMessage();
 
  759        params.pdcpSdu->RemoveHeader(rrcConnectionReconfigurationCompleteHeader);
 
  760        rrcConnectionReconfigurationCompleteMsg =
 
  761            rrcConnectionReconfigurationCompleteHeader.
GetMessage();
 
  764            rrcConnectionReconfigurationCompleteMsg);
 
  767        params.pdcpSdu->RemoveHeader(rrcConnectionReestablishmentCompleteHeader);
 
  768        rrcConnectionReestablishmentCompleteMsg =
 
  769            rrcConnectionReestablishmentCompleteHeader.
GetMessage();
 
  772            rrcConnectionReestablishmentCompleteMsg);
 
  775        params.pdcpSdu->RemoveHeader(rrcConnectionSetupCompleteHeader);
 
  776        rrcConnectionSetupCompletedMsg = rrcConnectionSetupCompleteHeader.
GetMessage();
 
  778                                                             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.
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.
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.