14#include "ns3/inet-socket-address.h"
17#include "ns3/packet.h"
151 "Mapping for remoteCellId = " <<
remoteCellId <<
" is already known");
160 <<
" is already known");
164 "Mapping for data plane localSocket = " <<
localX2uSocket <<
" is already known");
178 "Missing infos of local and remote CellId");
203 params.sourceCellId =
cellsInfo->m_remoteCellIds.at(0);
206 params.ueAggregateMaxBitRateDownlink =
x2HoReqHeader.GetUeAggregateMaxBitRateDownlink();
207 params.ueAggregateMaxBitRateUplink =
x2HoReqHeader.GetUeAggregateMaxBitRateUplink();
209 params.rrcContext = packet;
211 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
231 params.sourceCellId =
cellsInfo->m_localCellIds.at(0);
232 params.targetCellId =
cellsInfo->m_remoteCellIds.at(0);
235 params.rrcContext = packet;
237 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
238 NS_LOG_LOGIC(
"newEnbUeX2apId = " << params.newEnbUeX2apId);
246 NS_LOG_LOGIC(
"Recv X2 message: HANDOVER PREPARATION FAILURE");
255 params.sourceCellId =
cellsInfo->m_localCellIds.at(0);
256 params.targetCellId =
cellsInfo->m_remoteCellIds.at(0);
260 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
264 NS_LOG_LOGIC(
"criticalityDiagnostics = " << params.criticalityDiagnostics);
283 NS_LOG_LOGIC(
"cellInformationList size = " << params.cellInformationList.size());
302 params.sourceCellId =
cellsInfo->m_remoteCellIds.at(0);
303 params.targetCellId =
cellsInfo->m_localCellIds.at(0);
304 params.erabsSubjectToStatusTransferList =
307 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
308 NS_LOG_LOGIC(
"newEnbUeX2apId = " << params.newEnbUeX2apId);
311 NS_LOG_LOGIC(
"erabsList size = " << params.erabsSubjectToStatusTransferList.size());
331 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
332 NS_LOG_LOGIC(
"newEnbUeX2apId = " << params.newEnbUeX2apId);
341 NS_LOG_LOGIC(
"Recv X2 message: RESOURCE STATUS UPDATE");
349 params.targetCellId = 0;
354 NS_LOG_LOGIC(
"enb1MeasurementId = " << params.enb1MeasurementId);
355 NS_LOG_LOGIC(
"enb2MeasurementId = " << params.enb2MeasurementId);
357 "cellMeasurementResultList size = " << params.cellMeasurementResultList.size());
376 params.sourceCellId =
cellsInfo->m_localCellIds.at(0);
377 params.targetCellId =
cellsInfo->m_remoteCellIds.at(0);
380 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
381 NS_LOG_LOGIC(
"newEnbUeX2apId = " << params.newEnbUeX2apId);
400 NS_LOG_LOGIC(
"Recv UE DATA through X2-U interface from Socket");
405 "Missing infos of local and remote CellId");
409 packet->RemoveHeader(
gtpu);
414 params.sourceCellId =
cellsInfo->m_remoteCellIds.at(0);
415 params.targetCellId =
cellsInfo->m_localCellIds.at(0);
416 params.gtpTeid =
gtpu.GetTeid();
417 params.ueData = packet;
430 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
436 "Missing infos for targetCellId = " << params.targetCellId);
452 x2HoReqHeader.SetUeAggregateMaxBitRateDownlink(params.ueAggregateMaxBitRateDownlink);
453 x2HoReqHeader.SetUeAggregateMaxBitRateUplink(params.ueAggregateMaxBitRateUplink);
480 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
481 NS_LOG_LOGIC(
"newEnbUeX2apId = " << params.newEnbUeX2apId);
486 "Socket infos not defined for sourceCellId = " << params.sourceCellId);
494 NS_LOG_INFO(
"Send X2 message: HANDOVER REQUEST ACK");
501 x2HoAckHeader.SetNotAdmittedBearers(params.notAdmittedBearers);
528 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
532 NS_LOG_LOGIC(
"criticalityDiagnostics = " << params.criticalityDiagnostics);
535 "Socket infos not defined for sourceCellId = " << params.sourceCellId);
543 NS_LOG_INFO(
"Send X2 message: HANDOVER PREPARATION FAILURE");
575 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
576 NS_LOG_LOGIC(
"newEnbUeX2apId = " << params.newEnbUeX2apId);
579 NS_LOG_LOGIC(
"erabsList size = " << params.erabsSubjectToStatusTransferList.size());
582 "Socket infos not defined for targetCellId = " << params.targetCellId);
590 NS_LOG_INFO(
"Send X2 message: SN STATUS TRANSFER");
597 params.erabsSubjectToStatusTransferList);
623 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
624 NS_LOG_LOGIC(
"newEnbUeX2apId = " << params.newEnbUeX2apId);
628 "Socket infos not defined for sourceCellId = " << params.sourceCellId);
636 NS_LOG_INFO(
"Send X2 message: UE CONTEXT RELEASE");
668 NS_LOG_LOGIC(
"cellInformationList size = " << params.cellInformationList.size());
671 "Missing infos for targetCellId = " << params.targetCellId);
710 NS_LOG_LOGIC(
"enb1MeasurementId = " << params.enb1MeasurementId);
711 NS_LOG_LOGIC(
"enb2MeasurementId = " << params.enb2MeasurementId);
712 NS_LOG_LOGIC(
"cellMeasurementResultList size = " << params.cellMeasurementResultList.size());
715 "Missing infos for targetCellId = " << params.targetCellId);
723 NS_LOG_INFO(
"Send X2 message: RESOURCE STATUS UPDATE");
760 "Missing infos for targetCellId = " << params.targetCellId);
770 gtpu.SetLength(params.ueData->GetSize() +
gtpu.GetSerializedSize() -
775 packet->AddHeader(
gtpu);
777 NS_LOG_INFO(
"Forward UE DATA through X2 interface");
786 NS_LOG_LOGIC(
"oldEnbUeX2apId = " << params.oldEnbUeX2apId);
787 NS_LOG_LOGIC(
"newEnbUeX2apId = " << params.newEnbUeX2apId);
792 "Socket infos not defined for targetCellId = " << params.targetCellId);
EpcX2HandoverCancelHeader.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
EpcX2HandoverPreparationFailureHeader.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
EpcX2HandoverRequestAckHeader.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
EpcX2HandoverRequestHeader.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB X2 AP ID function.
This entity is installed inside an eNB and provides the functionality for the X2 interface.
EpcX2SapUser * m_x2SapUser
X2 SAP user.
virtual void DoSendHandoverRequestAck(EpcX2SapProvider::HandoverRequestAckParams params)
Send handover request ack function.
EpcX2SapProvider * m_x2SapProvider
X2 SAP provider.
virtual void DoSendUeContextRelease(EpcX2SapProvider::UeContextReleaseParams params)
Send UE context release function.
void DoDispose() override
Destructor implementation.
void AddX2Interface(uint16_t enb1CellId, Ipv4Address enb1X2Address, std::vector< uint16_t > enb2CellIds, Ipv4Address enb2X2Address)
Add an X2 interface to this EPC X2 entity.
std::map< uint16_t, Ptr< X2IfaceInfo > > m_x2InterfaceSockets
Map the targetCellId to the corresponding (sourceSocket, remoteIpAddr) to be used to send the X2 mess...
virtual void DoSendResourceStatusUpdate(EpcX2SapProvider::ResourceStatusUpdateParams params)
Send resource status update function.
friend class EpcX2SpecificEpcX2SapProvider< EpcX2 >
allow EpcX2SpecificEpcX2SapProvider<EpcX2> class friend access
virtual void DoSendHandoverPreparationFailure(EpcX2SapProvider::HandoverPreparationFailureParams params)
Send handover preparation failure function.
void RecvFromX2cSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the X2-C (X2 Control Plane) socket.
~EpcX2() override
Destructor.
virtual void DoSendHandoverRequest(EpcX2SapProvider::HandoverRequestParams params)
Send handover request function.
static TypeId GetTypeId()
Get the type ID.
std::map< Ptr< Socket >, Ptr< X2CellInfo > > m_x2InterfaceCellIds
Map the localSocket (the one receiving the X2 message) to the corresponding (sourceCellId,...
virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params)
Send UE data function.
EpcX2SapProvider * GetEpcX2SapProvider()
uint16_t m_x2uUdpPort
UDP ports to be used for the X2-U interface.
uint16_t m_x2cUdpPort
UDP ports to be used for the X2-C interface.
virtual void DoSendLoadInformation(EpcX2SapProvider::LoadInformationParams params)
Send load information function.
virtual void DoSendSnStatusTransfer(EpcX2SapProvider::SnStatusTransferParams params)
Send SN status transfer function.
void SetEpcX2SapUser(EpcX2SapUser *s)
virtual void DoSendHandoverCancel(EpcX2SapProvider::HandoverCancelParams params)
Send Handover Cancel function.
void RecvFromX2uSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the X2-U (X2 User Plane) socket.
These service primitives of this part of the X2 SAP are provided by the X2 entity and issued by RRC e...
These service primitives of this part of the X2 SAP are provided by the RRC entity and issued by the ...
virtual void RecvUeData(UeDataParams params)=0
Receive UE data function.
virtual void RecvUeContextRelease(UeContextReleaseParams params)=0
Receive UE context release function.
virtual void RecvHandoverCancel(HandoverCancelParams params)=0
Receive handover cancel function.
virtual void RecvSnStatusTransfer(SnStatusTransferParams params)=0
Receive SN status transfer function.
virtual void RecvLoadInformation(LoadInformationParams params)=0
Receive load information function.
virtual void RecvHandoverRequestAck(HandoverRequestAckParams params)=0
Receive handover request ack function.
virtual void RecvResourceStatusUpdate(ResourceStatusUpdateParams params)=0
Receive resource status update function.
virtual void RecvHandoverPreparationFailure(HandoverPreparationFailureParams params)=0
Receive handover preparation failure function.
virtual void RecvHandoverRequest(HandoverRequestParams params)=0
Receive handover request function.
Ipv4 addresses are stored in host order in this class.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
a unique identifier for an interface.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
X2CellInfo & operator=(const X2CellInfo &value)
Assignment operator.
std::vector< uint16_t > m_remoteCellIds
remote cell IDs
X2CellInfo(std::vector< uint16_t > localCellIds, std::vector< uint16_t > remoteCellIds)
Constructor.
std::vector< uint16_t > m_localCellIds
local cell IDs
Ptr< Socket > m_localCtrlPlaneSocket
local control plane socket
Ipv4Address m_remoteIpAddr
remote IP address
X2IfaceInfo & operator=(const X2IfaceInfo &value)
Assignment operator.
X2IfaceInfo(Ipv4Address remoteIpAddr, Ptr< Socket > localCtrlPlaneSocket, Ptr< Socket > localUserPlaneSocket)
Constructor.
Ptr< Socket > m_localUserPlaneSocket
local user plane socket
#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_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static unsigned int value(char c)
Parameters of the HANDOVER CANCEL message.
Parameters of the HANDOVER PREPARATION FAILURE message.
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Parameters of the HANDOVER REQUEST message.
Parameters of the RESOURCE STATUS UPDATE message.
Parameters of the SN STATUS TRANSFER message.
Parameters of the UE CONTEXT RELEASE message.
Parameters of the UE DATA primitive.