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 "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
32namespace ns3
33{
34
35/**
36 * X2IfaceInfo
37 */
38class X2IfaceInfo : public SimpleRefCount<X2IfaceInfo>
39{
40 public:
41 /**
42 * Constructor
43 *
44 * \param remoteIpAddr remote IP address
45 * \param localCtrlPlaneSocket control plane socket
46 * \param localUserPlaneSocket user plane socket
47 */
48 X2IfaceInfo(Ipv4Address remoteIpAddr,
49 Ptr<Socket> localCtrlPlaneSocket,
50 Ptr<Socket> localUserPlaneSocket);
51 virtual ~X2IfaceInfo();
52
53 /**
54 * Assignment operator
55 * \param value value to assign
56 * \returns X2IfaceInfo&
57 */
58 X2IfaceInfo& operator=(const X2IfaceInfo& value);
59
60 public:
61 Ipv4Address m_remoteIpAddr; ///< remote IP address
62 Ptr<Socket> m_localCtrlPlaneSocket; ///< local control plane socket
63 Ptr<Socket> m_localUserPlaneSocket; ///< local user plane socket
64};
65
66/**
67 * X2CellInfo
68 */
69class X2CellInfo : public SimpleRefCount<X2CellInfo>
70{
71 public:
72 /**
73 * Constructor
74 *
75 * \param localCellIds local cell IDs
76 * \param remoteCellIds remote cell IDs
77 */
78 X2CellInfo(std::vector<uint16_t> localCellIds, std::vector<uint16_t> remoteCellIds);
79 virtual ~X2CellInfo();
80
81 /**
82 * Assignment operator
83 * \param value value to assign
84 * \returns X2CellInfo&
85 */
86 X2CellInfo& operator=(const X2CellInfo& value);
87
88 public:
89 std::vector<uint16_t> m_localCellIds; ///< local cell IDs
90 std::vector<uint16_t> m_remoteCellIds; ///< remote cell IDs
91};
92
93/**
94 * \ingroup lte
95 *
96 * This entity is installed inside an eNB and provides the functionality for the X2 interface
97 */
98class EpcX2 : public Object
99{
100 /// allow EpcX2SpecificEpcX2SapProvider<EpcX2> class friend access
102
103 public:
104 /**
105 * Constructor
106 */
107 EpcX2();
108
109 /**
110 * Destructor
111 */
112 ~EpcX2() override;
113
114 /**
115 * \brief Get the type ID.
116 * \return the object TypeId
117 */
118 static TypeId GetTypeId();
119 void DoDispose() override;
120
121 /**
122 * \param s the X2 SAP User to be used by this EPC X2 entity
123 */
125
126 /**
127 * \return the X2 SAP Provider interface offered by this EPC X2 entity
128 */
130
131 /**
132 * Add an X2 interface to this EPC X2 entity
133 * \param enb1CellId the cell ID of the current eNodeB
134 * \param enb1X2Address the address of the current eNodeB
135 * \param enb2CellIds the cell IDs of the neighbouring eNodeB
136 * \param enb2X2Address the address of the neighbouring eNodeB
137 */
138 void AddX2Interface(uint16_t enb1CellId,
139 Ipv4Address enb1X2Address,
140 std::vector<uint16_t> enb2CellIds,
141 Ipv4Address enb2X2Address);
142
143 /**
144 * Method to be assigned to the recv callback of the X2-C (X2 Control Plane) socket.
145 * It is called when the eNB receives a packet from the peer eNB of the X2-C interface
146 *
147 * \param socket socket of the X2-C interface
148 */
149 void RecvFromX2cSocket(Ptr<Socket> socket);
150
151 /**
152 * Method to be assigned to the recv callback of the X2-U (X2 User Plane) socket.
153 * It is called when the eNB receives a packet from the peer eNB of the X2-U interface
154 *
155 * \param socket socket of the X2-U interface
156 */
157 void RecvFromX2uSocket(Ptr<Socket> socket);
158
159 protected:
160 // Interface provided by EpcX2SapProvider
161 /**
162 * Send handover request function
163 * \param params the send handover request parameters
164 */
166 /**
167 * Send handover request ack function
168 * \param params the send handover request ack parameters
169 */
171 /**
172 * Send handover preparation failure function
173 * \param params the handover preparation failure parameters
174 */
177 /**
178 * Send SN status transfer function
179 * \param params the SN status transfer parameters
180 */
182 /**
183 * Send UE context release function
184 * \param params the UE context release parameters
185 */
187 /**
188 * Send load information function
189 * \param params the send load information parameters
190 */
192 /**
193 * Send resource status update function
194 * \param params the send resource status update parameters
195 */
197 /**
198 * Send UE data function
199 *
200 * \param params EpcX2SapProvider::UeDataParams
201 */
202 virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params);
203 /**
204 * \brief Send Handover Cancel function
205 * \param params the handover cancel parameters
206 *
207 */
209
210 EpcX2SapUser* m_x2SapUser; ///< X2 SAP user
211 EpcX2SapProvider* m_x2SapProvider; ///< X2 SAP provider
212
213 private:
214 /**
215 * Map the targetCellId to the corresponding (sourceSocket, remoteIpAddr) to be used
216 * to send the X2 message
217 */
218 std::map<uint16_t, Ptr<X2IfaceInfo>> m_x2InterfaceSockets;
219
220 /**
221 * Map the localSocket (the one receiving the X2 message)
222 * to the corresponding (sourceCellId, targetCellId) associated with the X2 interface
223 */
224 std::map<Ptr<Socket>, Ptr<X2CellInfo>> m_x2InterfaceCellIds;
225
226 /**
227 * UDP ports to be used for the X2-C interface
228 */
229 uint16_t m_x2cUdpPort;
230 /**
231 * UDP ports to be used for the X2-U interface
232 */
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
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
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
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
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.
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