merge
This commit is contained in:
@@ -48,8 +48,7 @@ NS_OBJECT_ENSURE_REGISTERED (EpcHelper);
|
||||
|
||||
|
||||
EpcHelper::EpcHelper ()
|
||||
: m_gtpuUdpPort (2152), // fixed by the standard
|
||||
m_x2cUdpPort (4444) // fixed by the standard TODO
|
||||
: m_gtpuUdpPort (2152) // fixed by the standard
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
@@ -260,35 +259,22 @@ EpcHelper::AddX2Interface (Ptr<Node> enb1, Ptr<Node> enb2)
|
||||
NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #1 after assigning Ipv4 addr to X2 dev: " << enb1->GetObject<Ipv4> ()->GetNInterfaces ());
|
||||
NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #2 after assigning Ipv4 addr to X2 dev: " << enb2->GetObject<Ipv4> ()->GetNInterfaces ());
|
||||
|
||||
Ipv4Address enb1Address = enbIpIfaces.GetAddress (0);
|
||||
Ipv4Address enb2Address = enbIpIfaces.GetAddress (1);
|
||||
Ipv4Address enb1X2Address = enbIpIfaces.GetAddress (0);
|
||||
Ipv4Address enb2X2Address = enbIpIfaces.GetAddress (1);
|
||||
|
||||
// Create X2-C socket for the eNB1
|
||||
Ptr<Socket> enb1X2cSocket = Socket::CreateSocket (enb1, TypeId::LookupByName ("ns3::UdpSocketFactory"));
|
||||
int retval = enb1X2cSocket->Bind (InetSocketAddress (enb1Address, m_x2cUdpPort));
|
||||
NS_ASSERT (retval == 0);
|
||||
|
||||
// Create X2-C socket for the eNB2
|
||||
Ptr<Socket> enb2X2cSocket = Socket::CreateSocket (enb2, TypeId::LookupByName ("ns3::UdpSocketFactory"));
|
||||
retval = enb2X2cSocket->Bind (InetSocketAddress (enb2Address, m_x2cUdpPort));
|
||||
NS_ASSERT (retval == 0);
|
||||
|
||||
|
||||
// Add X2 interface to the eNB1's X2 entity
|
||||
// Add X2 interface to both eNBs' X2 entities
|
||||
Ptr<EpcX2> enb1X2 = enb1->GetObject<EpcX2> ();
|
||||
Ptr<LteEnbNetDevice> enb1LteDev = enb1->GetDevice (0)->GetObject<LteEnbNetDevice> ();
|
||||
uint16_t enb1CellId = enb1LteDev->GetCellId ();
|
||||
NS_LOG_LOGIC ("LteEnbNetDevice #1 = " << enb1LteDev << " - CellId = " << enb1CellId);
|
||||
|
||||
// Add X2 interface to the eNB2's X2 entity
|
||||
Ptr<EpcX2> enb2X2 = enb2->GetObject<EpcX2> ();
|
||||
Ptr<LteEnbNetDevice> enb2LteDev = enb2->GetDevice (0)->GetObject<LteEnbNetDevice> ();
|
||||
uint16_t enb2CellId = enb2LteDev->GetCellId ();
|
||||
NS_LOG_LOGIC ("LteEnbNetDevice #2 = " << enb2LteDev << " - CellId = " << enb2CellId);
|
||||
|
||||
enb1X2->AddX2Interface (enb1CellId, enb1X2cSocket, enb2CellId, enb2X2cSocket);
|
||||
enb2X2->AddX2Interface (enb2CellId, enb2X2cSocket, enb1CellId, enb1X2cSocket);
|
||||
|
||||
enb1X2->AddX2Interface (enb1CellId, enb1X2Address, enb2CellId, enb2X2Address);
|
||||
enb2X2->AddX2Interface (enb2CellId, enb2X2Address, enb1CellId, enb1X2Address);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -182,11 +182,6 @@ private:
|
||||
Time m_x2LinkDelay;
|
||||
uint16_t m_x2LinkMtu;
|
||||
|
||||
/**
|
||||
* UDP port where the GTP-U Socket is bound, fixed by the standard as 2152 TODO Check value in the spec
|
||||
*/
|
||||
uint16_t m_x2cUdpPort;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -316,6 +316,20 @@ public:
|
||||
std::vector <CellMeasurementResultItem> cellMeasurementResultList;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Parameters of the UE DATA primitive
|
||||
*
|
||||
* Forward UE data during the handover procedure from source eNB (sourceCellId)
|
||||
* to target eNB (targetCellId) using a GTP-U tunnel (gtpTeid)
|
||||
*/
|
||||
struct UeDataParams
|
||||
{
|
||||
uint16_t sourceCellId;
|
||||
uint16_t targetCellId;
|
||||
uint32_t gtpTeid;
|
||||
Ptr<Packet> ueData;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -345,6 +359,8 @@ public:
|
||||
virtual void SendLoadInformation (LoadInformationParams params) = 0;
|
||||
|
||||
virtual void SendResourceStatusUpdate (ResourceStatusUpdateParams params) = 0;
|
||||
|
||||
virtual void SendUeData (UeDataParams params) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -374,6 +390,8 @@ public:
|
||||
virtual void RecvLoadInformation (LoadInformationParams params) = 0;
|
||||
|
||||
virtual void RecvResourceStatusUpdate (ResourceStatusUpdateParams params) = 0;
|
||||
|
||||
virtual void RecvUeData (UeDataParams params) = 0;
|
||||
};
|
||||
|
||||
///////////////////////////////////////
|
||||
@@ -402,6 +420,8 @@ public:
|
||||
|
||||
virtual void SendResourceStatusUpdate (ResourceStatusUpdateParams params);
|
||||
|
||||
virtual void SendUeData (UeDataParams params);
|
||||
|
||||
private:
|
||||
EpcX2SpecificEpcX2SapProvider ();
|
||||
C* m_x2;
|
||||
@@ -467,6 +487,13 @@ EpcX2SpecificEpcX2SapProvider<C>::SendResourceStatusUpdate (ResourceStatusUpdate
|
||||
m_x2->DoSendResourceStatusUpdate (params);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
void
|
||||
EpcX2SpecificEpcX2SapProvider<C>::SendUeData (UeDataParams params)
|
||||
{
|
||||
m_x2->DoSendUeData (params);
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
template <class C>
|
||||
@@ -493,6 +520,8 @@ public:
|
||||
|
||||
virtual void RecvResourceStatusUpdate (ResourceStatusUpdateParams params);
|
||||
|
||||
virtual void RecvUeData (UeDataParams params);
|
||||
|
||||
private:
|
||||
EpcX2SpecificEpcX2SapUser ();
|
||||
C* m_rrc;
|
||||
@@ -558,6 +587,13 @@ EpcX2SpecificEpcX2SapUser<C>::RecvResourceStatusUpdate (ResourceStatusUpdatePara
|
||||
m_rrc->DoRecvResourceStatusUpdate (params);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
void
|
||||
EpcX2SpecificEpcX2SapUser<C>::RecvUeData (UeDataParams params)
|
||||
{
|
||||
m_rrc->DoRecvUeData (params);
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
#endif // EPC_X2_SAP_H
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "ns3/inet-socket-address.h"
|
||||
#include "ns3/packet.h"
|
||||
#include "ns3/node.h"
|
||||
#include "ns3/lte-enb-net-device.h"
|
||||
#include "ns3/epc-gtpu-header.h"
|
||||
|
||||
#include "ns3/epc-x2-header.h"
|
||||
#include "ns3/epc-x2.h"
|
||||
@@ -32,23 +32,26 @@ NS_LOG_COMPONENT_DEFINE ("EpcX2");
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
X2IfaceInfo::X2IfaceInfo (Ptr<Socket> localSocket, Ipv4Address remoteIpAddr)
|
||||
X2IfaceInfo::X2IfaceInfo (Ipv4Address remoteIpAddr, Ptr<Socket> localCtrlPlaneSocket, Ptr<Socket> localUserPlaneSocket)
|
||||
{
|
||||
m_localSocket = localSocket;
|
||||
m_remoteIpAddr = remoteIpAddr;
|
||||
m_localCtrlPlaneSocket = localCtrlPlaneSocket;
|
||||
m_localUserPlaneSocket = localUserPlaneSocket;
|
||||
}
|
||||
|
||||
X2IfaceInfo::~X2IfaceInfo (void)
|
||||
{
|
||||
m_localSocket = 0;
|
||||
m_localCtrlPlaneSocket = 0;
|
||||
m_localUserPlaneSocket = 0;
|
||||
}
|
||||
|
||||
X2IfaceInfo&
|
||||
X2IfaceInfo::operator= (const X2IfaceInfo& value)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_localSocket = value.m_localSocket;
|
||||
m_remoteIpAddr = value.m_remoteIpAddr;
|
||||
m_localCtrlPlaneSocket = value.m_localCtrlPlaneSocket;
|
||||
m_localUserPlaneSocket = value.m_localUserPlaneSocket;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -80,7 +83,8 @@ X2CellInfo::operator= (const X2CellInfo& value)
|
||||
NS_OBJECT_ENSURE_REGISTERED (EpcX2);
|
||||
|
||||
EpcX2::EpcX2 ()
|
||||
: m_x2cUdpPort (4444)
|
||||
: m_x2cUdpPort (4444),
|
||||
m_x2uUdpPort (2152)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
@@ -126,32 +130,39 @@ EpcX2::GetEpcX2SapProvider ()
|
||||
|
||||
|
||||
void
|
||||
EpcX2::AddX2Interface (uint16_t enb1CellId, Ptr<Socket> enb1X2cSocket, uint16_t enb2CellId, Ptr<Socket> enb2X2cSocket)
|
||||
EpcX2::AddX2Interface (uint16_t localCellId, Ipv4Address localX2Address, uint16_t remoteCellId, Ipv4Address remoteX2Address)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << enb1CellId << enb1X2cSocket << enb2CellId << enb2X2cSocket);
|
||||
NS_LOG_FUNCTION (this << localCellId << localX2Address << remoteCellId << remoteX2Address);
|
||||
|
||||
Address addr;
|
||||
int retval;
|
||||
|
||||
retval = enb1X2cSocket->GetSockName (addr);
|
||||
// Get local eNB where this X2 entity belongs to
|
||||
Ptr<Node> localEnb = GetObject<Node> ();
|
||||
|
||||
// Create X2-C socket for the local eNB
|
||||
Ptr<Socket> localX2cSocket = Socket::CreateSocket (localEnb, TypeId::LookupByName ("ns3::UdpSocketFactory"));
|
||||
retval = localX2cSocket->Bind (InetSocketAddress (localX2Address, m_x2cUdpPort));
|
||||
NS_ASSERT (retval == 0);
|
||||
InetSocketAddress localInetAddr = InetSocketAddress::ConvertFrom (addr);
|
||||
NS_LOG_LOGIC ("local IP address = " << localInetAddr.GetIpv4 ());
|
||||
localX2cSocket->SetRecvCallback (MakeCallback (&EpcX2::RecvFromX2cSocket, this));
|
||||
|
||||
retval = enb2X2cSocket->GetSockName (addr);
|
||||
// Create X2-U socket for the local eNB
|
||||
Ptr<Socket> localX2uSocket = Socket::CreateSocket (localEnb, TypeId::LookupByName ("ns3::UdpSocketFactory"));
|
||||
retval = localX2uSocket->Bind (InetSocketAddress (localX2Address, m_x2uUdpPort));
|
||||
NS_ASSERT (retval == 0);
|
||||
InetSocketAddress remoteInetAddr = InetSocketAddress::ConvertFrom (addr);
|
||||
NS_LOG_LOGIC ("remote IP address = " << remoteInetAddr.GetIpv4 ());
|
||||
localX2uSocket->SetRecvCallback (MakeCallback (&EpcX2::RecvFromX2uSocket, this));
|
||||
|
||||
enb1X2cSocket->SetRecvCallback (MakeCallback (&EpcX2::RecvFromX2cSocket, this));
|
||||
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (enb2CellId) == m_x2InterfaceSockets.end (),
|
||||
"Mapping for remoteCellId = " << enb2CellId << " is already known");
|
||||
m_x2InterfaceSockets [enb2CellId] = Create<X2IfaceInfo> (enb1X2cSocket, remoteInetAddr.GetIpv4 ());
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (remoteCellId) == m_x2InterfaceSockets.end (),
|
||||
"Mapping for remoteCellId = " << remoteCellId << " is already known");
|
||||
m_x2InterfaceSockets [remoteCellId] = Create<X2IfaceInfo> (remoteX2Address, localX2cSocket, localX2uSocket);
|
||||
|
||||
NS_ASSERT_MSG (m_x2InterfaceCellIds.find (enb1X2cSocket) == m_x2InterfaceCellIds.end (),
|
||||
"Mapping for localSocket = " << enb1X2cSocket << " is already known");
|
||||
m_x2InterfaceCellIds [enb1X2cSocket] = Create<X2CellInfo> (enb1CellId, enb2CellId);
|
||||
NS_ASSERT_MSG (m_x2InterfaceCellIds.find (localX2cSocket) == m_x2InterfaceCellIds.end (),
|
||||
"Mapping for control plane localSocket = " << localX2cSocket << " is already known");
|
||||
m_x2InterfaceCellIds [localX2cSocket] = Create<X2CellInfo> (localCellId, remoteCellId);
|
||||
|
||||
NS_ASSERT_MSG (m_x2InterfaceCellIds.find (localX2uSocket) == m_x2InterfaceCellIds.end (),
|
||||
"Mapping for data plane localSocket = " << localX2uSocket << " is already known");
|
||||
m_x2InterfaceCellIds [localX2uSocket] = Create<X2CellInfo> (localCellId, remoteCellId);
|
||||
}
|
||||
|
||||
|
||||
@@ -354,6 +365,35 @@ EpcX2::RecvFromX2cSocket (Ptr<Socket> socket)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
EpcX2::RecvFromX2uSocket (Ptr<Socket> socket)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << socket);
|
||||
|
||||
NS_LOG_LOGIC ("Recv UE DATA through X2-U interface from Socket");
|
||||
Ptr<Packet> packet = socket->Recv ();
|
||||
NS_LOG_LOGIC ("packetLen = " << packet->GetSize ());
|
||||
|
||||
NS_ASSERT_MSG (m_x2InterfaceCellIds.find (socket) != m_x2InterfaceCellIds.end (),
|
||||
"Missing infos of local and remote CellId");
|
||||
Ptr<X2CellInfo> cellsInfo = m_x2InterfaceCellIds [socket];
|
||||
|
||||
GtpuHeader gtpu;
|
||||
packet->RemoveHeader (gtpu);
|
||||
|
||||
NS_LOG_LOGIC ("GTP-U header: " << gtpu);
|
||||
|
||||
EpcX2SapUser::UeDataParams params;
|
||||
params.sourceCellId = cellsInfo->m_remoteCellId;
|
||||
params.targetCellId = cellsInfo->m_localCellId;
|
||||
params.gtpTeid = gtpu.GetTeid ();
|
||||
params.ueData = packet;
|
||||
|
||||
m_x2SapUser->RecvUeData (params);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Implementation of the X2 SAP Provider
|
||||
//
|
||||
@@ -370,7 +410,7 @@ EpcX2::DoSendHandoverRequest (EpcX2SapProvider::HandoverRequestParams params)
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.targetCellId) != m_x2InterfaceSockets.end (),
|
||||
"Missing infos for targetCellId = " << params.targetCellId);
|
||||
Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets [params.targetCellId];
|
||||
Ptr<Socket> sourceSocket = socketInfo->m_localSocket;
|
||||
Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
|
||||
Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
|
||||
|
||||
NS_LOG_LOGIC ("sourceSocket = " << sourceSocket);
|
||||
@@ -421,7 +461,7 @@ EpcX2::DoSendHandoverRequestAck (EpcX2SapProvider::HandoverRequestAckParams para
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.sourceCellId) != m_x2InterfaceSockets.end (),
|
||||
"Socket infos not defined for sourceCellId = " << params.sourceCellId);
|
||||
|
||||
Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localSocket;
|
||||
Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localCtrlPlaneSocket;
|
||||
Ipv4Address remoteIpAddr = m_x2InterfaceSockets [params.sourceCellId]->m_remoteIpAddr;
|
||||
|
||||
NS_LOG_LOGIC ("localSocket = " << localSocket);
|
||||
@@ -471,7 +511,7 @@ EpcX2::DoSendHandoverPreparationFailure (EpcX2SapProvider::HandoverPreparationFa
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.sourceCellId) != m_x2InterfaceSockets.end (),
|
||||
"Socket infos not defined for sourceCellId = " << params.sourceCellId);
|
||||
|
||||
Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localSocket;
|
||||
Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localCtrlPlaneSocket;
|
||||
Ipv4Address remoteIpAddr = m_x2InterfaceSockets [params.sourceCellId]->m_remoteIpAddr;
|
||||
|
||||
NS_LOG_LOGIC ("localSocket = " << localSocket);
|
||||
@@ -519,7 +559,7 @@ EpcX2::DoSendSnStatusTransfer (EpcX2SapProvider::SnStatusTransferParams params)
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.targetCellId) != m_x2InterfaceSockets.end (),
|
||||
"Socket infos not defined for targetCellId = " << params.targetCellId);
|
||||
|
||||
Ptr<Socket> localSocket = m_x2InterfaceSockets [params.targetCellId]->m_localSocket;
|
||||
Ptr<Socket> localSocket = m_x2InterfaceSockets [params.targetCellId]->m_localCtrlPlaneSocket;
|
||||
Ipv4Address remoteIpAddr = m_x2InterfaceSockets [params.targetCellId]->m_remoteIpAddr;
|
||||
|
||||
NS_LOG_LOGIC ("localSocket = " << localSocket);
|
||||
@@ -565,7 +605,7 @@ EpcX2::DoSendUeContextRelease (EpcX2SapProvider::UeContextReleaseParams params)
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.sourceCellId) != m_x2InterfaceSockets.end (),
|
||||
"Socket infos not defined for sourceCellId = " << params.sourceCellId);
|
||||
|
||||
Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localSocket;
|
||||
Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localCtrlPlaneSocket;
|
||||
Ipv4Address remoteIpAddr = m_x2InterfaceSockets [params.sourceCellId]->m_remoteIpAddr;
|
||||
|
||||
NS_LOG_LOGIC ("localSocket = " << localSocket);
|
||||
@@ -609,7 +649,7 @@ EpcX2::DoSendLoadInformation (EpcX2SapProvider::LoadInformationParams params)
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.targetCellId) != m_x2InterfaceSockets.end (),
|
||||
"Missing infos for targetCellId = " << params.targetCellId);
|
||||
Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets [params.targetCellId];
|
||||
Ptr<Socket> sourceSocket = socketInfo->m_localSocket;
|
||||
Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
|
||||
Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
|
||||
|
||||
NS_LOG_LOGIC ("sourceSocket = " << sourceSocket);
|
||||
@@ -655,7 +695,7 @@ EpcX2::DoSendResourceStatusUpdate (EpcX2SapProvider::ResourceStatusUpdateParams
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.targetCellId) != m_x2InterfaceSockets.end (),
|
||||
"Missing infos for targetCellId = " << params.targetCellId);
|
||||
Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets [params.targetCellId];
|
||||
Ptr<Socket> sourceSocket = socketInfo->m_localSocket;
|
||||
Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
|
||||
Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
|
||||
|
||||
NS_LOG_LOGIC ("sourceSocket = " << sourceSocket);
|
||||
@@ -690,4 +730,34 @@ EpcX2::DoSendResourceStatusUpdate (EpcX2SapProvider::ResourceStatusUpdateParams
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
EpcX2::DoSendUeData (EpcX2SapProvider::UeDataParams params)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
|
||||
NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
|
||||
NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid);
|
||||
|
||||
NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.targetCellId) != m_x2InterfaceSockets.end (),
|
||||
"Missing infos for targetCellId = " << params.targetCellId);
|
||||
Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets [params.targetCellId];
|
||||
Ptr<Socket> sourceSocket = socketInfo->m_localUserPlaneSocket;
|
||||
Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
|
||||
|
||||
NS_LOG_LOGIC ("sourceSocket = " << sourceSocket);
|
||||
NS_LOG_LOGIC ("targetIpAddr = " << targetIpAddr);
|
||||
|
||||
GtpuHeader gtpu;
|
||||
gtpu.SetTeid (params.gtpTeid);
|
||||
gtpu.SetLength (params.ueData->GetSize () + gtpu.GetSerializedSize () - 8); // TODO This should be done in GtpuHeader
|
||||
NS_LOG_INFO ("GTP-U header: " << gtpu);
|
||||
|
||||
Ptr<Packet> packet = params.ueData;
|
||||
packet->AddHeader (gtpu);
|
||||
|
||||
NS_LOG_INFO ("Forward UE DATA through X2 interface");
|
||||
sourceSocket->SendTo (packet, 0, InetSocketAddress (targetIpAddr, m_x2uUdpPort));
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -36,14 +36,15 @@ namespace ns3 {
|
||||
class X2IfaceInfo : public SimpleRefCount<X2IfaceInfo>
|
||||
{
|
||||
public:
|
||||
X2IfaceInfo (Ptr<Socket> localSocket, Ipv4Address remoteIpAddr);
|
||||
X2IfaceInfo (Ipv4Address remoteIpAddr, Ptr<Socket> localCtrlPlaneSocket, Ptr<Socket> localUserPlaneSocket);
|
||||
virtual ~X2IfaceInfo (void);
|
||||
|
||||
|
||||
X2IfaceInfo& operator= (const X2IfaceInfo &);
|
||||
|
||||
public:
|
||||
Ptr<Socket> m_localSocket;
|
||||
Ipv4Address m_remoteIpAddr;
|
||||
Ptr<Socket> m_localCtrlPlaneSocket;
|
||||
Ptr<Socket> m_localUserPlaneSocket;
|
||||
};
|
||||
|
||||
|
||||
@@ -52,7 +53,7 @@ class X2CellInfo : public SimpleRefCount<X2CellInfo>
|
||||
public:
|
||||
X2CellInfo (uint16_t localCellId, uint16_t remoteCellId);
|
||||
virtual ~X2CellInfo (void);
|
||||
|
||||
|
||||
X2CellInfo& operator= (const X2CellInfo &);
|
||||
|
||||
public:
|
||||
@@ -99,17 +100,25 @@ public:
|
||||
/**
|
||||
* \param s the X2 SAP Provider interface offered by this EPC X2 entity
|
||||
*/
|
||||
void AddX2Interface (uint16_t enb1CellId, Ptr<Socket> enb1X2cSocket, uint16_t enb2CellId, Ptr<Socket> enb2X2cSocket);
|
||||
void AddX2Interface (uint16_t enb1CellId, Ipv4Address enb1X2Address, uint16_t enb2CellId, Ipv4Address enb2X2Address);
|
||||
|
||||
|
||||
/**
|
||||
* Method to be assigned to the recv callback of the X2 socket.
|
||||
* It is called when the eNB receives a packet from the peer eNB of the X2 interface
|
||||
* Method to be assigned to the recv callback of the X2-C (X2 Control Plane) socket.
|
||||
* It is called when the eNB receives a packet from the peer eNB of the X2-C interface
|
||||
*
|
||||
* \param socket socket of the X2 interface
|
||||
* \param socket socket of the X2-C interface
|
||||
*/
|
||||
void RecvFromX2cSocket (Ptr<Socket> socket);
|
||||
|
||||
/**
|
||||
* Method to be assigned to the recv callback of the X2-U (X2 User Plane) socket.
|
||||
* It is called when the eNB receives a packet from the peer eNB of the X2-U interface
|
||||
*
|
||||
* \param socket socket of the X2-U interface
|
||||
*/
|
||||
void RecvFromX2uSocket (Ptr<Socket> socket);
|
||||
|
||||
|
||||
protected:
|
||||
// Interface provided by EpcX2SapProvider
|
||||
@@ -120,6 +129,7 @@ protected:
|
||||
virtual void DoSendUeContextRelease (EpcX2SapProvider::UeContextReleaseParams params);
|
||||
virtual void DoSendLoadInformation (EpcX2SapProvider::LoadInformationParams params);
|
||||
virtual void DoSendResourceStatusUpdate (EpcX2SapProvider::ResourceStatusUpdateParams params);
|
||||
virtual void DoSendUeData (EpcX2SapProvider::UeDataParams params);
|
||||
|
||||
EpcX2SapUser* m_x2SapUser;
|
||||
EpcX2SapProvider* m_x2SapProvider;
|
||||
@@ -140,9 +150,10 @@ private:
|
||||
std::map < Ptr<Socket>, Ptr<X2CellInfo> > m_x2InterfaceCellIds;
|
||||
|
||||
/**
|
||||
* UDP port to be used for the X2 interface
|
||||
* UDP ports to be used for the X2 interfaces: X2-C and X2-U
|
||||
*/
|
||||
uint16_t m_x2cUdpPort;
|
||||
uint16_t m_x2cUdpPort;
|
||||
uint16_t m_x2uUdpPort;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1515,6 +1515,21 @@ LteEnbRrc::DoRecvResourceStatusUpdate (EpcX2SapUser::ResourceStatusUpdateParams
|
||||
NS_ASSERT ("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED");
|
||||
}
|
||||
|
||||
void
|
||||
LteEnbRrc::DoRecvUeData (EpcX2SapUser::UeDataParams params)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
NS_LOG_LOGIC ("Recv UE DATA FORWARDING through X2 interface");
|
||||
NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
|
||||
NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
|
||||
NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid);
|
||||
NS_LOG_LOGIC ("ueData = " << params.ueData);
|
||||
NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ());
|
||||
|
||||
NS_ASSERT ("Processing of UE DATA FORWARDING through X2 interface IS NOT IMPLEMENTED");
|
||||
}
|
||||
|
||||
|
||||
uint16_t
|
||||
LteEnbRrc::DoAllocateTemporaryCellRnti ()
|
||||
|
||||
@@ -600,6 +600,7 @@ private:
|
||||
void DoRecvUeContextRelease (EpcX2SapUser::UeContextReleaseParams params);
|
||||
void DoRecvLoadInformation (EpcX2SapUser::LoadInformationParams params);
|
||||
void DoRecvResourceStatusUpdate (EpcX2SapUser::ResourceStatusUpdateParams params);
|
||||
void DoRecvUeData (EpcX2SapUser::UeDataParams params);
|
||||
|
||||
|
||||
// CMAC SAP methods
|
||||
|
||||
Reference in New Issue
Block a user