A Discrete-Event Network Simulator
API
epc-x2.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 #ifndef EPC_X2_H
22 #define EPC_X2_H
23 
24 #include "ns3/socket.h"
25 #include "ns3/callback.h"
26 #include "ns3/ptr.h"
27 #include "ns3/object.h"
28 
29 #include "ns3/epc-x2-sap.h"
30 
31 #include <map>
32 
33 namespace ns3 {
34 
35 
39 class X2IfaceInfo : public SimpleRefCount<X2IfaceInfo>
40 {
41 public:
49  X2IfaceInfo (Ipv4Address remoteIpAddr, Ptr<Socket> localCtrlPlaneSocket, Ptr<Socket> localUserPlaneSocket);
50  virtual ~X2IfaceInfo (void);
51 
58 
59 public:
63 };
64 
65 
69 class X2CellInfo : public SimpleRefCount<X2CellInfo>
70 {
71 public:
78  X2CellInfo (uint16_t localCellId, uint16_t remoteCellId);
79  virtual ~X2CellInfo (void);
80 
87 
88 public:
89  uint16_t m_localCellId;
90  uint16_t m_remoteCellId;
91 };
92 
93 
99 class EpcX2 : public Object
100 {
102  friend class EpcX2SpecificEpcX2SapProvider<EpcX2>;
103 
104 public:
108  EpcX2 ();
109 
113  virtual ~EpcX2 (void);
114 
119  static TypeId GetTypeId (void);
120  virtual void DoDispose (void);
121 
122 
126  void SetEpcX2SapUser (EpcX2SapUser * s);
127 
132 
133 
141  void AddX2Interface (uint16_t enb1CellId, Ipv4Address enb1X2Address,
142  uint16_t enb2CellId, Ipv4Address enb2X2Address);
143 
144 
151  void RecvFromX2cSocket (Ptr<Socket> socket);
152 
159  void RecvFromX2uSocket (Ptr<Socket> socket);
160 
161 
162 protected:
163  // Interface provided by EpcX2SapProvider
204  virtual void DoSendUeData (EpcX2SapProvider::UeDataParams params);
205 
208 
209 
210 private:
211 
216  std::map < uint16_t, Ptr<X2IfaceInfo> > m_x2InterfaceSockets;
217 
222  std::map < Ptr<Socket>, Ptr<X2CellInfo> > m_x2InterfaceCellIds;
223 
227  uint16_t m_x2cUdpPort;
231  uint16_t m_x2uUdpPort;
232 
233 };
234 
235 } //namespace ns3
236 
237 #endif // EPC_X2_H
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::X2CellInfo
X2CellInfo.
Definition: epc-x2.h:70
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::EpcX2
This entity is installed inside an eNB and provides the functionality for the X2 interface.
Definition: epc-x2.h:100
ns3::EpcX2::m_x2SapUser
EpcX2SapUser * m_x2SapUser
X2 SAP user.
Definition: epc-x2.h:206
ns3::EpcX2::m_x2uUdpPort
uint16_t m_x2uUdpPort
UDP ports to be used for the X2-U interface.
Definition: epc-x2.h:231
ns3::X2IfaceInfo::X2IfaceInfo
X2IfaceInfo(Ipv4Address remoteIpAddr, Ptr< Socket > localCtrlPlaneSocket, Ptr< Socket > localUserPlaneSocket)
Constructor.
Definition: epc-x2.cc:34
ns3::SimpleRefCount
A template-based reference counting class.
Definition: simple-ref-count.h:74
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
ns3::EpcX2::DoSendHandoverPreparationFailure
virtual void DoSendHandoverPreparationFailure(EpcX2SapProvider::HandoverPreparationFailureParams params)
Send handover preparation failure function.
Definition: epc-x2.cc:502
ns3::EpcX2Sap::UeContextReleaseParams
Parameters of the UE CONTEXT RELEASE message.
Definition: epc-x2-sap.h:291
ns3::EpcX2Sap::HandoverRequestParams
Parameters of the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:229
ns3::EpcX2::AddX2Interface
void AddX2Interface(uint16_t enb1CellId, Ipv4Address enb1X2Address, uint16_t enb2CellId, Ipv4Address enb2X2Address)
Add an X2 interface to this EPC X2 entity.
Definition: epc-x2.cc:133
ns3::EpcX2::m_x2SapProvider
EpcX2SapProvider * m_x2SapProvider
X2 SAP provider.
Definition: epc-x2.h:207
ns3::EpcX2Sap::HandoverPreparationFailureParams
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition: epc-x2-sap.h:263
ns3::Ptr< Socket >
ns3::EpcX2::DoSendUeContextRelease
virtual void DoSendUeContextRelease(EpcX2SapProvider::UeContextReleaseParams params)
Send UE context release function.
Definition: epc-x2.cc:598
ns3::EpcX2::m_x2cUdpPort
uint16_t m_x2cUdpPort
UDP ports to be used for the X2-C interface.
Definition: epc-x2.h:227
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::EpcX2Sap::UeDataParams
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:329
ns3::EpcX2::SetEpcX2SapUser
void SetEpcX2SapUser(EpcX2SapUser *s)
Definition: epc-x2.cc:118
ns3::EpcX2Sap::HandoverRequestAckParams
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:247
ns3::EpcX2Sap::SnStatusTransferParams
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:277
ns3::EpcX2::m_x2InterfaceCellIds
std::map< Ptr< Socket >, Ptr< X2CellInfo > > m_x2InterfaceCellIds
Map the localSocket (the one receiving the X2 message) to the corresponding (sourceCellId,...
Definition: epc-x2.h:222
ns3::X2CellInfo::m_localCellId
uint16_t m_localCellId
local cell ID
Definition: epc-x2.h:89
ns3::EpcX2SapProvider
These service primitives of this part of the X2 SAP are provided by the X2 entity and issued by RRC e...
Definition: epc-x2-sap.h:344
ns3::EpcX2::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: epc-x2.cc:109
ns3::X2IfaceInfo::m_remoteIpAddr
Ipv4Address m_remoteIpAddr
remote IP address
Definition: epc-x2.h:60
ns3::EpcX2SpecificEpcX2SapProvider
EpcX2SpecificEpcX2SapProvider.
Definition: epc-x2-sap.h:471
ns3::X2IfaceInfo::m_localUserPlaneSocket
Ptr< Socket > m_localUserPlaneSocket
local user plane socket
Definition: epc-x2.h:62
ns3::EpcX2::DoSendUeData
virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params)
Send UE data function.
Definition: epc-x2.cc:735
ns3::EpcX2Sap::LoadInformationParams
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:304
ns3::EpcX2::DoSendHandoverRequest
virtual void DoSendHandoverRequest(EpcX2SapProvider::HandoverRequestParams params)
Send handover request function.
Definition: epc-x2.cc:402
ns3::X2CellInfo::~X2CellInfo
virtual ~X2CellInfo(void)
Definition: epc-x2.cc:65
ns3::X2IfaceInfo::operator=
X2IfaceInfo & operator=(const X2IfaceInfo &)
Assignment operator.
Definition: epc-x2.cc:48
ns3::EpcX2::DoSendSnStatusTransfer
virtual void DoSendSnStatusTransfer(EpcX2SapProvider::SnStatusTransferParams params)
Send SN status transfer function.
Definition: epc-x2.cc:550
ns3::EpcX2::DoSendResourceStatusUpdate
virtual void DoSendResourceStatusUpdate(EpcX2SapProvider::ResourceStatusUpdateParams params)
Send resource status update function.
Definition: epc-x2.cc:687
ns3::EpcX2::EpcX2
EpcX2()
Constructor.
Definition: epc-x2.cc:84
ns3::X2IfaceInfo::m_localCtrlPlaneSocket
Ptr< Socket > m_localCtrlPlaneSocket
local control plane socket
Definition: epc-x2.h:61
ns3::X2IfaceInfo::~X2IfaceInfo
virtual ~X2IfaceInfo(void)
Definition: epc-x2.cc:41
ns3::EpcX2::DoSendLoadInformation
virtual void DoSendLoadInformation(EpcX2SapProvider::LoadInformationParams params)
Send load information function.
Definition: epc-x2.cc:643
ns3::EpcX2::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: epc-x2.cc:99
ns3::X2IfaceInfo
X2IfaceInfo.
Definition: epc-x2.h:40
ns3::EpcX2::m_x2InterfaceSockets
std::map< uint16_t, Ptr< X2IfaceInfo > > m_x2InterfaceSockets
Map the targetCellId to the corresponding (sourceSocket, remoteIpAddr) to be used to send the X2 mess...
Definition: epc-x2.h:216
ns3::EpcX2::GetEpcX2SapProvider
EpcX2SapProvider * GetEpcX2SapProvider()
Definition: epc-x2.cc:125
ns3::EpcX2::~EpcX2
virtual ~EpcX2(void)
Destructor.
Definition: epc-x2.cc:93
ns3::X2CellInfo::operator=
X2CellInfo & operator=(const X2CellInfo &)
Assignment operator.
Definition: epc-x2.cc:72
ns3::X2CellInfo::X2CellInfo
X2CellInfo(uint16_t localCellId, uint16_t remoteCellId)
Constructor.
Definition: epc-x2.cc:59
ns3::EpcX2::DoSendHandoverRequestAck
virtual void DoSendHandoverRequestAck(EpcX2SapProvider::HandoverRequestAckParams params)
Send handover request ack function.
Definition: epc-x2.cc:453
ns3::EpcX2::RecvFromX2uSocket
void RecvFromX2uSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the X2-U (X2 User Plane) socket.
Definition: epc-x2.cc:371
ns3::X2CellInfo::m_remoteCellId
uint16_t m_remoteCellId
remote cell ID
Definition: epc-x2.h:90
ns3::EpcX2::RecvFromX2cSocket
void RecvFromX2cSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the X2-C (X2 Control Plane) socket.
Definition: epc-x2.cc:170
ns3::EpcX2SapUser
These service primitives of this part of the X2 SAP are provided by the RRC entity and issued by the ...
Definition: epc-x2-sap.h:407
ns3::EpcX2Sap::ResourceStatusUpdateParams
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:315