22 #include <ns3/fatal-error.h> 
   24 #include <ns3/nstime.h> 
   25 #include <ns3/node-list.h> 
   27 #include <ns3/simulator.h> 
   44   :  m_ueRrcSapProvider (0),
 
   45     m_enbRrcSapProvider (0)
 
  118   packet->
AddHeader (rrcConnectionRequestHeader);
 
  121   transmitPdcpPduParameters.
pdcpPdu = packet;
 
  123   transmitPdcpPduParameters.
lcid = 0;
 
  134   rrcConnectionSetupCompleteHeader.
SetMessage (msg);
 
  136   packet->
AddHeader (rrcConnectionSetupCompleteHeader);
 
  139   transmitPdcpSduParameters.
pdcpSdu = packet;
 
  141   transmitPdcpSduParameters.
lcid = 1;
 
  160   rrcConnectionReconfigurationCompleteHeader.
SetMessage (msg);
 
  162   packet->
AddHeader (rrcConnectionReconfigurationCompleteHeader);
 
  165   transmitPdcpSduParameters.
pdcpSdu = packet;
 
  167   transmitPdcpSduParameters.
lcid = 1;
 
  185   packet->
AddHeader (measurementReportHeader);
 
  188   transmitPdcpSduParameters.
pdcpSdu = packet;
 
  190   transmitPdcpSduParameters.
lcid = 1;
 
  201   rrcConnectionReestablishmentRequestHeader.
SetMessage (msg);
 
  203   packet->
AddHeader (rrcConnectionReestablishmentRequestHeader);
 
  206   transmitPdcpPduParameters.
pdcpPdu = packet;
 
  208   transmitPdcpPduParameters.
lcid = 0;
 
  219   rrcConnectionReestablishmentCompleteHeader.
SetMessage (msg);
 
  221   packet->
AddHeader (rrcConnectionReestablishmentCompleteHeader);
 
  224   transmitPdcpSduParameters.
pdcpSdu = packet;
 
  226   transmitPdcpSduParameters.
lcid = 1;
 
  235   uint16_t cellId = 
m_rrc->GetCellId ();
 
  242        (i != listEnd) && (!found); 
 
  248            (j < nDevs) && (!found);
 
  266   NS_ASSERT_MSG (found, 
" Unable to find eNB with CellId =" << cellId);
 
  297       rrcConnectionReestablishmentMsg = rrcConnectionReestablishmentHeader.
GetMessage ();
 
  302       p->
RemoveHeader (rrcConnectionReestablishmentRejectHeader);
 
  303       rrcConnectionReestablishmentRejectMsg = rrcConnectionReestablishmentRejectHeader.
GetMessage ();
 
  309       rrcConnectionRejectMsg = rrcConnectionRejectHeader.
GetMessage ();
 
  315       rrcConnectionSetupMsg = rrcConnectionSetupHeader.
GetMessage ();
 
  341       rrcConnectionReconfigurationMsg = rrcConnectionReconfigurationHeader.
GetMessage ();
 
  346       rrcConnectionReleaseMsg = rrcConnectionReleaseHeader.
