A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
epc-x2.cc
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#include "epc-x2.h"
10
11#include "epc-gtpu-header.h"
12#include "epc-x2-header.h"
13
14#include "ns3/inet-socket-address.h"
15#include "ns3/log.h"
16#include "ns3/node.h"
17#include "ns3/packet.h"
18
19namespace ns3
20{
21
23
25 Ptr<Socket> localCtrlPlaneSocket,
26 Ptr<Socket> localUserPlaneSocket)
27{
28 m_remoteIpAddr = remoteIpAddr;
29 m_localCtrlPlaneSocket = localCtrlPlaneSocket;
30 m_localUserPlaneSocket = localUserPlaneSocket;
31}
32
38
41{
42 NS_LOG_FUNCTION(this);
43 m_remoteIpAddr = value.m_remoteIpAddr;
44 m_localCtrlPlaneSocket = value.m_localCtrlPlaneSocket;
45 m_localUserPlaneSocket = value.m_localUserPlaneSocket;
46 return *this;
47}
48
49///////////////////////////////////////////
50
51X2CellInfo::X2CellInfo(std::vector<uint16_t> localCellIds, std::vector<uint16_t> remoteCellIds)
52 : m_localCellIds{localCellIds},
53 m_remoteCellIds{remoteCellIds}
54{
55}
56
60
63{
64 NS_LOG_FUNCTION(this);
65 m_localCellIds = value.m_localCellIds;
66 m_remoteCellIds = value.m_remoteCellIds;
67 return *this;
68}
69
70///////////////////////////////////////////
71
73
75 : m_x2cUdpPort(4444),
76 m_x2uUdpPort(2152)
77{
78 NS_LOG_FUNCTION(this);
79
81}
82
84{
85 NS_LOG_FUNCTION(this);
86}
87
88void
90{
91 NS_LOG_FUNCTION(this);
92
95 delete m_x2SapProvider;
96}
97
100{
101 static TypeId tid = TypeId("ns3::EpcX2").SetParent<Object>().SetGroupName("Lte");
102 return tid;
103}
104
105void
107{
108 NS_LOG_FUNCTION(this << s);
109 m_x2SapUser = s;
110}
111
118
119void
120EpcX2::AddX2Interface(uint16_t localCellId,
121 Ipv4Address localX2Address,
122 std::vector<uint16_t> remoteCellIds,
123 Ipv4Address remoteX2Address)
124{
125 uint16_t remoteCellId = remoteCellIds.at(0);
126 NS_LOG_FUNCTION(this << localCellId << localX2Address << remoteCellId << remoteX2Address);
127
128 int retval;
129
130 // Get local eNB where this X2 entity belongs to
131 Ptr<Node> localEnb = GetObject<Node>();
132
133 // Create X2-C socket for the local eNB
134 Ptr<Socket> localX2cSocket =
135 Socket::CreateSocket(localEnb, TypeId::LookupByName("ns3::UdpSocketFactory"));
136 retval = localX2cSocket->Bind(InetSocketAddress(localX2Address, m_x2cUdpPort));
137 NS_ASSERT(retval == 0);
138 localX2cSocket->SetRecvCallback(MakeCallback(&EpcX2::RecvFromX2cSocket, this));
139
140 // Create X2-U socket for the local eNB
141 Ptr<Socket> localX2uSocket =
142 Socket::CreateSocket(localEnb, TypeId::LookupByName("ns3::UdpSocketFactory"));
143 retval = localX2uSocket->Bind(InetSocketAddress(localX2Address, m_x2uUdpPort));
144 NS_ASSERT(retval == 0);
145 localX2uSocket->SetRecvCallback(MakeCallback(&EpcX2::RecvFromX2uSocket, this));
146
147 std::vector<uint16_t> localCellIds;
148 localCellIds.push_back(localCellId);
149
150 NS_ASSERT_MSG(m_x2InterfaceSockets.find(remoteCellId) == m_x2InterfaceSockets.end(),
151 "Mapping for remoteCellId = " << remoteCellId << " is already known");
152 for (uint16_t remoteCellId : remoteCellIds)
153 {
154 m_x2InterfaceSockets[remoteCellId] =
155 Create<X2IfaceInfo>(remoteX2Address, localX2cSocket, localX2uSocket);
156 }
157
158 NS_ASSERT_MSG(m_x2InterfaceCellIds.find(localX2cSocket) == m_x2InterfaceCellIds.end(),
159 "Mapping for control plane localSocket = " << localX2cSocket
160 << " is already known");
161 m_x2InterfaceCellIds[localX2cSocket] = Create<X2CellInfo>(localCellIds, remoteCellIds);
162
163 NS_ASSERT_MSG(m_x2InterfaceCellIds.find(localX2uSocket) == m_x2InterfaceCellIds.end(),
164 "Mapping for data plane localSocket = " << localX2uSocket << " is already known");
165 m_x2InterfaceCellIds[localX2uSocket] = Create<X2CellInfo>(localCellIds, remoteCellIds);
166}
167
168void
170{
171 NS_LOG_FUNCTION(this << socket);
172
173 NS_LOG_LOGIC("Recv X2 message: from Socket");
174 Ptr<Packet> packet = socket->Recv();
175 NS_LOG_LOGIC("packetLen = " << packet->GetSize());
176
178 "Missing infos of local and remote CellId");
179 Ptr<X2CellInfo> cellsInfo = m_x2InterfaceCellIds[socket];
180
181 EpcX2Header x2Header;
182 packet->RemoveHeader(x2Header);
183
184 NS_LOG_LOGIC("X2 header: " << x2Header);
185
186 uint8_t messageType = x2Header.GetMessageType();
187 uint8_t procedureCode = x2Header.GetProcedureCode();
188
189 if (procedureCode == EpcX2Header::HandoverPreparation)
190 {
191 if (messageType == EpcX2Header::InitiatingMessage)
192 {
193 NS_LOG_LOGIC("Recv X2 message: HANDOVER REQUEST");
194
195 EpcX2HandoverRequestHeader x2HoReqHeader;
196 packet->RemoveHeader(x2HoReqHeader);
197
198 NS_LOG_INFO("X2 HandoverRequest header: " << x2HoReqHeader);
199
201 params.oldEnbUeX2apId = x2HoReqHeader.GetOldEnbUeX2apId();
202 params.cause = x2HoReqHeader.GetCause();
203 params.sourceCellId = cellsInfo->m_remoteCellIds.at(0);
204 params.targetCellId = x2HoReqHeader.GetTargetCellId();
205 params.mmeUeS1apId = x2HoReqHeader.GetMmeUeS1apId();
206 params.ueAggregateMaxBitRateDownlink = x2HoReqHeader.GetUeAggregateMaxBitRateDownlink();
207 params.ueAggregateMaxBitRateUplink = x2HoReqHeader.GetUeAggregateMaxBitRateUplink();
208 params.bearers = x2HoReqHeader.GetBearers();
209 params.rrcContext = packet;
210
211 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
212 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
213 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
214 NS_LOG_LOGIC("mmeUeS1apId = " << params.mmeUeS1apId);
215 NS_LOG_LOGIC("cellsInfo->m_localCellId = " << cellsInfo->m_localCellIds.at(0));
216
218 }
219 else if (messageType == EpcX2Header::SuccessfulOutcome)
220 {
221 NS_LOG_LOGIC("Recv X2 message: HANDOVER REQUEST ACK");
222
223 EpcX2HandoverRequestAckHeader x2HoReqAckHeader;
224 packet->RemoveHeader(x2HoReqAckHeader);
225
226 NS_LOG_INFO("X2 HandoverRequestAck header: " << x2HoReqAckHeader);
227
229 params.oldEnbUeX2apId = x2HoReqAckHeader.GetOldEnbUeX2apId();
230 params.newEnbUeX2apId = x2HoReqAckHeader.GetNewEnbUeX2apId();
231 params.sourceCellId = cellsInfo->m_localCellIds.at(0);
232 params.targetCellId = cellsInfo->m_remoteCellIds.at(0);
233 params.admittedBearers = x2HoReqAckHeader.GetAdmittedBearers();
234 params.notAdmittedBearers = x2HoReqAckHeader.GetNotAdmittedBearers();
235 params.rrcContext = packet;
236
237 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
238 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
239 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
240 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
241
243 }
244 else // messageType == EpcX2Header::UnsuccessfulOutcome
245 {
246 NS_LOG_LOGIC("Recv X2 message: HANDOVER PREPARATION FAILURE");
247
248 EpcX2HandoverPreparationFailureHeader x2HoPrepFailHeader;
249 packet->RemoveHeader(x2HoPrepFailHeader);
250
251 NS_LOG_INFO("X2 HandoverPreparationFailure header: " << x2HoPrepFailHeader);
252
254 params.oldEnbUeX2apId = x2HoPrepFailHeader.GetOldEnbUeX2apId();
255 params.sourceCellId = cellsInfo->m_localCellIds.at(0);
256 params.targetCellId = cellsInfo->m_remoteCellIds.at(0);
257 params.cause = x2HoPrepFailHeader.GetCause();
258 params.criticalityDiagnostics = x2HoPrepFailHeader.GetCriticalityDiagnostics();
259
260 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
261 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
262 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
263 NS_LOG_LOGIC("cause = " << params.cause);
264 NS_LOG_LOGIC("criticalityDiagnostics = " << params.criticalityDiagnostics);
265
267 }
268 }
269 else if (procedureCode == EpcX2Header::LoadIndication)
270 {
271 if (messageType == EpcX2Header::InitiatingMessage)
272 {
273 NS_LOG_LOGIC("Recv X2 message: LOAD INFORMATION");
274
275 EpcX2LoadInformationHeader x2LoadInfoHeader;
276 packet->RemoveHeader(x2LoadInfoHeader);
277
278 NS_LOG_INFO("X2 LoadInformation header: " << x2LoadInfoHeader);
279
281 params.cellInformationList = x2LoadInfoHeader.GetCellInformationList();
282
283 NS_LOG_LOGIC("cellInformationList size = " << params.cellInformationList.size());
284
286 }
287 }
288 else if (procedureCode == EpcX2Header::SnStatusTransfer)
289 {
290 if (messageType == EpcX2Header::InitiatingMessage)
291 {
292 NS_LOG_LOGIC("Recv X2 message: SN STATUS TRANSFER");
293
294 EpcX2SnStatusTransferHeader x2SnStatusXferHeader;
295 packet->RemoveHeader(x2SnStatusXferHeader);
296
297 NS_LOG_INFO("X2 SnStatusTransfer header: " << x2SnStatusXferHeader);
298
300 params.oldEnbUeX2apId = x2SnStatusXferHeader.GetOldEnbUeX2apId();
301 params.newEnbUeX2apId = x2SnStatusXferHeader.GetNewEnbUeX2apId();
302 params.sourceCellId = cellsInfo->m_remoteCellIds.at(0);
303 params.targetCellId = cellsInfo->m_localCellIds.at(0);
304 params.erabsSubjectToStatusTransferList =
305 x2SnStatusXferHeader.GetErabsSubjectToStatusTransferList();
306
307 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
308 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
309 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
310 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
311 NS_LOG_LOGIC("erabsList size = " << params.erabsSubjectToStatusTransferList.size());
312
314 }
315 }
316 else if (procedureCode == EpcX2Header::UeContextRelease)
317 {
318 if (messageType == EpcX2Header::InitiatingMessage)
319 {
320 NS_LOG_LOGIC("Recv X2 message: UE CONTEXT RELEASE");
321
322 EpcX2UeContextReleaseHeader x2UeCtxReleaseHeader;
323 packet->RemoveHeader(x2UeCtxReleaseHeader);
324
325 NS_LOG_INFO("X2 UeContextRelease header: " << x2UeCtxReleaseHeader);
326
328 params.oldEnbUeX2apId = x2UeCtxReleaseHeader.GetOldEnbUeX2apId();
329 params.newEnbUeX2apId = x2UeCtxReleaseHeader.GetNewEnbUeX2apId();
330
331 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
332 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
333
335 }
336 }
337 else if (procedureCode == EpcX2Header::ResourceStatusReporting)
338 {
339 if (messageType == EpcX2Header::InitiatingMessage)
340 {
341 NS_LOG_LOGIC("Recv X2 message: RESOURCE STATUS UPDATE");
342
343 EpcX2ResourceStatusUpdateHeader x2ResStatUpdHeader;
344 packet->RemoveHeader(x2ResStatUpdHeader);
345
346 NS_LOG_INFO("X2 ResourceStatusUpdate header: " << x2ResStatUpdHeader);
347
349 params.targetCellId = 0;
350 params.enb1MeasurementId = x2ResStatUpdHeader.GetEnb1MeasurementId();
351 params.enb2MeasurementId = x2ResStatUpdHeader.GetEnb2MeasurementId();
352 params.cellMeasurementResultList = x2ResStatUpdHeader.GetCellMeasurementResultList();
353
354 NS_LOG_LOGIC("enb1MeasurementId = " << params.enb1MeasurementId);
355 NS_LOG_LOGIC("enb2MeasurementId = " << params.enb2MeasurementId);
357 "cellMeasurementResultList size = " << params.cellMeasurementResultList.size());
358
360 }
361 }
362 else if (procedureCode == EpcX2Header::HandoverCancel)
363 {
364 if (messageType == EpcX2Header::SuccessfulOutcome)
365 {
366 NS_LOG_LOGIC("Recv X2 message: HANDOVER CANCEL");
367
368 EpcX2HandoverCancelHeader x2HoCancelHeader;
369 packet->RemoveHeader(x2HoCancelHeader);
370
371 NS_LOG_INFO("X2 HandoverCancel header: " << x2HoCancelHeader);
372
374 params.oldEnbUeX2apId = x2HoCancelHeader.GetOldEnbUeX2apId();
375 params.newEnbUeX2apId = x2HoCancelHeader.GetNewEnbUeX2apId();
376 params.sourceCellId = cellsInfo->m_localCellIds.at(0);
377 params.targetCellId = cellsInfo->m_remoteCellIds.at(0);
378 params.cause = x2HoCancelHeader.GetCause();
379
380 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
381 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
382 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
383 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
384 NS_LOG_LOGIC("cause = " << params.cause);
385
387 }
388 }
389 else
390 {
391 NS_ASSERT_MSG(false, "ProcedureCode NOT SUPPORTED!!!");
392 }
393}
394
395void
397{
398 NS_LOG_FUNCTION(this << socket);
399
400 NS_LOG_LOGIC("Recv UE DATA through X2-U interface from Socket");
401 Ptr<Packet> packet = socket->Recv();
402 NS_LOG_LOGIC("packetLen = " << packet->GetSize());
403
405 "Missing infos of local and remote CellId");
406 Ptr<X2CellInfo> cellsInfo = m_x2InterfaceCellIds[socket];
407
408 GtpuHeader gtpu;
409 packet->RemoveHeader(gtpu);
410
411 NS_LOG_LOGIC("GTP-U header: " << gtpu);
412
414 params.sourceCellId = cellsInfo->m_remoteCellIds.at(0);
415 params.targetCellId = cellsInfo->m_localCellIds.at(0);
416 params.gtpTeid = gtpu.GetTeid();
417 params.ueData = packet;
418
419 m_x2SapUser->RecvUeData(params);
420}
421
422//
423// Implementation of the X2 SAP Provider
424//
425void
427{
428 NS_LOG_FUNCTION(this);
429
430 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
431 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
432 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
433 NS_LOG_LOGIC("mmeUeS1apId = " << params.mmeUeS1apId);
434
435 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.targetCellId) != m_x2InterfaceSockets.end(),
436 "Missing infos for targetCellId = " << params.targetCellId);
437 Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets[params.targetCellId];
438 Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
439 Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
440
441 NS_LOG_LOGIC("sourceSocket = " << sourceSocket);
442 NS_LOG_LOGIC("targetIpAddr = " << targetIpAddr);
443
444 NS_LOG_INFO("Send X2 message: HANDOVER REQUEST");
445
446 // Build the X2 message
447 EpcX2HandoverRequestHeader x2HoReqHeader;
448 x2HoReqHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
449 x2HoReqHeader.SetCause(params.cause);
450 x2HoReqHeader.SetTargetCellId(params.targetCellId);
451 x2HoReqHeader.SetMmeUeS1apId(params.mmeUeS1apId);
452 x2HoReqHeader.SetUeAggregateMaxBitRateDownlink(params.ueAggregateMaxBitRateDownlink);
453 x2HoReqHeader.SetUeAggregateMaxBitRateUplink(params.ueAggregateMaxBitRateUplink);
454 x2HoReqHeader.SetBearers(params.bearers);
455
456 EpcX2Header x2Header;
459 x2Header.SetLengthOfIes(x2HoReqHeader.GetLengthOfIes());
460 x2Header.SetNumberOfIes(x2HoReqHeader.GetNumberOfIes());
461
462 NS_LOG_INFO("X2 header: " << x2Header);
463 NS_LOG_INFO("X2 HandoverRequest header: " << x2HoReqHeader);
464
465 // Build the X2 packet
466 Ptr<Packet> packet = (params.rrcContext) ? (params.rrcContext) : (Create<Packet>());
467 packet->AddHeader(x2HoReqHeader);
468 packet->AddHeader(x2Header);
469 NS_LOG_INFO("packetLen = " << packet->GetSize());
470
471 // Send the X2 message through the socket
472 sourceSocket->SendTo(packet, 0, InetSocketAddress(targetIpAddr, m_x2cUdpPort));
473}
474
475void
477{
478 NS_LOG_FUNCTION(this);
479
480 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
481 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
482 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
483 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
484
485 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.sourceCellId) != m_x2InterfaceSockets.end(),
486 "Socket infos not defined for sourceCellId = " << params.sourceCellId);
487
488 Ptr<Socket> localSocket = m_x2InterfaceSockets[params.sourceCellId]->m_localCtrlPlaneSocket;
489 Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.sourceCellId]->m_remoteIpAddr;
490
491 NS_LOG_LOGIC("localSocket = " << localSocket);
492 NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
493
494 NS_LOG_INFO("Send X2 message: HANDOVER REQUEST ACK");
495
496 // Build the X2 message
497 EpcX2HandoverRequestAckHeader x2HoAckHeader;
498 x2HoAckHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
499 x2HoAckHeader.SetNewEnbUeX2apId(params.newEnbUeX2apId);
500 x2HoAckHeader.SetAdmittedBearers(params.admittedBearers);
501 x2HoAckHeader.SetNotAdmittedBearers(params.notAdmittedBearers);
502
503 EpcX2Header x2Header;
506 x2Header.SetLengthOfIes(x2HoAckHeader.GetLengthOfIes());
507 x2Header.SetNumberOfIes(x2HoAckHeader.GetNumberOfIes());
508
509 NS_LOG_INFO("X2 header: " << x2Header);
510 NS_LOG_INFO("X2 HandoverAck header: " << x2HoAckHeader);
511 NS_LOG_INFO("RRC context: " << params.rrcContext);
512
513 // Build the X2 packet
514 Ptr<Packet> packet = (params.rrcContext) ? (params.rrcContext) : (Create<Packet>());
515 packet->AddHeader(x2HoAckHeader);
516 packet->AddHeader(x2Header);
517 NS_LOG_INFO("packetLen = " << packet->GetSize());
518
519 // Send the X2 message through the socket
520 localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
521}
522
523void
525{
526 NS_LOG_FUNCTION(this);
527
528 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
529 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
530 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
531 NS_LOG_LOGIC("cause = " << params.cause);
532 NS_LOG_LOGIC("criticalityDiagnostics = " << params.criticalityDiagnostics);
533
534 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.sourceCellId) != m_x2InterfaceSockets.end(),
535 "Socket infos not defined for sourceCellId = " << params.sourceCellId);
536
537 Ptr<Socket> localSocket = m_x2InterfaceSockets[params.sourceCellId]->m_localCtrlPlaneSocket;
538 Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.sourceCellId]->m_remoteIpAddr;
539
540 NS_LOG_LOGIC("localSocket = " << localSocket);
541 NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
542
543 NS_LOG_INFO("Send X2 message: HANDOVER PREPARATION FAILURE");
544
545 // Build the X2 message
546 EpcX2HandoverPreparationFailureHeader x2HoPrepFailHeader;
547 x2HoPrepFailHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
548 x2HoPrepFailHeader.SetCause(params.cause);
549 x2HoPrepFailHeader.SetCriticalityDiagnostics(params.criticalityDiagnostics);
550
551 EpcX2Header x2Header;
554 x2Header.SetLengthOfIes(x2HoPrepFailHeader.GetLengthOfIes());
555 x2Header.SetNumberOfIes(x2HoPrepFailHeader.GetNumberOfIes());
556
557 NS_LOG_INFO("X2 header: " << x2Header);
558 NS_LOG_INFO("X2 HandoverPrepFail header: " << x2HoPrepFailHeader);
559
560 // Build the X2 packet
561 Ptr<Packet> packet = Create<Packet>();
562 packet->AddHeader(x2HoPrepFailHeader);
563 packet->AddHeader(x2Header);
564 NS_LOG_INFO("packetLen = " << packet->GetSize());
565
566 // Send the X2 message through the socket
567 localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
568}
569
570void
572{
573 NS_LOG_FUNCTION(this);
574
575 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
576 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
577 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
578 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
579 NS_LOG_LOGIC("erabsList size = " << params.erabsSubjectToStatusTransferList.size());
580
581 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.targetCellId) != m_x2InterfaceSockets.end(),
582 "Socket infos not defined for targetCellId = " << params.targetCellId);
583
584 Ptr<Socket> localSocket = m_x2InterfaceSockets[params.targetCellId]->m_localCtrlPlaneSocket;
585 Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.targetCellId]->m_remoteIpAddr;
586
587 NS_LOG_LOGIC("localSocket = " << localSocket);
588 NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
589
590 NS_LOG_INFO("Send X2 message: SN STATUS TRANSFER");
591
592 // Build the X2 message
593 EpcX2SnStatusTransferHeader x2SnStatusXferHeader;
594 x2SnStatusXferHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
595 x2SnStatusXferHeader.SetNewEnbUeX2apId(params.newEnbUeX2apId);
596 x2SnStatusXferHeader.SetErabsSubjectToStatusTransferList(
597 params.erabsSubjectToStatusTransferList);
598
599 EpcX2Header x2Header;
602 x2Header.SetLengthOfIes(x2SnStatusXferHeader.GetLengthOfIes());
603 x2Header.SetNumberOfIes(x2SnStatusXferHeader.GetNumberOfIes());
604
605 NS_LOG_INFO("X2 header: " << x2Header);
606 NS_LOG_INFO("X2 SnStatusTransfer header: " << x2SnStatusXferHeader);
607
608 // Build the X2 packet
609 Ptr<Packet> packet = Create<Packet>();
610 packet->AddHeader(x2SnStatusXferHeader);
611 packet->AddHeader(x2Header);
612 NS_LOG_INFO("packetLen = " << packet->GetSize());
613
614 // Send the X2 message through the socket
615 localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
616}
617
618void
620{
621 NS_LOG_FUNCTION(this);
622
623 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
624 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
625 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
626
627 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.sourceCellId) != m_x2InterfaceSockets.end(),
628 "Socket infos not defined for sourceCellId = " << params.sourceCellId);
629
630 Ptr<Socket> localSocket = m_x2InterfaceSockets[params.sourceCellId]->m_localCtrlPlaneSocket;
631 Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.sourceCellId]->m_remoteIpAddr;
632
633 NS_LOG_LOGIC("localSocket = " << localSocket);
634 NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
635
636 NS_LOG_INFO("Send X2 message: UE CONTEXT RELEASE");
637
638 // Build the X2 message
639 EpcX2UeContextReleaseHeader x2UeCtxReleaseHeader;
640 x2UeCtxReleaseHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
641 x2UeCtxReleaseHeader.SetNewEnbUeX2apId(params.newEnbUeX2apId);
642
643 EpcX2Header x2Header;
646 x2Header.SetLengthOfIes(x2UeCtxReleaseHeader.GetLengthOfIes());
647 x2Header.SetNumberOfIes(x2UeCtxReleaseHeader.GetNumberOfIes());
648
649 NS_LOG_INFO("X2 header: " << x2Header);
650 NS_LOG_INFO("X2 UeContextRelease header: " << x2UeCtxReleaseHeader);
651
652 // Build the X2 packet
653 Ptr<Packet> packet = Create<Packet>();
654 packet->AddHeader(x2UeCtxReleaseHeader);
655 packet->AddHeader(x2Header);
656 NS_LOG_INFO("packetLen = " << packet->GetSize());
657
658 // Send the X2 message through the socket
659 localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
660}
661
662void
664{
665 NS_LOG_FUNCTION(this);
666
667 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
668 NS_LOG_LOGIC("cellInformationList size = " << params.cellInformationList.size());
669
670 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.targetCellId) != m_x2InterfaceSockets.end(),
671 "Missing infos for targetCellId = " << params.targetCellId);
672 Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets[params.targetCellId];
673 Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
674 Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
675
676 NS_LOG_LOGIC("sourceSocket = " << sourceSocket);
677 NS_LOG_LOGIC("targetIpAddr = " << targetIpAddr);
678
679 NS_LOG_INFO("Send X2 message: LOAD INFORMATION");
680
681 // Build the X2 message
682 EpcX2LoadInformationHeader x2LoadInfoHeader;
683 x2LoadInfoHeader.SetCellInformationList(params.cellInformationList);
684
685 EpcX2Header x2Header;
688 x2Header.SetLengthOfIes(x2LoadInfoHeader.GetLengthOfIes());
689 x2Header.SetNumberOfIes(x2LoadInfoHeader.GetNumberOfIes());
690
691 NS_LOG_INFO("X2 header: " << x2Header);
692 NS_LOG_INFO("X2 LoadInformation header: " << x2LoadInfoHeader);
693
694 // Build the X2 packet
695 Ptr<Packet> packet = Create<Packet>();
696 packet->AddHeader(x2LoadInfoHeader);
697 packet->AddHeader(x2Header);
698 NS_LOG_INFO("packetLen = " << packet->GetSize());
699
700 // Send the X2 message through the socket
701 sourceSocket->SendTo(packet, 0, InetSocketAddress(targetIpAddr, m_x2cUdpPort));
702}
703
704void
706{
707 NS_LOG_FUNCTION(this);
708
709 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
710 NS_LOG_LOGIC("enb1MeasurementId = " << params.enb1MeasurementId);
711 NS_LOG_LOGIC("enb2MeasurementId = " << params.enb2MeasurementId);
712 NS_LOG_LOGIC("cellMeasurementResultList size = " << params.cellMeasurementResultList.size());
713
714 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.targetCellId) != m_x2InterfaceSockets.end(),
715 "Missing infos for targetCellId = " << params.targetCellId);
716 Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets[params.targetCellId];
717 Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
718 Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
719
720 NS_LOG_LOGIC("sourceSocket = " << sourceSocket);
721 NS_LOG_LOGIC("targetIpAddr = " << targetIpAddr);
722
723 NS_LOG_INFO("Send X2 message: RESOURCE STATUS UPDATE");
724
725 // Build the X2 message
726 EpcX2ResourceStatusUpdateHeader x2ResourceStatUpdHeader;
727 x2ResourceStatUpdHeader.SetEnb1MeasurementId(params.enb1MeasurementId);
728 x2ResourceStatUpdHeader.SetEnb2MeasurementId(params.enb2MeasurementId);
729 x2ResourceStatUpdHeader.SetCellMeasurementResultList(params.cellMeasurementResultList);
730
731 EpcX2Header x2Header;
734 x2Header.SetLengthOfIes(x2ResourceStatUpdHeader.GetLengthOfIes());
735 x2Header.SetNumberOfIes(x2ResourceStatUpdHeader.GetNumberOfIes());
736
737 NS_LOG_INFO("X2 header: " << x2Header);
738 NS_LOG_INFO("X2 ResourceStatusUpdate header: " << x2ResourceStatUpdHeader);
739
740 // Build the X2 packet
741 Ptr<Packet> packet = Create<Packet>();
742 packet->AddHeader(x2ResourceStatUpdHeader);
743 packet->AddHeader(x2Header);
744 NS_LOG_INFO("packetLen = " << packet->GetSize());
745
746 // Send the X2 message through the socket
747 sourceSocket->SendTo(packet, 0, InetSocketAddress(targetIpAddr, m_x2cUdpPort));
748}
749
750void
752{
753 NS_LOG_FUNCTION(this);
754
755 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
756 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
757 NS_LOG_LOGIC("gtpTeid = " << params.gtpTeid);
758
759 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.targetCellId) != m_x2InterfaceSockets.end(),
760 "Missing infos for targetCellId = " << params.targetCellId);
761 Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets[params.targetCellId];
762 Ptr<Socket> sourceSocket = socketInfo->m_localUserPlaneSocket;
763 Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
764
765 NS_LOG_LOGIC("sourceSocket = " << sourceSocket);
766 NS_LOG_LOGIC("targetIpAddr = " << targetIpAddr);
767
768 GtpuHeader gtpu;
769 gtpu.SetTeid(params.gtpTeid);
770 gtpu.SetLength(params.ueData->GetSize() + gtpu.GetSerializedSize() -
771 8); /// \todo This should be done in GtpuHeader
772 NS_LOG_INFO("GTP-U header: " << gtpu);
773
774 Ptr<Packet> packet = params.ueData;
775 packet->AddHeader(gtpu);
776
777 NS_LOG_INFO("Forward UE DATA through X2 interface");
778 sourceSocket->SendTo(packet, 0, InetSocketAddress(targetIpAddr, m_x2uUdpPort));
779}
780
781void
783{
784 NS_LOG_FUNCTION(this);
785
786 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
787 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
788 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
789 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
790
791 NS_ASSERT_MSG(m_x2InterfaceSockets.find(params.targetCellId) != m_x2InterfaceSockets.end(),
792 "Socket infos not defined for targetCellId = " << params.targetCellId);
793
794 Ptr<Socket> localSocket = m_x2InterfaceSockets[params.targetCellId]->m_localCtrlPlaneSocket;
795 Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.targetCellId]->m_remoteIpAddr;
796
797 NS_LOG_LOGIC("localSocket = " << localSocket);
798 NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
799
800 NS_LOG_INFO("Send X2 message: HANDOVER CANCEL");
801
802 // Build the X2 message
803 EpcX2HandoverCancelHeader x2HandoverCancelHeader;
804 x2HandoverCancelHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
805 x2HandoverCancelHeader.SetNewEnbUeX2apId(params.newEnbUeX2apId);
806 x2HandoverCancelHeader.SetCause(params.cause);
807
808 EpcX2Header x2Header;
811 x2Header.SetLengthOfIes(x2HandoverCancelHeader.GetLengthOfIes());
812 x2Header.SetNumberOfIes(x2HandoverCancelHeader.GetNumberOfIes());
813
814 NS_LOG_INFO("X2 header: " << x2Header);
815 NS_LOG_INFO("X2 UeContextRelease header: " << x2HandoverCancelHeader);
816
817 // Build the X2 packet
818 Ptr<Packet> packet = Create<Packet>();
819 packet->AddHeader(x2HandoverCancelHeader);
820 packet->AddHeader(x2Header);
821 NS_LOG_INFO("packetLen = " << packet->GetSize());
822
823 // Send the X2 message through the socket
824 localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
825}
826
827} // namespace ns3
EpcX2HandoverCancelHeader.
uint16_t GetNewEnbUeX2apId() const
Get new ENB UE X2 AP ID function.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.
void SetCause(uint16_t cause)
Set cause function.
uint16_t GetCause() const
Get cause function.
uint32_t GetNumberOfIes() const
Get number of IEs function.
void SetNewEnbUeX2apId(uint16_t x2apId)
Set new ENB UE X2 AP ID function.
EpcX2HandoverPreparationFailureHeader.
void SetCriticalityDiagnostics(uint16_t criticalityDiagnostics)
Set criticality diagnostics function.
void SetCause(uint16_t cause)
Set cause function.
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.
uint16_t GetCause() const
Get cause function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
uint16_t GetCriticalityDiagnostics() const
Get criticality diagnostics function.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
uint32_t GetNumberOfIes() const
Get number of IEs function.
EpcX2HandoverRequestAckHeader.
uint16_t GetNewEnbUeX2apId() const
Get new ENB UE X2 AP ID function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
std::vector< EpcX2Sap::ErabNotAdmittedItem > GetNotAdmittedBearers() const
Get not admitted bearers function.
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.
std::vector< EpcX2Sap::ErabAdmittedItem > GetAdmittedBearers() const
Get admittied bearers function.
void SetNotAdmittedBearers(std::vector< EpcX2Sap::ErabNotAdmittedItem > bearers)
Set not admitted bearers function.
void SetNewEnbUeX2apId(uint16_t x2apId)
Set new ENB UE X2 AP ID function.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
uint32_t GetNumberOfIes() const
Get number of IEs function.
void SetAdmittedBearers(std::vector< EpcX2Sap::ErabAdmittedItem > bearers)
Set admitted bearers function.
EpcX2HandoverRequestHeader.
uint16_t GetCause() const
Get cause function.
void SetCause(uint16_t cause)
Set cause function.
void SetMmeUeS1apId(uint32_t mmeUeS1apId)
Set MME UE S1 AP ID function.
uint32_t GetMmeUeS1apId() const
Get MME UE S1 AP ID function.
void SetTargetCellId(uint16_t targetCellId)
Set target cell id function.
void SetUeAggregateMaxBitRateUplink(uint64_t bitRate)
Set UE Aggregate Max Bit Rate Uplik function.
uint64_t GetUeAggregateMaxBitRateUplink() const
Get UE Aggregate Max Bit Rate Uplik function.
uint16_t GetTargetCellId() const
Get target cell id function.
void SetBearers(std::vector< EpcX2Sap::ErabToBeSetupItem > bearers)
Set bearers function.
uint64_t GetUeAggregateMaxBitRateDownlink() const
Get UE Aggregate Max Bit Rate Downlink function.
void SetUeAggregateMaxBitRateDownlink(uint64_t bitRate)
Set UE Aggregate Max Bit Rate Downlink function.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB X2 AP ID function.
uint32_t GetNumberOfIes() const
Get number of IEs.
uint16_t GetOldEnbUeX2apId() const
Get old ENB X2 AP ID function.
uint32_t GetLengthOfIes() const
Get length of IEs.
std::vector< EpcX2Sap::ErabToBeSetupItem > GetBearers() const
Get bearers function.
void SetLengthOfIes(uint32_t lengthOfIes)
Set length of IEs function.
void SetProcedureCode(uint8_t procedureCode)
Set procedure code function.
uint8_t GetProcedureCode() const
Get procedure code function.
void SetNumberOfIes(uint32_t numberOfIes)
Set number of IEs function.
uint8_t GetMessageType() const
Get message type function.
void SetMessageType(uint8_t messageType)
Set message type function.
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
friend class EpcX2SpecificEpcX2SapProvider< EpcX2 >
allow EpcX2SpecificEpcX2SapProvider<EpcX2> class friend access
Definition epc-x2.h:90
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
EpcX2LoadInformationHeader.
std::vector< EpcX2Sap::CellInformationItem > GetCellInformationList() const
Get cell information list function.
uint32_t GetNumberOfIes() const
Get number of IEs function.
void SetCellInformationList(std::vector< EpcX2Sap::CellInformationItem > cellInformationList)
Set cell information list function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
EpcX2ResourceStatusUpdateHeader.
void SetEnb2MeasurementId(uint16_t enb2MeasurementId)
Set ENB2 measurement ID function.
void SetEnb1MeasurementId(uint16_t enb1MeasurementId)
Set ENB1 measurement ID function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
uint32_t GetNumberOfIes() const
Get number of IEs function.
uint16_t GetEnb2MeasurementId() const
Get ENB2 measurement ID function.
std::vector< EpcX2Sap::CellMeasurementResultItem > GetCellMeasurementResultList() const
Get cell measurement results list function.
void SetCellMeasurementResultList(std::vector< EpcX2Sap::CellMeasurementResultItem > cellMeasurementResultList)
Set cell measurement results list function.
uint16_t GetEnb1MeasurementId() const
Get ENB1 measurement ID function.
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
virtual void RecvUeData(UeDataParams params)=0
Receive UE data function.
virtual void RecvUeContextRelease(UeContextReleaseParams params)=0
Receive UE context release function.
virtual void RecvHandoverCancel(HandoverCancelParams params)=0
Receive handover cancel function.
virtual void RecvSnStatusTransfer(SnStatusTransferParams params)=0
Receive SN status transfer function.
virtual void RecvLoadInformation(LoadInformationParams params)=0
Receive load information function.
virtual void RecvHandoverRequestAck(HandoverRequestAckParams params)=0
Receive handover request ack function.
virtual void RecvResourceStatusUpdate(ResourceStatusUpdateParams params)=0
Receive resource status update function.
virtual void RecvHandoverPreparationFailure(HandoverPreparationFailureParams params)=0
Receive handover preparation failure function.
virtual void RecvHandoverRequest(HandoverRequestParams params)=0
Receive handover request function.
EpcX2SnStatusTransferHeader.
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.
uint16_t GetNewEnbUeX2apId() const
Get new ENB UE X2 AP ID function.
uint32_t GetNumberOfIes() const
Get number of IEs function.
void SetErabsSubjectToStatusTransferList(std::vector< EpcX2Sap::ErabsSubjectToStatusTransferItem > erabs)
Set ERABs subject to status transfer list function.
std::vector< EpcX2Sap::ErabsSubjectToStatusTransferItem > GetErabsSubjectToStatusTransferList() const
Get ERABs subject to status transfer list function.
void SetNewEnbUeX2apId(uint16_t x2apId)
Set new ENB UE X2 AP ID function.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
EpcX2UeContextReleaseHeader.
void SetNewEnbUeX2apId(uint16_t x2apId)
Set new ENB UE X2 AP ID function.
uint16_t GetNewEnbUeX2apId() const
Get new ENB UE X2 AP ID function.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.
uint32_t GetNumberOfIes() const
Set length of IEs function.
Implementation of the GPRS Tunnelling Protocol header according to GTPv1-U Release 10 as per 3Gpp TS ...
void SetTeid(uint32_t teid)
Set TEID function.
uint32_t GetSerializedSize() const override
uint32_t GetTeid() const
Get a tunnel endpoint identificator (TEID)
void SetLength(uint16_t length)
Set the length in octets of the payload.
an Inet address class
Ipv4 addresses are stored in host order in this class.
A base class which provides memory management and object aggregation.
Definition object.h:78
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition object.h:511
Smart pointer class similar to boost::intrusive_ptr.
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
Definition socket.cc:61
a unique identifier for an interface.
Definition type-id.h:48
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Definition type-id.cc:872
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
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
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:264
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition callback.h:684
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