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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Manuel Requena <manuel.requena@cttc.es>
7 */
8
9#ifndef EPC_X2_H
10#define EPC_X2_H
11
12#include "epc-x2-sap.h"
13
14#include "ns3/callback.h"
15#include "ns3/object.h"
16#include "ns3/ptr.h"
17#include "ns3/socket.h"
18
19#include <map>
20
21namespace ns3
22{
23
24/**
25 * X2IfaceInfo
26 */
27class X2IfaceInfo : public SimpleRefCount<X2IfaceInfo>
28{
29 public:
30 /**
31 * Constructor
32 *
33 * @param remoteIpAddr remote IP address
34 * @param localCtrlPlaneSocket control plane socket
35 * @param localUserPlaneSocket user plane socket
36 */
37 X2IfaceInfo(Ipv4Address remoteIpAddr,
38 Ptr<Socket> localCtrlPlaneSocket,
39 Ptr<Socket> localUserPlaneSocket);
40 virtual ~X2IfaceInfo();
41
42 /**
43 * Assignment operator
44 * @param value value to assign
45 * @returns X2IfaceInfo&
46 */
47 X2IfaceInfo& operator=(const X2IfaceInfo& value);
48
49 public:
50 Ipv4Address m_remoteIpAddr; ///< remote IP address
51 Ptr<Socket> m_localCtrlPlaneSocket; ///< local control plane socket
52 Ptr<Socket> m_localUserPlaneSocket; ///< local user plane socket
53};
54
55/**
56 * X2CellInfo
57 */
58class X2CellInfo : public SimpleRefCount<X2CellInfo>
59{
60 public:
61 /**
62 * Constructor
63 *
64 * @param localCellIds local cell IDs
65 * @param remoteCellIds remote cell IDs
66 */
67 X2CellInfo(std::vector<uint16_t> localCellIds, std::vector<uint16_t> remoteCellIds);
68 virtual ~X2CellInfo();
69
70 /**
71 * Assignment operator
72 * @param value value to assign
73 * @returns X2CellInfo&
74 */
75 X2CellInfo& operator=(const X2CellInfo& value);
76
77 public:
78 std::vector<uint16_t> m_localCellIds; ///< local cell IDs
79 std::vector<uint16_t> m_remoteCellIds; ///< remote cell IDs
80};
81
82/**
83 * @ingroup lte
84 *
85 * This entity is installed inside an eNB and provides the functionality for the X2 interface
86 */
87class EpcX2 : public Object
88{
89 /// allow EpcX2SpecificEpcX2SapProvider<EpcX2> class friend access
91
92 public:
93 /**
94 * Constructor
95 */
96 EpcX2();
97
98 /**
99 * Destructor
100 */
101 ~EpcX2() override;
102
103 /**
104 * @brief Get the type ID.
105 * @return the object TypeId
106 */
107 static TypeId GetTypeId();
108 void DoDispose() override;
109
110 /**
111 * @param s the X2 SAP User to be used by this EPC X2 entity
112 */
114
115 /**
116 * @return the X2 SAP Provider interface offered by this EPC X2 entity
117 */
119
120 /**
121 * Add an X2 interface to this EPC X2 entity
122 * @param enb1CellId the cell ID of the current eNodeB
123 * @param enb1X2Address the address of the current eNodeB
124 * @param enb2CellIds the cell IDs of the neighbouring eNodeB
125 * @param enb2X2Address the address of the neighbouring eNodeB
126 */
127 void AddX2Interface(uint16_t enb1CellId,
128 Ipv4Address enb1X2Address,
129 std::vector<uint16_t> enb2CellIds,
130 Ipv4Address enb2X2Address);
131
132 /**
133 * Method to be assigned to the recv callback of the X2-C (X2 Control Plane) socket.
134 * It is called when the eNB receives a packet from the peer eNB of the X2-C interface
135 *
136 * @param socket socket of the X2-C interface
137 */
138 void RecvFromX2cSocket(Ptr<Socket> socket);
139
140 /**
141 * Method to be assigned to the recv callback of the X2-U (X2 User Plane) socket.
142 * It is called when the eNB receives a packet from the peer eNB of the X2-U interface
143 *
144 * @param socket socket of the X2-U interface
145 */
146 void RecvFromX2uSocket(Ptr<Socket> socket);
147
148 protected:
149 // Interface provided by EpcX2SapProvider
150 /**
151 * Send handover request function
152 * @param params the send handover request parameters
153 */
155 /**
156 * Send handover request ack function
157 * @param params the send handover request ack parameters
158 */
160 /**
161 * Send handover preparation failure function
162 * @param params the handover preparation failure parameters
163 */
166 /**
167 * Send SN status transfer function
168 * @param params the SN status transfer parameters
169 */
171 /**
172 * Send UE context release function
173 * @param params the UE context release parameters
174 */
176 /**
177 * Send load information function
178 * @param params the send load information parameters
179 */
181 /**
182 * Send resource status update function
183 * @param params the send resource status update parameters
184 */
186 /**
187 * Send UE data function
188 *
189 * @param params EpcX2SapProvider::UeDataParams
190 */
191 virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params);
192 /**
193 * @brief Send Handover Cancel function
194 * @param params the handover cancel parameters
195 *
196 */
198
199 EpcX2SapUser* m_x2SapUser; ///< X2 SAP user
200 EpcX2SapProvider* m_x2SapProvider; ///< X2 SAP provider
201
202 private:
203 /**
204 * Map the targetCellId to the corresponding (sourceSocket, remoteIpAddr) to be used
205 * to send the X2 message
206 */
207 std::map<uint16_t, Ptr<X2IfaceInfo>> m_x2InterfaceSockets;
208
209 /**
210 * Map the localSocket (the one receiving the X2 message)
211 * to the corresponding (sourceCellId, targetCellId) associated with the X2 interface
212 */
213 std::map<Ptr<Socket>, Ptr<X2CellInfo>> m_x2InterfaceCellIds;
214
215 /**
216 * UDP ports to be used for the X2-C interface
217 */
218 uint16_t m_x2cUdpPort;
219 /**
220 * UDP ports to be used for the X2-U interface
221 */
222 uint16_t m_x2uUdpPort;
223};
224
225} // namespace ns3
226
227#endif // EPC_X2_H
This entity is installed inside an eNB and provides the functionality for the X2 interface.
Definition epc-x2.h:88
EpcX2SapUser * m_x2SapUser
X2 SAP user.
Definition epc-x2.h:199
virtual void DoSendHandoverRequestAck(EpcX2SapProvider::HandoverRequestAckParams params)
Send handover request ack function.
Definition epc-x2.cc:476
EpcX2SapProvider * m_x2SapProvider
X2 SAP provider.
Definition epc-x2.h:200
virtual void DoSendUeContextRelease(EpcX2SapProvider::UeContextReleaseParams params)
Send UE context release function.
Definition epc-x2.cc:619
void DoDispose() override
Destructor implementation.
Definition epc-x2.cc:89
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:120
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:207
virtual void DoSendResourceStatusUpdate(EpcX2SapProvider::ResourceStatusUpdateParams params)
Send resource status update function.
Definition epc-x2.cc:705
virtual void DoSendHandoverPreparationFailure(EpcX2SapProvider::HandoverPreparationFailureParams params)
Send handover preparation failure function.
Definition epc-x2.cc:524
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:169
~EpcX2() override
Destructor.
Definition epc-x2.cc:83
virtual void DoSendHandoverRequest(EpcX2SapProvider::HandoverRequestParams params)
Send handover request function.
Definition epc-x2.cc:426
static TypeId GetTypeId()
Get the type ID.
Definition epc-x2.cc:99
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:213
virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params)
Send UE data function.
Definition epc-x2.cc:751
EpcX2SapProvider * GetEpcX2SapProvider()
Definition epc-x2.cc:113
uint16_t m_x2uUdpPort
UDP ports to be used for the X2-U interface.
Definition epc-x2.h:222
uint16_t m_x2cUdpPort
UDP ports to be used for the X2-C interface.
Definition epc-x2.h:218
virtual void DoSendLoadInformation(EpcX2SapProvider::LoadInformationParams params)
Send load information function.
Definition epc-x2.cc:663
EpcX2()
Constructor.
Definition epc-x2.cc:74
virtual void DoSendSnStatusTransfer(EpcX2SapProvider::SnStatusTransferParams params)
Send SN status transfer function.
Definition epc-x2.cc:571
void SetEpcX2SapUser(EpcX2SapUser *s)
Definition epc-x2.cc:106
virtual void DoSendHandoverCancel(EpcX2SapProvider::HandoverCancelParams params)
Send Handover Cancel function.
Definition epc-x2.cc:782
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:396
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:348
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:416
EpcX2SpecificEpcX2SapProvider.
Definition epc-x2-sap.h:487
Ipv4 addresses are stored in host order in this class.
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
A template-based reference counting class.
a unique identifier for an interface.
Definition type-id.h:48
X2CellInfo.
Definition epc-x2.h:59
X2CellInfo & operator=(const X2CellInfo &value)
Assignment operator.
Definition epc-x2.cc:62
std::vector< uint16_t > m_remoteCellIds
remote cell IDs
Definition epc-x2.h:79
X2CellInfo(std::vector< uint16_t > localCellIds, std::vector< uint16_t > remoteCellIds)
Constructor.
Definition epc-x2.cc:51
std::vector< uint16_t > m_localCellIds
local cell IDs
Definition epc-x2.h:78
virtual ~X2CellInfo()
Definition epc-x2.cc:57
X2IfaceInfo.
Definition epc-x2.h:28
Ptr< Socket > m_localCtrlPlaneSocket
local control plane socket
Definition epc-x2.h:51
Ipv4Address m_remoteIpAddr
remote IP address
Definition epc-x2.h:50
X2IfaceInfo & operator=(const X2IfaceInfo &value)
Assignment operator.
Definition epc-x2.cc:40
virtual ~X2IfaceInfo()
Definition epc-x2.cc:33
X2IfaceInfo(Ipv4Address remoteIpAddr, Ptr< Socket > localCtrlPlaneSocket, Ptr< Socket > localUserPlaneSocket)
Constructor.
Definition epc-x2.cc:24
Ptr< Socket > m_localUserPlaneSocket
local user plane socket
Definition epc-x2.h:52
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the HANDOVER CANCEL message.
Definition epc-x2-sap.h:334
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition epc-x2-sap.h:253
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition epc-x2-sap.h:237
Parameters of the HANDOVER REQUEST message.
Definition epc-x2-sap.h:219
Parameters of the LOAD INFORMATION message.
Definition epc-x2-sap.h:295
Parameters of the RESOURCE STATUS UPDATE message.
Definition epc-x2-sap.h:306
Parameters of the SN STATUS TRANSFER message.
Definition epc-x2-sap.h:267
Parameters of the UE CONTEXT RELEASE message.
Definition epc-x2-sap.h:282
Parameters of the UE DATA primitive.
Definition epc-x2-sap.h:321