GetMessage ();
 
  355   :  m_enbRrcSapProvider (0)
 
  371   for (std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator 
 
  376       delete it->second.srb0SapUser;
 
  377       delete it->second.srb1SapUser;
 
  385   static TypeId tid = 
TypeId (
"ns3::LteEnbRrcProtocolReal")
 
  414   std::map<uint16_t, LteUeRrcSapProvider*>::const_iterator it;
 
  423   std::map<uint16_t, LteUeRrcSapProvider*>::iterator it;
 
  472   std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator 
 
  479       completeSetupUeParameters.
srb0SapUser = srb0SapUser;
 
  480       completeSetupUeParameters.
srb1SapUser = srb1SapUser;
 
  486       completeSetupUeParameters = csupIt->second;
 
  495   std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters>::iterator 
 
  498   delete it->second.srb0SapUser;
 
  499   delete it->second.srb1SapUser;
 
  515       for (
int j = 0; j < nDevs; ++j)
 
  521               NS_LOG_LOGIC (
"considering UE IMSI " << ueDev->GetImsi () << 
" that has cellId " << ueRrc->GetCellId ());
 
  522               if (ueRrc->GetCellId () == 
m_cellId)
 
  524                   NS_LOG_LOGIC (
"sending SI to IMSI " << ueDev->GetImsi ());
 
  525                   ueRrc->GetLteUeRrcSapProvider ()->RecvSystemInformation (msg);
 
  528                                        ueRrc->GetLteUeRrcSapProvider (), 
 
  544   packet->
AddHeader (rrcConnectionSetupHeader);
 
  547   transmitPdcpPduParameters.
pdcpPdu = packet;
 
  548   transmitPdcpPduParameters.
rnti = rnti;
 
  549   transmitPdcpPduParameters.
lcid = 0;
 
  553       std::cout << 
"RNTI not found in Enb setup parameters Map!" << std::endl;
 
  569   packet->
AddHeader (rrcConnectionRejectHeader);
 
  572   transmitPdcpPduParameters.
pdcpPdu = packet;
 
  573   transmitPdcpPduParameters.
rnti = rnti;
 
  574   transmitPdcpPduParameters.
lcid = 0;
 
  585   rrcConnectionReconfigurationHeader.
SetMessage (msg);
 
  587   packet->
AddHeader (rrcConnectionReconfigurationHeader);
 
  590   transmitPdcpSduParameters.
pdcpSdu = packet;
 
  591   transmitPdcpSduParameters.
rnti = rnti;
 
  592   transmitPdcpSduParameters.
lcid = 1;
 
  603   rrcConnectionReestablishmentHeader.
SetMessage (msg);
 
  605   packet->
AddHeader (rrcConnectionReestablishmentHeader);
 
  608   transmitPdcpPduParameters.
pdcpPdu = packet;
 
  609   transmitPdcpPduParameters.
rnti = rnti;
 
  610   transmitPdcpPduParameters.
lcid = 0;
 
  621   rrcConnectionReestablishmentRejectHeader.
SetMessage (msg);
 
  623   packet->
AddHeader (rrcConnectionReestablishmentRejectHeader);
 
  626   transmitPdcpPduParameters.
pdcpPdu = packet;
 
  627   transmitPdcpPduParameters.
rnti = rnti;
 
  628   transmitPdcpPduParameters.
lcid = 0;
 
  641   packet->
AddHeader (rrcConnectionReleaseHeader);
 
  644   transmitPdcpSduParameters.
pdcpSdu = packet;
 
  645   transmitPdcpSduParameters.
rnti = rnti;
 
  646   transmitPdcpSduParameters.
lcid = 1;
 
  666       p->
RemoveHeader (rrcConnectionReestablishmentRequestHeader);
 
  668       rrcConnectionReestablishmentRequestMsg = rrcConnectionReestablishmentRequestHeader.
GetMessage ();
 
  674       rrcConnectionRequestMsg = rrcConnectionRequestHeader.
GetMessage ();
 
  704       measurementReportMsg = measurementReportHeader.
GetMessage ();
 
  709       rrcConnectionReconfigurationCompleteMsg = rrcConnectionReconfigurationCompleteHeader.
GetMessage ();
 
  714       rrcConnectionReestablishmentCompleteMsg = rrcConnectionReestablishmentCompleteHeader.
GetMessage ();
 
  719       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. 
 
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)
 
Ptr< Packet > pdcpPdu
the PDCP PDU 
 
LtePdcpSapProvider * srb1SapProvider
 
Simulation virtual time values and global simulation resolution. 
 
void DoSendMeasurementReport(LteRrcSap::MeasurementReport msg)
 
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
 
void DoSendRrcConnectionReject(uint16_t rnti, LteRrcSap::RrcConnectionReject msg)
 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
 
uint16_t GetCellId() const 
 
virtual void DoDispose(void)
Destructor implementation. 
 
void DoSendRrcConnectionRelease(uint16_t rnti, LteRrcSap::RrcConnectionRelease msg)
 
friend class RealProtocolRlcSapUser
 
Part of the RRC protocol. 
 
virtual ~LteEnbRrcProtocolReal()
 
LteRlcSapUser * srb0SapUser
 
#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)
 
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)
 
