A Discrete-Event Network Simulator
API
epc-x2.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Manuel Requena <manuel.requena@cttc.es>
18  */
19 
20 #ifndef EPC_X2_H
21 #define EPC_X2_H
22 
23 #include "epc-x2-sap.h"
24 
25 #include "ns3/callback.h"
26 #include "ns3/object.h"
27 #include "ns3/ptr.h"
28 #include "ns3/socket.h"
29 
30 #include <map>
31 
32 namespace ns3
33 {
34 
38 class X2IfaceInfo : public SimpleRefCount<X2IfaceInfo>
39 {
40  public:
48  X2IfaceInfo(Ipv4Address remoteIpAddr,
49  Ptr<Socket> localCtrlPlaneSocket,
50  Ptr<Socket> localUserPlaneSocket);
51  virtual ~X2IfaceInfo();
52 
58  X2IfaceInfo& operator=(const X2IfaceInfo& value);
59 
60  public:
64 };
65 
69 class X2CellInfo : public SimpleRefCount<X2CellInfo>
70 {
71  public:
78  X2CellInfo(std::vector<uint16_t> localCellIds, std::vector<uint16_t> remoteCellIds);
79  virtual ~X2CellInfo();
80 
86  X2CellInfo& operator=(const X2CellInfo& value);
87 
88  public:
89  std::vector<uint16_t> m_localCellIds;
90  std::vector<uint16_t> m_remoteCellIds;
91 };
92 
98 class EpcX2 : public Object
99 {
101  friend class EpcX2SpecificEpcX2SapProvider<EpcX2>;
102 
103  public:
107  EpcX2();
108 
112  ~EpcX2() override;
113 
118  static TypeId GetTypeId();
119  void DoDispose() override;
120 
124  void SetEpcX2SapUser(EpcX2SapUser* s);
125 
130 
138  void AddX2Interface(uint16_t enb1CellId,
139  Ipv4Address enb1X2Address,
140  std::vector<uint16_t> enb2CellIds,
141  Ipv4Address enb2X2Address);
142 
149  void RecvFromX2cSocket(Ptr<Socket> socket);
150 
157  void RecvFromX2uSocket(Ptr<Socket> socket);
158 
159  protected:
160  // Interface provided by EpcX2SapProvider
209 
212 
213  private:
218  std::map<uint16_t, Ptr<X2IfaceInfo>> m_x2InterfaceSockets;
219 
224  std::map<Ptr<Socket>, Ptr<X2CellInfo>> m_x2InterfaceCellIds;
225 
229  uint16_t m_x2cUdpPort;
233  uint16_t m_x2uUdpPort;
234 };
235 
236 } // namespace ns3
237 
238 #endif // EPC_X2_H
This entity is installed inside an eNB and provides the functionality for the X2 interface.
Definition: epc-x2.h:99
EpcX2SapUser * m_x2SapUser
X2 SAP user.
Definition: epc-x2.h:210
virtual void DoSendHandoverRequestAck(EpcX2SapProvider::HandoverRequestAckParams params)
Send handover request ack function.
Definition: epc-x2.cc:487
EpcX2SapProvider * m_x2SapProvider
X2 SAP provider.
Definition: epc-x2.h:211
virtual void DoSendUeContextRelease(EpcX2SapProvider::UeContextReleaseParams params)
Send UE context release function.
Definition: epc-x2.cc:630
void DoDispose() override
Destructor implementation.
Definition: epc-x2.cc:100
void AddX2Interface(uint16_t enb1CellId, Ipv4Address enb1X2Address, std::vector< uint16_t > enb2CellIds, Ipv4Address enb2X2Address)
Add an X2 interface to this EPC X2 entity.
Definition: epc-x2.cc:131
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:218
virtual void DoSendResourceStatusUpdate(EpcX2SapProvider::ResourceStatusUpdateParams params)
Send resource status update function.
Definition: epc-x2.cc:716
virtual void DoSendHandoverPreparationFailure(EpcX2SapProvider::HandoverPreparationFailureParams params)
Send handover preparation failure function.
Definition: epc-x2.cc:535
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:180
~EpcX2() override
Destructor.
Definition: epc-x2.cc:94
virtual void DoSendHandoverRequest(EpcX2SapProvider::HandoverRequestParams params)
Send handover request function.
Definition: epc-x2.cc:437
static TypeId GetTypeId()
Get the type ID.
Definition: epc-x2.cc:110
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:224
virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params)
Send UE data function.
Definition: epc-x2.cc:762
EpcX2SapProvider * GetEpcX2SapProvider()
Definition: epc-x2.cc:124
uint16_t m_x2uUdpPort
UDP ports to be used for the X2-U interface.
Definition: epc-x2.h:233
uint16_t m_x2cUdpPort
UDP ports to be used for the X2-C interface.
Definition: epc-x2.h:229
virtual void DoSendLoadInformation(EpcX2SapProvider::LoadInformationParams params)
Send load information function.
Definition: epc-x2.cc:674
EpcX2()
Constructor.
Definition: epc-x2.cc:85
virtual void DoSendSnStatusTransfer(EpcX2SapProvider::SnStatusTransferParams params)
Send SN status transfer function.
Definition: epc-x2.cc:582
void SetEpcX2SapUser(EpcX2SapUser *s)
Definition: epc-x2.cc:117
virtual void DoSendHandoverCancel(EpcX2SapProvider::HandoverCancelParams params)
Send Handover Cancel function.
Definition: epc-x2.cc:793
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:407
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:359
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:427
EpcX2SpecificEpcX2SapProvider.
Definition: epc-x2-sap.h:498
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
A base class which provides memory management and object aggregation.
Definition: object.h:89
A template-based reference counting class.
a unique identifier for an interface.
Definition: type-id.h:59
X2CellInfo.
Definition: epc-x2.h:70
X2CellInfo & operator=(const X2CellInfo &value)
Assignment operator.
Definition: epc-x2.cc:73
std::vector< uint16_t > m_remoteCellIds
remote cell IDs
Definition: epc-x2.h:90
X2CellInfo(std::vector< uint16_t > localCellIds, std::vector< uint16_t > remoteCellIds)
Constructor.
Definition: epc-x2.cc:62
std::vector< uint16_t > m_localCellIds
local cell IDs
Definition: epc-x2.h:89
virtual ~X2CellInfo()
Definition: epc-x2.cc:68
X2IfaceInfo.
Definition: epc-x2.h:39
Ptr< Socket > m_localCtrlPlaneSocket
local control plane socket
Definition: epc-x2.h:62
Ipv4Address m_remoteIpAddr
remote IP address
Definition: epc-x2.h:61
X2IfaceInfo & operator=(const X2IfaceInfo &value)
Assignment operator.
Definition: epc-x2.cc:51
virtual ~X2IfaceInfo()
Definition: epc-x2.cc:44
X2IfaceInfo(Ipv4Address remoteIpAddr, Ptr< Socket > localCtrlPlaneSocket, Ptr< Socket > localUserPlaneSocket)
Constructor.
Definition: epc-x2.cc:35
Ptr< Socket > m_localUserPlaneSocket
local user plane socket
Definition: epc-x2.h:63
Every class exported by the ns3 library is enclosed in the ns3 namespace.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
Parameters of the HANDOVER CANCEL message.
Definition: epc-x2-sap.h:345
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition: epc-x2-sap.h:264
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:248
Parameters of the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:230
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:306
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:317
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:278
Parameters of the UE CONTEXT RELEASE message.
Definition: epc-x2-sap.h:293
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:332