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;
202 rrcConnectionReestablishmentRequestHeader.
SetMessage (msg);
204 packet->
AddHeader (rrcConnectionReestablishmentRequestHeader);
207 transmitPdcpPduParameters.
pdcpPdu = packet;
209 transmitPdcpPduParameters.
lcid = 0;
220 rrcConnectionReestablishmentCompleteHeader.
SetMessage (msg);
222 packet->
AddHeader (rrcConnectionReestablishmentCompleteHeader);
225 transmitPdcpSduParameters.
pdcpSdu = packet;
227 transmitPdcpSduParameters.
lcid = 1;
236 uint16_t cellId =
m_rrc->GetCellId ();
243 (i != listEnd) && (!found);
249 (j < nDevs) && (!found);
267 NS_ASSERT_MSG (found,
" Unable to find eNB with CellId =" << cellId);
298 rrcConnectionReestablishmentMsg = rrcConnectionReestablishmentHeader.
GetMessage ();
303 p->
RemoveHeader (rrcConnectionReestablishmentRejectHeader);
304 rrcConnectionReestablishmentRejectMsg = rrcConnectionReestablishmentRejectHeader.
GetMessage ();
310 rrcConnectionRejectMsg = rrcConnectionRejectHeader.
GetMessage ();
316 rrcConnectionSetupMsg = rrcConnectionSetupHeader.
GetMessage ();
342 rrcConnectionReconfigurationMsg = rrcConnectionReconfigurationHeader.
GetMessage ();
347 rrcConnectionReleaseMsg = rrcConnectionReleaseHeader.
GetMessage ();
356 : m_enbRrcSapProvider (0)
372 for (std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator
377 delete it->second.srb0SapUser;
378 delete it->second.srb1SapUser;
386 static TypeId tid =
TypeId (
"ns3::LteEnbRrcProtocolReal")
415 std::map<uint16_t, LteUeRrcSapProvider*>::const_iterator it;
424 std::map<uint16_t, LteUeRrcSapProvider*>::iterator it;
473 std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator
480 completeSetupUeParameters.
srb0SapUser = srb0SapUser;
481 completeSetupUeParameters.
srb1SapUser = srb1SapUser;
487 completeSetupUeParameters = csupIt->second;
496 std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator
499 delete it->second.srb0SapUser;
500 delete it->second.srb1SapUser;
516 for (
int j = 0; j < nDevs; ++j)
522 NS_LOG_LOGIC (
"considering UE IMSI " << ueDev->GetImsi () <<
" that has cellId " << ueRrc->GetCellId ());
523 if (ueRrc->GetCellId () == cellId)
525 NS_LOG_LOGIC (
"sending SI to IMSI " << ueDev->GetImsi ());
526 ueRrc->GetLteUeRrcSapProvider ()->RecvSystemInformation (msg);
529 ueRrc->GetLteUeRrcSapProvider (),
545 packet->
AddHeader (rrcConnectionSetupHeader);
548 transmitPdcpPduParameters.
pdcpPdu = packet;
549 transmitPdcpPduParameters.
rnti = rnti;
550 transmitPdcpPduParameters.
lcid = 0;
563 packet->
AddHeader (rrcConnectionRejectHeader);
566 transmitPdcpPduParameters.
pdcpPdu = packet;
567 transmitPdcpPduParameters.
rnti = rnti;
568 transmitPdcpPduParameters.
lcid = 0;
579 rrcConnectionReconfigurationHeader.
SetMessage (msg);
581 packet->
AddHeader (rrcConnectionReconfigurationHeader);
584 transmitPdcpSduParameters.
pdcpSdu = packet;
585 transmitPdcpSduParameters.
rnti = rnti;
586 transmitPdcpSduParameters.
lcid = 1;
597 rrcConnectionReestablishmentHeader.
SetMessage (msg);
599 packet->
AddHeader (rrcConnectionReestablishmentHeader);
602 transmitPdcpPduParameters.
pdcpPdu = packet;
603 transmitPdcpPduParameters.
rnti = rnti;
604 transmitPdcpPduParameters.
lcid = 0;
615 rrcConnectionReestablishmentRejectHeader.
SetMessage (msg);
617 packet->
AddHeader (rrcConnectionReestablishmentRejectHeader);
620 transmitPdcpPduParameters.
pdcpPdu = packet;
621 transmitPdcpPduParameters.
rnti = rnti;
622 transmitPdcpPduParameters.
lcid = 0;
635 packet->
AddHeader (rrcConnectionReleaseHeader);
638 transmitPdcpSduParameters.
pdcpSdu = packet;
639 transmitPdcpSduParameters.
rnti = rnti;
640 transmitPdcpSduParameters.
lcid = 1;
660 p->
RemoveHeader (rrcConnectionReestablishmentRequestHeader);
662 rrcConnectionReestablishmentRequestMsg = rrcConnectionReestablishmentRequestHeader.
GetMessage ();
668 rrcConnectionRequestMsg = rrcConnectionRequestHeader.
GetMessage ();
698 measurementReportMsg = measurementReportHeader.
GetMessage ();
703 rrcConnectionReconfigurationCompleteMsg = rrcConnectionReconfigurationCompleteHeader.
GetMessage ();
708 rrcConnectionReestablishmentCompleteMsg = rrcConnectionReestablishmentCompleteHeader.
GetMessage ();
713 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.
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.
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.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
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.
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.
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...
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 DoReceivePdcpPdu(uint16_t rnti, Ptr< Packet > p)
Receive PDCP PDU function.
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.