LteUeRrcSapProvider::CompleteSetupParameters m_completeSetupParameters
 
LteRrcSap::RrcConnectionReconfiguration DoDecodeHandoverCommand(Ptr< Packet > p)
 
Ptr< Packet > DoEncodeHandoverPreparationInformation(LteRrcSap::HandoverPreparationInfo msg)
 
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
 
LteUeRrcSapProvider * GetUeRrcSapProvider(uint16_t rnti)
 
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
 
LteRrcSap::HandoverPreparationInfo GetMessage() const 
Returns a HandoverPreparationInfo IE from the values in the class attributes. 
 
std::map< uint16_t, LteUeRrcSapProvider * > m_enbRrcSapProviderMap
 
LteUeRrcSapUser * m_ueRrcSapUser
 
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)
 
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)
 
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)
 
void DoSendRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
 
static Iterator End(void)
 
const Time RRC_REAL_MSG_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
 
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)
 
uint16_t rnti
the C-RNTI identifying the UE 
 
Ptr< NetDevice > GetDevice(uint32_t index) const 
Retrieve the index-th NetDevice associated to this node. 
 
This class only serves to discriminate which message type has been received in downlink (eNb to ue) f...
 
Parameters for LtePdcpSapProvider::TransmitPdcpSdu. 
 
void SetEnbRrcSapProvider()
 
LteEnbRrcSapUser * GetLteEnbRrcSapUser()
 
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC. 
 
uint8_t lcid
the logical channel id corresponding to the sending RLC instance 
 
uint32_t GetNDevices(void) const 
 
uint32_t PeekHeader(Header &header) const 
Deserialize but does not remove the header from the internal buffer. 
 
Part of the RRC protocol. 
 
void DoSendRrcConnectionReestablishmentReject(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentReject msg)
 
Ptr< LteEnbRrc > GetRrc() const 
 
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. 
 
virtual void CompleteSetup(CompleteSetupParameters params)=0
 
void DoSendRrcConnectionReconfiguration(uint16_t rnti, LteRrcSap::RrcConnectionReconfiguration msg)
 
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)
 
This class manages the serialization/deserialization of HandoverPreparationInfo IE. 
 
LtePdcpSapUser * srb1SapUser
 
LteEnbRrcSapProvider * m_enbRrcSapProvider
 
virtual void RecvSystemInformation(SystemInformation msg)=0
Receive a SystemInformation message from the serving eNodeB during a system information acquisition p...
 
LteRlcSapUser * srb0SapUser
 
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
 
void SetMessage(LteRrcSap::HandoverPreparationInfo msg)
Receives a HandoverPreparationInfo IE and stores the contents into the class attributes. 
 
void DoSendRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
 
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)
 
Parameters for LteRlcSapProvider::TransmitPdcpPdu. 
 
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
 
void DoSendRrcConnectionReconfigurationCompleted(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
 
static TypeId GetTypeId(void)
 
LteUeRrcSapUser::SetupParameters m_setupParameters
 
void DoSendRrcConnectionRequest(LteRrcSap::RrcConnectionRequest msg)
 
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)
 
LteRlcSapProvider * srb0SapProvider
 
LteEnbRrcSapUser * m_enbRrcSapUser
 
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)
 
LteEnbRrcSapProvider * m_enbRrcSapProvider
 
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
 
void SetCellId(uint16_t cellId)
 
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
 
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()
 
Part of the RRC protocol. 
 
LteEnbRrcProtocolReal * m_pdcp
 
uint8_t lcid
the logical channel id corresponding to the sending RLC instance 
 
void SetLteUeRrcSapProvider(LteUeRrcSapProvider *p)
 
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. 
 
TypeId SetParent(TypeId tid)
Set the parent TypeId. 
 
void DoSetupUe(uint16_t rnti, LteEnbRrcSapUser::SetupUeParameters params)
 
void DoRemoveUe(uint16_t rnti)
 
void SetUeRrc(Ptr< LteUeRrc > rrc)
 
void AddHeader(const Header &header)
Add header to this packet. 
 
The LteUeNetDevice class implements the UE net device. 
 
void DoSendSystemInformation(LteRrcSap::SystemInformation msg)