A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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 "ns3/callback.h"
24#include "ns3/epc-x2-sap.h"
25#include "ns3/object.h"
26#include "ns3/ptr.h"
27#include "ns3/socket.h"
28
29#include <map>
30
31namespace ns3
32{
33
37class X2IfaceInfo : public SimpleRefCount<X2IfaceInfo>
38{
39 public:
47 X2IfaceInfo(Ipv4Address remoteIpAddr,
48 Ptr<Socket> localCtrlPlaneSocket,
49 Ptr<Socket> localUserPlaneSocket);
50 virtual ~X2IfaceInfo();
51
57 X2IfaceInfo& operator=(const X2IfaceInfo& value);
58
59 public:
63};
64
68class X2CellInfo : public SimpleRefCount<X2CellInfo>
69{
70 public:
77 X2CellInfo(std::vector<uint16_t> localCellIds, std::vector<uint16_t> remoteCellIds);
78 virtual ~X2CellInfo();
79
85 X2CellInfo& operator=(const X2CellInfo& value);
86
87 public:
88 std::vector<uint16_t> m_localCellIds;
89 std::vector<uint16_t> m_remoteCellIds;
90};
91
97class EpcX2 : public Object
98{
101
102 public:
106 EpcX2();
107
111 ~EpcX2() override;
112
117 static TypeId GetTypeId();
118 void DoDispose() override;
119
124
129
137 void AddX2Interface(uint16_t enb1CellId,
138 Ipv4Address enb1X2Address,
139 std::vector<uint16_t> enb2CellIds,
140 Ipv4Address enb2X2Address);
141
148 void RecvFromX2cSocket(Ptr<Socket> socket);
149
156 void RecvFromX2uSocket(Ptr<Socket> socket);
157
158 protected:
159 // Interface provided by EpcX2SapProvider
201 virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params);
208
211
212 private:
217 std::map<uint16_t, Ptr<X2IfaceInfo>> m_x2InterfaceSockets;
218
223 std::map<Ptr<Socket>, Ptr<X2CellInfo>> m_x2InterfaceCellIds;
224
228 uint16_t m_x2cUdpPort;
232 uint16_t m_x2uUdpPort;
233};
234
235} // namespace ns3
236
237#endif // EPC_X2_H
This entity is installed inside an eNB and provides the functionality for the X2 interface.
Definition: epc-x2.h:98
EpcX2SapUser * m_x2SapUser
X2 SAP user.
Definition: epc-x2.h:209
virtual void DoSendHandoverRequestAck(EpcX2SapProvider::HandoverRequestAckParams params)
Send handover request ack function.
Definition: epc-x2.cc:486
EpcX2SapProvider * m_x2SapProvider
X2 SAP provider.
Definition: epc-x2.h:210
virtual void DoSendUeContextRelease(EpcX2SapProvider::UeContextReleaseParams params)
Send UE context release function.
Definition: epc-x2.cc:629
void DoDispose() override
Destructor implementation.
Definition: epc-x2.cc:99
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:130
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:217
virtual void DoSendResourceStatusUpdate(EpcX2SapProvider::ResourceStatusUpdateParams params)
Send resource status update function.
Definition: epc-x2.cc:715
virtual void DoSendHandoverPreparationFailure(EpcX2SapProvider::HandoverPreparationFailureParams params)
Send handover preparation failure function.
Definition: epc-x2.cc:534
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:179
~EpcX2() override
Destructor.
Definition: epc-x2.cc:93
virtual void DoSendHandoverRequest(EpcX2SapProvider::HandoverRequestParams params)
Send handover request function.
Definition: epc-x2.cc:436
static TypeId GetTypeId()
Get the type ID.
Definition: epc-x2.cc:109
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:223
virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params)
Send UE data function.
Definition: epc-x2.cc:761
EpcX2SapProvider * GetEpcX2SapProvider()
Definition: epc-x2.cc:123
uint16_t m_x2uUdpPort
UDP ports to be used for the X2-U interface.
Definition: epc-x2.h:232
uint16_t m_x2cUdpPort
UDP ports to be used for the X2-C interface.
Definition: epc-x2.h:228
virtual void DoSendLoadInformation(EpcX2SapProvider::LoadInformationParams params)
Send load information function.
Definition: epc-x2.cc:673
EpcX2()
Constructor.
Definition: epc-x2.cc:84
virtual void DoSendSnStatusTransfer(EpcX2SapProvider::SnStatusTransferParams params)
Send SN status transfer function.
Definition: epc-x2.cc:581
void SetEpcX2SapUser(EpcX2SapUser *s)
Definition: epc-x2.cc:116
virtual void DoSendHandoverCancel(EpcX2SapProvider::HandoverCancelParams params)
Send Handover Cancel function.
Definition: epc-x2.cc:792
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:406
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:358
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:426
EpcX2SpecificEpcX2SapProvider.
Definition: epc-x2-sap.h:497
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:43
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
A template-based reference counting class.
a unique identifier for an interface.
Definition: type-id.h:60
X2CellInfo.
Definition: epc-x2.h:69
X2CellInfo & operator=(const X2CellInfo &value)
Assignment operator.
Definition: epc-x2.cc:72
std::vector< uint16_t > m_remoteCellIds
remote cell IDs
Definition: epc-x2.h:89
std::vector< uint16_t > m_localCellIds
local cell IDs
Definition: epc-x2.h:88
virtual ~X2CellInfo()
Definition: epc-x2.cc:67
X2IfaceInfo.
Definition: epc-x2.h:38
Ptr< Socket > m_localCtrlPlaneSocket
local control plane socket
Definition: epc-x2.h:61
Ipv4Address m_remoteIpAddr
remote IP address
Definition: epc-x2.h:60
X2IfaceInfo & operator=(const X2IfaceInfo &value)
Assignment operator.
Definition: epc-x2.cc:50
virtual ~X2IfaceInfo()
Definition: epc-x2.cc:43
Ptr< Socket > m_localUserPlaneSocket
local user plane socket
Definition: epc-x2.h:62
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the HANDOVER CANCEL message.
Definition: epc-x2-sap.h:344
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition: epc-x2-sap.h:263
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:247
Parameters of the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:229
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:305
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:316
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:277
Parameters of the UE CONTEXT RELEASE message.
Definition: epc-x2-sap.h:292
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:331