22 #include <ns3/fatal-error.h>
24 #include <ns3/nstime.h>
25 #include <ns3/node-list.h>
27 #include <ns3/simulator.h>
45 : m_ueRrcSapProvider (0),
46 m_enbRrcSapProvider (0)
119 packet->
AddHeader (rrcConnectionRequestHeader);
122 transmitPdcpPduParameters.
pdcpPdu = packet;
124 transmitPdcpPduParameters.
lcid = 0;
135 rrcConnectionSetupCompleteHeader.
SetMessage (msg);
137 packet->
AddHeader (rrcConnectionSetupCompleteHeader);
140 transmitPdcpSduParameters.
pdcpSdu = packet;
142 transmitPdcpSduParameters.
lcid = 1;
161 rrcConnectionReconfigurationCompleteHeader.
SetMessage (msg);
163 packet->
AddHeader (rrcConnectionReconfigurationCompleteHeader);
166 transmitPdcpSduParameters.
pdcpSdu = packet;
168 transmitPdcpSduParameters.
lcid = 1;
186 packet->
AddHeader (measurementReportHeader);
189 transmitPdcpSduParameters.
pdcpSdu = packet;
191 transmitPdcpSduParameters.
lcid = 1;
200 uint16_t cellId =
m_rrc->GetCellId ();
207 <<
" sending UE context remove request to cell id " << cellId);
223 rrcConnectionReestablishmentRequestHeader.
SetMessage (msg);
225 packet->
AddHeader (rrcConnectionReestablishmentRequestHeader);
228 transmitPdcpPduParameters.
pdcpPdu = packet;
230 transmitPdcpPduParameters.
lcid = 0;
241 rrcConnectionReestablishmentCompleteHeader.
SetMessage (msg);
243 packet->
AddHeader (rrcConnectionReestablishmentCompleteHeader);
246 transmitPdcpSduParameters.
pdcpSdu = packet;
248 transmitPdcpSduParameters.
lcid = 1;
259 uint16_t cellId =
m_rrc->GetCellId ();
268 (i != listEnd) && (!found);
274 (j < nDevs) && (!found);
292 NS_ASSERT_MSG (found,
" Unable to find eNB with CellId =" << cellId);
323 rrcConnectionReestablishmentMsg = rrcConnectionReestablishmentHeader.
GetMessage ();
328 p->
RemoveHeader (rrcConnectionReestablishmentRejectHeader);
329 rrcConnectionReestablishmentRejectMsg = rrcConnectionReestablishmentRejectHeader.
GetMessage ();
335 rrcConnectionRejectMsg = rrcConnectionRejectHeader.
GetMessage ();
341 rrcConnectionSetupMsg = rrcConnectionSetupHeader.
GetMessage ();
367 rrcConnectionReconfigurationMsg = rrcConnectionReconfigurationHeader.
GetMessage ();
372 rrcConnectionReleaseMsg = rrcConnectionReleaseHeader.
GetMessage ();
381 : m_enbRrcSapProvider (0)
397 for (std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator
402 delete it->second.srb0SapUser;
403 delete it->second.srb1SapUser;
411 static TypeId tid =
TypeId (
"ns3::LteEnbRrcProtocolReal")
440 std::map<uint16_t, LteUeRrcSapProvider*>::const_iterator it;
449 std::map<uint16_t, LteUeRrcSapProvider*>::iterator it;
502 std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator
509 completeSetupUeParameters.
srb0SapUser = srb0SapUser;
510 completeSetupUeParameters.
srb1SapUser = srb1SapUser;
516 completeSetupUeParameters = csupIt->second;
525 std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator
528 delete it->second.srb0SapUser;
529 delete it->second.srb1SapUser;
545 for (
int j = 0; j < nDevs; ++j)
551 NS_LOG_LOGIC (
"considering UE IMSI " << ueDev->GetImsi () <<
" that has cellId " << ueRrc->GetCellId ());
552 if (ueRrc->GetCellId () == cellId)
554 NS_LOG_LOGIC (
"sending SI to IMSI " << ueDev->GetImsi ());
559 ueRrc->GetLteUeRrcSapProvider (),
575 packet->
AddHeader (rrcConnectionSetupHeader);
578 transmitPdcpPduParameters.
pdcpPdu = packet;
579 transmitPdcpPduParameters.
rnti = rnti;
580 transmitPdcpPduParameters.
lcid = 0;
593 packet->
AddHeader (rrcConnectionRejectHeader);
596 transmitPdcpPduParameters.
pdcpPdu = packet;
597 transmitPdcpPduParameters.
rnti = rnti;
598 transmitPdcpPduParameters.
lcid = 0;
609 rrcConnectionReconfigurationHeader.
SetMessage (msg);
611 packet->
AddHeader (rrcConnectionReconfigurationHeader);
614 transmitPdcpSduParameters.
pdcpSdu = packet;
615 transmitPdcpSduParameters.
rnti = rnti;
616 transmitPdcpSduParameters.
lcid = 1;
627 rrcConnectionReestablishmentHeader.
SetMessage (msg);
629 packet->
AddHeader (rrcConnectionReestablishmentHeader);
632 transmitPdcpPduParameters.
pdcpPdu = packet;
633 transmitPdcpPduParameters.
rnti = rnti;
634 transmitPdcpPduParameters.
lcid = 0;
645 rrcConnectionReestablishmentRejectHeader.
SetMessage (msg);
647 packet->
AddHeader (rrcConnectionReestablishmentRejectHeader);
650 transmitPdcpPduParameters.
pdcpPdu = packet;
651 transmitPdcpPduParameters.
rnti = rnti;
652 transmitPdcpPduParameters.
lcid = 0;
665 packet->
AddHeader (rrcConnectionReleaseHeader);
668 transmitPdcpSduParameters.
pdcpSdu = packet;
669 transmitPdcpSduParameters.
rnti = rnti;
670 transmitPdcpSduParameters.
lcid = 1;
690 p->
RemoveHeader (rrcConnectionReestablishmentRequestHeader);
692 rrcConnectionReestablishmentRequestMsg = rrcConnectionReestablishmentRequestHeader.
GetMessage ();
698 rrcConnectionRequestMsg = rrcConnectionRequestHeader.
GetMessage ();
728 measurementReportMsg = measurementReportHeader.
GetMessage ();
733 rrcConnectionReconfigurationCompleteMsg = rrcConnectionReconfigurationCompleteHeader.
GetMessage ();
738 rrcConnectionReestablishmentCompleteMsg = rrcConnectionReestablishmentCompleteHeader.
GetMessage ();
743 rrcConnectionSetupCompletedMsg = rrcConnectionSetupCompleteHeader.
GetMessage ();
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.
std::map< uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters > m_completeSetupUeParametersMap
complete setup UE parameters map
virtual ~LteEnbRrcProtocolReal()
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
static TypeId GetTypeId(void)
Get the type ID.
uint16_t m_cellId
the cell ID
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
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.
virtual void DoDispose(void)
Destructor implementation.
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.
virtual ~LteUeRrcProtocolReal()
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.
virtual void DoDispose(void)
Destructor implementation.
void SetLteUeRrcSapProvider(LteUeRrcSapProvider *p)
Set LTE UE RRC SAP provider function.
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.
static TypeId GetTypeId(void)
Get the type ID.
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 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 GetId(void) const
uint32_t GetNDevices(void) const
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
static Iterator End(void)
static Iterator Begin(void)
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
A base class which provides memory management and object aggregation.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
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.
virtual void ReceivePdcpPdu(Ptr< Packet > p)
Called by the RLC entity to notify the PDCP entity of the reception of a new PDCP PDU.
LteEnbRrcProtocolReal * m_pdcp
PDCP.
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(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void ScheduleWithContext(uint32_t context, Time const &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.