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;
452 <<
" could not find RNTI = " << rnti);
499 std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator
506 completeSetupUeParameters.
srb0SapUser = srb0SapUser;
507 completeSetupUeParameters.
srb1SapUser = srb1SapUser;
513 completeSetupUeParameters = csupIt->second;
522 std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator
525 delete it->second.srb0SapUser;
526 delete it->second.srb1SapUser;
542 for (
int j = 0; j < nDevs; ++j)
548 NS_LOG_LOGIC (
"considering UE IMSI " << ueDev->GetImsi () <<
" that has cellId " << ueRrc->GetCellId ());
549 if (ueRrc->GetCellId () == cellId)
551 NS_LOG_LOGIC (
"sending SI to IMSI " << ueDev->GetImsi ());
556 ueRrc->GetLteUeRrcSapProvider (),
572 packet->
AddHeader (rrcConnectionSetupHeader);
575 transmitPdcpPduParameters.
pdcpPdu = packet;
576 transmitPdcpPduParameters.
rnti = rnti;
577 transmitPdcpPduParameters.
lcid = 0;
590 packet->
AddHeader (rrcConnectionRejectHeader);
593 transmitPdcpPduParameters.
pdcpPdu = packet;
594 transmitPdcpPduParameters.
rnti = rnti;
595 transmitPdcpPduParameters.
lcid = 0;
606 rrcConnectionReconfigurationHeader.
SetMessage (msg);
608 packet->
AddHeader (rrcConnectionReconfigurationHeader);
611 transmitPdcpSduParameters.
pdcpSdu = packet;
612 transmitPdcpSduParameters.
rnti = rnti;
613 transmitPdcpSduParameters.
lcid = 1;
624 rrcConnectionReestablishmentHeader.
SetMessage (msg);
626 packet->
AddHeader (rrcConnectionReestablishmentHeader);
629 transmitPdcpPduParameters.
pdcpPdu = packet;
630 transmitPdcpPduParameters.
rnti = rnti;
631 transmitPdcpPduParameters.
lcid = 0;
642 rrcConnectionReestablishmentRejectHeader.
SetMessage (msg);
644 packet->
AddHeader (rrcConnectionReestablishmentRejectHeader);
647 transmitPdcpPduParameters.
pdcpPdu = packet;
648 transmitPdcpPduParameters.
rnti = rnti;
649 transmitPdcpPduParameters.
lcid = 0;
662 packet->
AddHeader (rrcConnectionReleaseHeader);
665 transmitPdcpSduParameters.
pdcpSdu = packet;
666 transmitPdcpSduParameters.
rnti = rnti;
667 transmitPdcpSduParameters.
lcid = 1;
687 p->
RemoveHeader (rrcConnectionReestablishmentRequestHeader);
689 rrcConnectionReestablishmentRequestMsg = rrcConnectionReestablishmentRequestHeader.
GetMessage ();
695 rrcConnectionRequestMsg = rrcConnectionRequestHeader.
GetMessage ();
725 measurementReportMsg = measurementReportHeader.
GetMessage ();
730 rrcConnectionReconfigurationCompleteMsg = rrcConnectionReconfigurationCompleteHeader.
GetMessage ();
735 rrcConnectionReestablishmentCompleteMsg = rrcConnectionReestablishmentCompleteHeader.
GetMessage ();
740 rrcConnectionSetupCompletedMsg = rrcConnectionSetupCompleteHeader.
GetMessage ();
virtual void DoDispose(void)
Destructor implementation.
This class only serves to discriminate which message type has been received in downlink (eNb to ue) f...
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
RrcConnectionRequest structure.
Service Access Point (SAP) offered by the UM-RLC and AM-RLC entities to the PDCP entity See 3GPP 36...
virtual void ReceivePdcpPdu(Ptr< Packet > p)
Called by the RLC entity to notify the PDCP entity of the reception of a new PDCP PDU...
void DoSetup(LteUeRrcSapUser::SetupParameters params)
Setup function.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Ptr< Packet > pdcpPdu
the PDCP PDU
LtePdcpSapProvider * srb1SapProvider
SRB1 SAP provider.
Simulation virtual time values and global simulation resolution.
LteRrcSap::HandoverPreparationInfo GetMessage() const
Returns a HandoverPreparationInfo IE from the values in the class attributes.
void DoSendMeasurementReport(LteRrcSap::MeasurementReport msg)
Send measurement report function.
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.
LteUeRrcSapProvider * m_ueRrcSapProvider
UE RRC SAP provider.
MeasurementReport structure.
uint32_t GetId(void) const
void DoSendRrcConnectionReject(uint16_t rnti, LteRrcSap::RrcConnectionReject msg)
Send RRC connection reject function.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
virtual void DoDispose(void)
Destructor implementation.
void DoSendRrcConnectionRelease(uint16_t rnti, LteRrcSap::RrcConnectionRelease msg)
Send RRC connection release function.
friend class RealProtocolRlcSapUser
allow RealProtocolRlcSapUser class friend access
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
LteRlcSpecificLteRlcSapUser class.
Part of the RRC protocol.
virtual ~LteEnbRrcProtocolReal()
LteRlcSapUser * srb0SapUser
SRB0 SAP user.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Models the transmission of RRC messages from the UE to the eNB in a real fashion, by creating real RR...
static TypeId GetTypeId(void)
Get the type ID.
Template for the implementation of the LteEnbRrcSapUser as a member of an owner class of type C to wh...
Ptr< Packet > DoEncodeHandoverCommand(LteRrcSap::RrcConnectionReconfiguration msg)
Encode handover command function.
LteUeRrcSapProvider::CompleteSetupParameters m_completeSetupParameters
complete setup parameters
LteRrcSap::RrcConnectionReconfiguration DoDecodeHandoverCommand(Ptr< Packet > p)
Decode handover command function.
Ptr< Packet > DoEncodeHandoverPreparationInformation(LteRrcSap::HandoverPreparationInfo msg)
Encode handover preparation information function.
SetupParameters structure.
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 ...
LtePdcpSapUser * srb1SapUser
SRB1 SAP user.
LteUeRrcSapProvider * GetUeRrcSapProvider(uint16_t rnti)
Get UE RRC SAP provider function.
Models the transmission of RRC messages from the UE to the eNB in a real fashion, by creating real RR...
std::map< uint16_t, LteEnbRrcSapUser::SetupUeParameters > m_setupUeParametersMap
setup UE parameters map
std::map< uint16_t, LteUeRrcSapProvider * > m_enbRrcSapProviderMap
ENB RRC SAP provider map.
LteUeRrcSapUser * m_ueRrcSapUser
UE RRC SAP user.
Ptr< Packet > pdcpSdu
the RRC PDU
virtual void RecvRrcConnectionReject(RrcConnectionReject msg)=0
Receive an RRCConnectionReject message from the serving eNodeB during an RRC connection establishment...
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
uint16_t rnti
the C-RNTI identifying the UE
void SetLteEnbRrcSapProvider(LteEnbRrcSapProvider *p)
Set LTE ENB RRC SAP provider function.
void DoSendRrcConnectionSetup(uint16_t rnti, LteRrcSap::RrcConnectionSetup msg)
Send RRC connection setup function.
This class only serves to discriminate which message type has been received in uplink (ue to eNb) for...
virtual ~LteUeRrcProtocolReal()
void SetUeRrcSapProvider(uint16_t rnti, LteUeRrcSapProvider *p)
Set UE RRC SAP provider function.
RrcConnectionReestablishment structure.
void DoSendRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Send RRC connection reestablishment request function.
static Iterator End(void)
const Time RRC_REAL_MSG_DELAY
RRC real message delay.
virtual void RecvRrcConnectionReconfiguration(RrcConnectionReconfiguration msg)=0
Receive an RRCConnectionReconfiguration message from the serving eNodeB during an RRC connection reco...
std::map< uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters > m_completeSetupUeParametersMap
complete setup UE parameters map
virtual void RecvRrcConnectionReestablishment(RrcConnectionReestablishment msg)=0
Receive an RRCConnectionReestablishment message from the serving eNodeB during an RRC connection re-e...
void DoReceivePdcpPdu(Ptr< Packet > p)
Receive PDCP PDU function.
RrcConnectionReconfiguration structure.
uint16_t rnti
the C-RNTI identifying the UE
SetupUeParameters structure.
This class only serves to discriminate which message type has been received in downlink (eNb to ue) f...
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
RrcConnectionReconfigurationCompleted structure.
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
void SetEnbRrcSapProvider()
Set ENB RRC SAP provider.
LteEnbRrcSapUser * GetLteEnbRrcSapUser()
Get LTE ENB RRC SAP user function.
RrcConnectionSetupCompleted structure.
HandoverPreparationInfo structure.
RrcConnectionSetup structure.
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
RrcConnectionReestablishmentRequest structure.
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Part of the RRC protocol.
void DoSendRrcConnectionReestablishmentReject(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentReject msg)
Send RRC connection reestabishment reject function.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< Packet > pdcpSdu
the RRC PDU
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.
RrcConnectionReject structure.
virtual void CompleteSetup(CompleteSetupParameters params)=0
Complete setup function.
Ptr< LteUeRrc > m_rrc
the RRC
void DoSendRrcConnectionReconfiguration(uint16_t rnti, LteRrcSap::RrcConnectionReconfiguration msg)
Send RRC connection reconfiguration function.
virtual void RecvRrcConnectionRequest(uint16_t rnti, RrcConnectionRequest msg)=0
Receive an RRCConnectionRequest message from a UE during an RRC connection establishment procedure (S...
void DoSendRrcConnectionReestablishment(uint16_t rnti, LteRrcSap::RrcConnectionReestablishment msg)
Send RRC connection reestabishment function.
This class manages the serialization/deserialization of HandoverPreparationInfo IE.
LtePdcpSapUser * srb1SapUser
SRB1 SAP user.
LtePdcpSpecificLtePdcpSapUser class.
LteEnbRrcSapProvider * m_enbRrcSapProvider
ENB RRC SAP provider.
virtual void RecvSystemInformation(SystemInformation msg)=0
Receive a SystemInformation message from the serving eNodeB during a system information acquisition p...
RrcConnectionReestablishmentReject structure.
LteRlcSapUser * srb0SapUser
SRB0 SAP user.
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
void SetMessage(LteRrcSap::HandoverPreparationInfo msg)
Receives a HandoverPreparationInfo IE and stores the contents into the class attributes.
void DoSendRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Send RRC connection reestablishment complete function.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
virtual void TransmitPdcpSdu(TransmitPdcpSduParameters params)=0
Send a RRC PDU to the RDCP for transmission This method is to be called when upper RRC entity has a R...
void DoSendRrcConnectionSetupCompleted(LteRrcSap::RrcConnectionSetupCompleted msg)
Send RRC connection setup completed function.
Parameters for LteRlcSapProvider::TransmitPdcpPdu.
void DoSendRrcConnectionReconfigurationCompleted(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Send RRC connection reconfiguration setup completed function.
static TypeId GetTypeId(void)
Get the type ID.
virtual void RecvIdealUeContextRemoveRequest(uint16_t rnti)=0
Receive ideal UE context remove request from the UE RRC.
LteUeRrcSapUser::SetupParameters m_setupParameters
setup parameters
void DoSendRrcConnectionRequest(LteRrcSap::RrcConnectionRequest msg)
Send RRC connection request function.
virtual void RecvRrcConnectionReestablishmentRequest(uint16_t rnti, RrcConnectionReestablishmentRequest msg)=0
Receive an RRCConnectionReestablishmentRequest message from a UE during an RRC connection re-establis...
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
static Iterator Begin(void)
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36.323 Packet Data Convergence Protocol (PDCP) specification.
void DoSendIdealUeContextRemoveRequest(uint16_t rnti)
Send ideal UE context remove request function.
void DoReceivePdcpPdu(uint16_t rnti, Ptr< Packet > p)
Receive PDCP PDU function.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.
CompleteSetupUeParameters structure.
LteEnbRrcSapUser * m_enbRrcSapUser
ENB RRC SAP user.
RrcConnectionReestablishmentComplete structure.
virtual void RecvMeasurementReport(uint16_t rnti, MeasurementReport msg)=0
Receive a MeasurementReport message from a UE during a measurement reporting procedure (Section 5...
LteRrcSap::HandoverPreparationInfo DoDecodeHandoverPreparationInformation(Ptr< Packet > p)
Decode handover preparation information function.
LteEnbRrcSapProvider * m_enbRrcSapProvider
ENB RRC SAP provider.
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
void SetCellId(uint16_t cellId)
Set cell ID function.
uint16_t rnti
the C-RNTI identifying the UE
virtual void RecvRrcConnectionReestablishmentComplete(uint16_t rnti, RrcConnectionReestablishmentComplete msg)=0
Receive an RRCConnectionReestablishmentComplete message from a UE during an RRC connection re-establi...
virtual void CompleteSetupUe(uint16_t rnti, CompleteSetupUeParameters params)=0
Complete setup UE function.
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.
LteUeRrcSapUser * GetLteUeRrcSapUser()
Get LTE UE RRC SAP user function.
Part of the RRC protocol.
uint16_t m_cellId
the cell ID
RrcConnectionRelease structure.
LteEnbRrcProtocolReal * m_pdcp
PDCP.
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
void SetLteUeRrcSapProvider(LteUeRrcSapProvider *p)
Set LTE UE RRC SAP provider function.
void DoSendSystemInformation(uint16_t cellId, LteRrcSap::SystemInformation msg)
Send system information function.
The eNodeB device implementation.
This class only serves to discriminate which message type has been received in uplink (ue to eNb) for...
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.
Ptr< LteEnbRrc > GetRrc() const
TypeId SetParent(TypeId tid)
Set the parent TypeId.
bool HasCellId(uint16_t cellId) const
void DoSetupUe(uint16_t rnti, LteEnbRrcSapUser::SetupUeParameters params)
Setup UE function.
void DoRemoveUe(uint16_t rnti)
Remove UE function.
void SetUeRrc(Ptr< LteUeRrc > rrc)
Set UE RRC function.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t GetNDevices(void) const
The LteUeNetDevice class implements the UE net device.