A Discrete-Event Network Simulator
API
epc-x2.cc
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 #include "epc-x2.h"
21 
22 #include "epc-gtpu-header.h"
23 #include "epc-x2-header.h"
24 
25 #include "ns3/inet-socket-address.h"
26 #include "ns3/log.h"
27 #include "ns3/node.h"
28 #include "ns3/packet.h"
29 
30 namespace ns3
31 {
32 
34 
36  Ptr<Socket> localCtrlPlaneSocket,
37  Ptr<Socket> localUserPlaneSocket)
38 {
39  m_remoteIpAddr = remoteIpAddr;
40  m_localCtrlPlaneSocket = localCtrlPlaneSocket;
41  m_localUserPlaneSocket = localUserPlaneSocket;
42 }
43 
45 {
46  m_localCtrlPlaneSocket = nullptr;
47  m_localUserPlaneSocket = nullptr;
48 }
49 
52 {
53  NS_LOG_FUNCTION(this);
54  m_remoteIpAddr = value.m_remoteIpAddr;
55  m_localCtrlPlaneSocket = value.m_localCtrlPlaneSocket;
56  m_localUserPlaneSocket = value.m_localUserPlaneSocket;
57  return *this;
58 }
59 
61 
62 X2CellInfo::X2CellInfo(std::vector<uint16_t> localCellIds, std::vector<uint16_t> remoteCellIds)
63  : m_localCellIds{localCellIds},
64  m_remoteCellIds{remoteCellIds}
65 {
66 }
67 
69 {
70 }
71 
74 {
75  NS_LOG_FUNCTION(this);
76  m_localCellIds = value.m_localCellIds;
77  m_remoteCellIds = value.m_remoteCellIds;
78  return *this;
79 }
80 
82 
84 
86  : m_x2cUdpPort(4444),
87  m_x2uUdpPort(2152)
88 {
89  NS_LOG_FUNCTION(this);
90 
92 }
93 
95 {
96  NS_LOG_FUNCTION(this);
97 }
98 
99 void
101 {
102  NS_LOG_FUNCTION(this);
103 
104  m_x2InterfaceSockets.clear();
105  m_x2InterfaceCellIds.clear();
106  delete m_x2SapProvider;
107 }
108 
109 TypeId
111 {
112  static TypeId tid = TypeId("ns3::EpcX2").SetParent<Object>().SetGroupName("Lte");
113  return tid;
114 }
115 
116 void
118 {
119  NS_LOG_FUNCTION(this << s);
120  m_x2SapUser = s;
121 }
122 
125 {
126  NS_LOG_FUNCTION(this);
127  return m_x2SapProvider;
128 }
129 
130 void
131 EpcX2::AddX2Interface(uint16_t localCellId,
132  Ipv4Address localX2Address,
133  std::vector<uint16_t> remoteCellIds,
134  Ipv4Address remoteX2Address)
135 {
136  uint16_t remoteCellId = remoteCellIds.at(0);
137  NS_LOG_FUNCTION(this << localCellId << localX2Address << remoteCellId << remoteX2Address);
138 
139  int retval;
140 
141  // Get local eNB where this X2 entity belongs to
142  Ptr<Node> localEnb = GetObject<Node>();
143 
144  // Create X2-C socket for the local eNB
145  Ptr<Socket> localX2cSocket =
146  Socket::CreateSocket(localEnb, TypeId::LookupByName("ns3::UdpSocketFactory"));
147  retval = localX2cSocket->Bind(InetSocketAddress(localX2Address, m_x2cUdpPort));
148  NS_ASSERT(retval == 0);
149  localX2cSocket->SetRecvCallback(MakeCallback(&EpcX2::RecvFromX2cSocket, this));
150 
151  // Create X2-U socket for the local eNB
152  Ptr<Socket> localX2uSocket =
153  Socket::CreateSocket(localEnb, TypeId::LookupByName("ns3::UdpSocketFactory"));
154  retval = localX2uSocket->Bind(InetSocketAddress(localX2Address, m_x2uUdpPort));
155  NS_ASSERT(retval == 0);
156  localX2uSocket->SetRecvCallback(MakeCallback(&EpcX2::RecvFromX2uSocket, this));
157 
158  std::vector<uint16_t> localCellIds;
159  localCellIds.push_back(localCellId);
160 
161  NS_ASSERT_MSG(m_x2InterfaceSockets.find(remoteCellId) == m_x2InterfaceSockets.end(),
162  "Mapping for remoteCellId = " << remoteCellId << " is already known");
163  for (uint16_t remoteCellId : remoteCellIds)
164  {
165  m_x2InterfaceSockets[remoteCellId] =
166  Create<X2IfaceInfo>(remoteX2Address, localX2cSocket, localX2uSocket);
167  }
168 
169  NS_ASSERT_MSG(m_x2InterfaceCellIds.find(localX2cSocket) == m_x2InterfaceCellIds.end(),
170  "Mapping for control plane localSocket = " << localX2cSocket
171  << " is already known");
172  m_x2InterfaceCellIds[localX2cSocket] = Create<X2CellInfo>(localCellIds, remoteCellIds);
173 
174  NS_ASSERT_MSG(m_x2InterfaceCellIds.find(localX2uSocket) == m_x2InterfaceCellIds.end(),
175  "Mapping for data plane localSocket = " << localX2uSocket << " is already known");
176  m_x2InterfaceCellIds[localX2uSocket] = Create<X2CellInfo>(localCellIds, remoteCellIds);
177 }
178 
179 void
181 {
182  NS_LOG_FUNCTION(this << socket);
183 
184  NS_LOG_LOGIC("Recv X2 message: from Socket");
185  Ptr<Packet> packet = socket->Recv();
186  NS_LOG_LOGIC("packetLen = " << packet->GetSize());
187 
189  "Missing infos of local and remote CellId");
190  Ptr<X2CellInfo> cellsInfo = m_x2InterfaceCellIds[socket];
191 
192  EpcX2Header x2Header;
193  packet->RemoveHeader(x2Header);
194 
195  NS_LOG_LOGIC("X2 header: " << x2Header);
196 
197  uint8_t messageType = x2Header.GetMessageType();
198  uint8_t procedureCode = x2Header.GetProcedureCode();
199 
200  if (procedureCode == EpcX2Header::HandoverPreparation)
201  {
202  if (messageType == EpcX2Header::InitiatingMessage)
203  {
204  NS_LOG_LOGIC("Recv X2 message: HANDOVER REQUEST");
205 
206  EpcX2HandoverRequestHeader x2HoReqHeader;
207  packet->RemoveHeader(x2HoReqHeader);
208 
209  NS_LOG_INFO("X2 HandoverRequest header: " << x2HoReqHeader);
210 
212  params.oldEnbUeX2apId = x2HoReqHeader.GetOldEnbUeX2apId();
213  params.cause = x2HoReqHeader.GetCause();
214  params.sourceCellId = cellsInfo->m_remoteCellIds.at(0);
215  params.targetCellId = x2HoReqHeader.GetTargetCellId();
216  params.mmeUeS1apId = x2HoReqHeader.GetMmeUeS1apId();
217  params.ueAggregateMaxBitRateDownlink = x2HoReqHeader.GetUeAggregateMaxBitRateDownlink();
218  params.ueAggregateMaxBitRateUplink = x2HoReqHeader.GetUeAggregateMaxBitRateUplink();
219  params.bearers = x2HoReqHeader.GetBearers();
220  params.rrcContext = packet;
221 
222  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
223  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
224  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
225  NS_LOG_LOGIC("mmeUeS1apId = " << params.mmeUeS1apId);
226  NS_LOG_LOGIC("cellsInfo->m_localCellId = " << cellsInfo->m_localCellIds.at(0));
227 
229  }
230  else if (messageType == EpcX2Header::SuccessfulOutcome)
231  {
232  NS_LOG_LOGIC("Recv X2 message: HANDOVER REQUEST ACK");
233 
234  EpcX2HandoverRequestAckHeader x2HoReqAckHeader;
235  packet->RemoveHeader(x2HoReqAckHeader);
236 
237  NS_LOG_INFO("X2 HandoverRequestAck header: " << x2HoReqAckHeader);
238 
240  params.oldEnbUeX2apId = x2HoReqAckHeader.GetOldEnbUeX2apId();
241  params.newEnbUeX2apId = x2HoReqAckHeader.GetNewEnbUeX2apId();
242  params.sourceCellId = cellsInfo->m_localCellIds.at(0);
243  params.targetCellId = cellsInfo->m_remoteCellIds.at(0);
244  params.admittedBearers = x2HoReqAckHeader.GetAdmittedBearers();
245  params.notAdmittedBearers = x2HoReqAckHeader.GetNotAdmittedBearers();
246  params.rrcContext = packet;
247 
248  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
249  NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
250  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
251  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
252 
254  }
255  else // messageType == EpcX2Header::UnsuccessfulOutcome
256  {
257  NS_LOG_LOGIC("Recv X2 message: HANDOVER PREPARATION FAILURE");
258 
259  EpcX2HandoverPreparationFailureHeader x2HoPrepFailHeader;
260  packet->RemoveHeader(x2HoPrepFailHeader);
261 
262  NS_LOG_INFO("X2 HandoverPreparationFailure header: " << x2HoPrepFailHeader);
263 
265  params.oldEnbUeX2apId = x2HoPrepFailHeader.GetOldEnbUeX2apId();
266  params.sourceCellId = cellsInfo->m_localCellIds.at(0);
267  params.targetCellId = cellsInfo->m_remoteCellIds.at(0);
268  params.cause = x2HoPrepFailHeader.GetCause();
269  params.criticalityDiagnostics = x2HoPrepFailHeader.GetCriticalityDiagnostics();
270 
271  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
272  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
273  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
274  NS_LOG_LOGIC("cause = " << params.cause);
275  NS_LOG_LOGIC("criticalityDiagnostics = " << params.criticalityDiagnostics);
276 
278  }
279  }
280  else if (procedureCode == EpcX2Header::LoadIndication)
281  {
282  if (messageType == EpcX2Header::InitiatingMessage)
283  {
284  NS_LOG_LOGIC("Recv X2 message: LOAD INFORMATION");
285 
286  EpcX2LoadInformationHeader x2LoadInfoHeader;
287  packet->RemoveHeader(x2LoadInfoHeader);
288 
289  NS_LOG_INFO("X2 LoadInformation header: " << x2LoadInfoHeader);
290 
292  params.cellInformationList = x2LoadInfoHeader.GetCellInformationList();
293 
294  NS_LOG_LOGIC("cellInformationList size = " << params.cellInformationList.size());
295 
297  }
298  }
299  else if (procedureCode == EpcX2Header::SnStatusTransfer)
300  {
301  if (messageType == EpcX2Header::InitiatingMessage)
302  {
303  NS_LOG_LOGIC("Recv X2 message: SN STATUS TRANSFER");
304 
305  EpcX2SnStatusTransferHeader x2SnStatusXferHeader;
306  packet->RemoveHeader(x2SnStatusXferHeader);
307 
308  NS_LOG_INFO("X2 SnStatusTransfer header: " << x2SnStatusXferHeader);
309 
311  params.oldEnbUeX2apId = x2SnStatusXferHeader.GetOldEnbUeX2apId();
312  params.newEnbUeX2apId = x2SnStatusXferHeader.GetNewEnbUeX2apId();
313  params.sourceCellId = cellsInfo->m_remoteCellIds.at(0);
314  params.targetCellId = cellsInfo->m_localCellIds.at(0);
315  params.erabsSubjectToStatusTransferList =
316  x2SnStatusXferHeader.GetErabsSubjectToStatusTransferList();
317 
318  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
319  NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
320  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
321  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
322  NS_LOG_LOGIC("erabsList size = " << params.erabsSubjectToStatusTransferList.size());
323 
325  }
326  }
327  else if (procedureCode == EpcX2Header::UeContextRelease)
328  {
329  if (messageType == EpcX2Header::InitiatingMessage)
330  {
331  NS_LOG_LOGIC("Recv X2 message: UE CONTEXT RELEASE");
332 
333  EpcX2UeContextReleaseHeader x2UeCtxReleaseHeader;
334  packet->RemoveHeader(x2UeCtxReleaseHeader);
335 
336  NS_LOG_INFO("X2 UeContextRelease header: " << x2UeCtxReleaseHeader);
337 
339  params.oldEnbUeX2apId = x2UeCtxReleaseHeader.GetOldEnbUeX2apId();
340  params.newEnbUeX2apId = x2UeCtxReleaseHeader.GetNewEnbUeX2apId();
341 
342  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
343  NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
344 
346  }
347  }
348  else if (procedureCode == EpcX2Header::ResourceStatusReporting)
349  {
350  if (messageType == EpcX2Header::InitiatingMessage)
351  {
352  NS_LOG_LOGIC("Recv X2 message: RESOURCE STATUS UPDATE");
353 
354  EpcX2ResourceStatusUpdateHeader x2ResStatUpdHeader;
355  packet->RemoveHeader(x2ResStatUpdHeader);
356 
357  NS_LOG_INFO("X2 ResourceStatusUpdate header: " << x2ResStatUpdHeader);
358 
360  params.targetCellId = 0;
361  params.enb1MeasurementId = x2ResStatUpdHeader.GetEnb1MeasurementId();
362  params.enb2MeasurementId = x2ResStatUpdHeader.GetEnb2MeasurementId();
363  params.cellMeasurementResultList = x2ResStatUpdHeader.GetCellMeasurementResultList();
364 
365  NS_LOG_LOGIC("enb1MeasurementId = " << params.enb1MeasurementId);
366  NS_LOG_LOGIC("enb2MeasurementId = " << params.enb2MeasurementId);
367  NS_LOG_LOGIC(
368  "cellMeasurementResultList size = " << params.cellMeasurementResultList.size());
369 
371  }
372  }
373  else if (procedureCode == EpcX2Header::HandoverCancel)
374  {
375  if (messageType == EpcX2Header::SuccessfulOutcome)
376  {
377  NS_LOG_LOGIC("Recv X2 message: HANDOVER CANCEL");
378 
379  EpcX2HandoverCancelHeader x2HoCancelHeader;
380  packet->RemoveHeader(x2HoCancelHeader);
381 
382  NS_LOG_INFO("X2 HandoverCancel header: " << x2HoCancelHeader);
383 
385  params.oldEnbUeX2apId = x2HoCancelHeader.GetOldEnbUeX2apId();
386  params.newEnbUeX2apId = x2HoCancelHeader.GetNewEnbUeX2apId();
387  params.sourceCellId = cellsInfo->m_localCellIds.at(0);
388  params.targetCellId = cellsInfo->m_remoteCellIds.at(0);
389  params.cause = x2HoCancelHeader.GetCause();
390 
391  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
392  NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
393  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
394  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
395  NS_LOG_LOGIC("cause = " << params.cause);
396 
398  }
399  }
400  else
401  {
402  NS_ASSERT_MSG(false, "ProcedureCode NOT SUPPORTED!!!");
403  }
404 }
405 
406 void
408 {
409  NS_LOG_FUNCTION(this << socket);
410 
411  NS_LOG_LOGIC("Recv UE DATA through X2-U interface from Socket");
412  Ptr<Packet> packet = socket->Recv();
413  NS_LOG_LOGIC("packetLen = " << packet->GetSize());
414 
416  "Missing infos of local and remote CellId");
417  Ptr<X2CellInfo> cellsInfo = m_x2InterfaceCellIds[socket];
418 
419  GtpuHeader gtpu;
420  packet->RemoveHeader(gtpu);
421 
422  NS_LOG_LOGIC("GTP-U header: " << gtpu);
423 
425  params.sourceCellId = cellsInfo->m_remoteCellIds.at(0);
426  params.targetCellId = cellsInfo->m_localCellIds.at(0);
427  params.gtpTeid = gtpu.GetTeid();
428  params.ueData = packet;
429 
431 }
432 
433 //
434 // Implementation of the X2 SAP Provider
435 //
436 void
438 {
439  NS_LOG_FUNCTION(this);
440 
441  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
442  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
443  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
444  NS_LOG_LOGIC("mmeUeS1apId = " << params.mmeUeS1apId);
445 
447  "Missing infos for targetCellId = " << params.targetCellId);
448  Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets[params.targetCellId];
449  Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
450  Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
451 
452  NS_LOG_LOGIC("sourceSocket = " << sourceSocket);
453  NS_LOG_LOGIC("targetIpAddr = " << targetIpAddr);
454 
455  NS_LOG_INFO("Send X2 message: HANDOVER REQUEST");
456 
457  // Build the X2 message
458  EpcX2HandoverRequestHeader x2HoReqHeader;
459  x2HoReqHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
460  x2HoReqHeader.SetCause(params.cause);
461  x2HoReqHeader.SetTargetCellId(params.targetCellId);
462  x2HoReqHeader.SetMmeUeS1apId(params.mmeUeS1apId);
463  x2HoReqHeader.SetUeAggregateMaxBitRateDownlink(params.ueAggregateMaxBitRateDownlink);
464  x2HoReqHeader.SetUeAggregateMaxBitRateUplink(params.ueAggregateMaxBitRateUplink);
465  x2HoReqHeader.SetBearers(params.bearers);
466 
467  EpcX2Header x2Header;
470  x2Header.SetLengthOfIes(x2HoReqHeader.GetLengthOfIes());
471  x2Header.SetNumberOfIes(x2HoReqHeader.GetNumberOfIes());
472 
473  NS_LOG_INFO("X2 header: " << x2Header);
474  NS_LOG_INFO("X2 HandoverRequest header: " << x2HoReqHeader);
475 
476  // Build the X2 packet
477  Ptr<Packet> packet = (params.rrcContext) ? (params.rrcContext) : (Create<Packet>());
478  packet->AddHeader(x2HoReqHeader);
479  packet->AddHeader(x2Header);
480  NS_LOG_INFO("packetLen = " << packet->GetSize());
481 
482  // Send the X2 message through the socket
483  sourceSocket->SendTo(packet, 0, InetSocketAddress(targetIpAddr, m_x2cUdpPort));
484 }
485 
486 void
488 {
489  NS_LOG_FUNCTION(this);
490 
491  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
492  NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
493  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
494  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
495 
497  "Socket infos not defined for sourceCellId = " << params.sourceCellId);
498 
499  Ptr<Socket> localSocket = m_x2InterfaceSockets[params.sourceCellId]->m_localCtrlPlaneSocket;
500  Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.sourceCellId]->m_remoteIpAddr;
501 
502  NS_LOG_LOGIC("localSocket = " << localSocket);
503  NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
504 
505  NS_LOG_INFO("Send X2 message: HANDOVER REQUEST ACK");
506 
507  // Build the X2 message
508  EpcX2HandoverRequestAckHeader x2HoAckHeader;
509  x2HoAckHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
510  x2HoAckHeader.SetNewEnbUeX2apId(params.newEnbUeX2apId);
511  x2HoAckHeader.SetAdmittedBearers(params.admittedBearers);
512  x2HoAckHeader.SetNotAdmittedBearers(params.notAdmittedBearers);
513 
514  EpcX2Header x2Header;
517  x2Header.SetLengthOfIes(x2HoAckHeader.GetLengthOfIes());
518  x2Header.SetNumberOfIes(x2HoAckHeader.GetNumberOfIes());
519 
520  NS_LOG_INFO("X2 header: " << x2Header);
521  NS_LOG_INFO("X2 HandoverAck header: " << x2HoAckHeader);
522  NS_LOG_INFO("RRC context: " << params.rrcContext);
523 
524  // Build the X2 packet
525  Ptr<Packet> packet = (params.rrcContext) ? (params.rrcContext) : (Create<Packet>());
526  packet->AddHeader(x2HoAckHeader);
527  packet->AddHeader(x2Header);
528  NS_LOG_INFO("packetLen = " << packet->GetSize());
529 
530  // Send the X2 message through the socket
531  localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
532 }
533 
534 void
536 {
537  NS_LOG_FUNCTION(this);
538 
539  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
540  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
541  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
542  NS_LOG_LOGIC("cause = " << params.cause);
543  NS_LOG_LOGIC("criticalityDiagnostics = " << params.criticalityDiagnostics);
544 
546  "Socket infos not defined for sourceCellId = " << params.sourceCellId);
547 
548  Ptr<Socket> localSocket = m_x2InterfaceSockets[params.sourceCellId]->m_localCtrlPlaneSocket;
549  Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.sourceCellId]->m_remoteIpAddr;
550 
551  NS_LOG_LOGIC("localSocket = " << localSocket);
552  NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
553 
554  NS_LOG_INFO("Send X2 message: HANDOVER PREPARATION FAILURE");
555 
556  // Build the X2 message
557  EpcX2HandoverPreparationFailureHeader x2HoPrepFailHeader;
558  x2HoPrepFailHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
559  x2HoPrepFailHeader.SetCause(params.cause);
560  x2HoPrepFailHeader.SetCriticalityDiagnostics(params.criticalityDiagnostics);
561 
562  EpcX2Header x2Header;
565  x2Header.SetLengthOfIes(x2HoPrepFailHeader.GetLengthOfIes());
566  x2Header.SetNumberOfIes(x2HoPrepFailHeader.GetNumberOfIes());
567 
568  NS_LOG_INFO("X2 header: " << x2Header);
569  NS_LOG_INFO("X2 HandoverPrepFail header: " << x2HoPrepFailHeader);
570 
571  // Build the X2 packet
572  Ptr<Packet> packet = Create<Packet>();
573  packet->AddHeader(x2HoPrepFailHeader);
574  packet->AddHeader(x2Header);
575  NS_LOG_INFO("packetLen = " << packet->GetSize());
576 
577  // Send the X2 message through the socket
578  localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
579 }
580 
581 void
583 {
584  NS_LOG_FUNCTION(this);
585 
586  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
587  NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
588  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
589  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
590  NS_LOG_LOGIC("erabsList size = " << params.erabsSubjectToStatusTransferList.size());
591 
593  "Socket infos not defined for targetCellId = " << params.targetCellId);
594 
595  Ptr<Socket> localSocket = m_x2InterfaceSockets[params.targetCellId]->m_localCtrlPlaneSocket;
596  Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.targetCellId]->m_remoteIpAddr;
597 
598  NS_LOG_LOGIC("localSocket = " << localSocket);
599  NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
600 
601  NS_LOG_INFO("Send X2 message: SN STATUS TRANSFER");
602 
603  // Build the X2 message
604  EpcX2SnStatusTransferHeader x2SnStatusXferHeader;
605  x2SnStatusXferHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
606  x2SnStatusXferHeader.SetNewEnbUeX2apId(params.newEnbUeX2apId);
607  x2SnStatusXferHeader.SetErabsSubjectToStatusTransferList(
608  params.erabsSubjectToStatusTransferList);
609 
610  EpcX2Header x2Header;
613  x2Header.SetLengthOfIes(x2SnStatusXferHeader.GetLengthOfIes());
614  x2Header.SetNumberOfIes(x2SnStatusXferHeader.GetNumberOfIes());
615 
616  NS_LOG_INFO("X2 header: " << x2Header);
617  NS_LOG_INFO("X2 SnStatusTransfer header: " << x2SnStatusXferHeader);
618 
619  // Build the X2 packet
620  Ptr<Packet> packet = Create<Packet>();
621  packet->AddHeader(x2SnStatusXferHeader);
622  packet->AddHeader(x2Header);
623  NS_LOG_INFO("packetLen = " << packet->GetSize());
624 
625  // Send the X2 message through the socket
626  localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
627 }
628 
629 void
631 {
632  NS_LOG_FUNCTION(this);
633 
634  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
635  NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
636  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
637 
639  "Socket infos not defined for sourceCellId = " << params.sourceCellId);
640 
641  Ptr<Socket> localSocket = m_x2InterfaceSockets[params.sourceCellId]->m_localCtrlPlaneSocket;
642  Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.sourceCellId]->m_remoteIpAddr;
643 
644  NS_LOG_LOGIC("localSocket = " << localSocket);
645  NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
646 
647  NS_LOG_INFO("Send X2 message: UE CONTEXT RELEASE");
648 
649  // Build the X2 message
650  EpcX2UeContextReleaseHeader x2UeCtxReleaseHeader;
651  x2UeCtxReleaseHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
652  x2UeCtxReleaseHeader.SetNewEnbUeX2apId(params.newEnbUeX2apId);
653 
654  EpcX2Header x2Header;
657  x2Header.SetLengthOfIes(x2UeCtxReleaseHeader.GetLengthOfIes());
658  x2Header.SetNumberOfIes(x2UeCtxReleaseHeader.GetNumberOfIes());
659 
660  NS_LOG_INFO("X2 header: " << x2Header);
661  NS_LOG_INFO("X2 UeContextRelease header: " << x2UeCtxReleaseHeader);
662 
663  // Build the X2 packet
664  Ptr<Packet> packet = Create<Packet>();
665  packet->AddHeader(x2UeCtxReleaseHeader);
666  packet->AddHeader(x2Header);
667  NS_LOG_INFO("packetLen = " << packet->GetSize());
668 
669  // Send the X2 message through the socket
670  localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
671 }
672 
673 void
675 {
676  NS_LOG_FUNCTION(this);
677 
678  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
679  NS_LOG_LOGIC("cellInformationList size = " << params.cellInformationList.size());
680 
682  "Missing infos for targetCellId = " << params.targetCellId);
683  Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets[params.targetCellId];
684  Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
685  Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
686 
687  NS_LOG_LOGIC("sourceSocket = " << sourceSocket);
688  NS_LOG_LOGIC("targetIpAddr = " << targetIpAddr);
689 
690  NS_LOG_INFO("Send X2 message: LOAD INFORMATION");
691 
692  // Build the X2 message
693  EpcX2LoadInformationHeader x2LoadInfoHeader;
694  x2LoadInfoHeader.SetCellInformationList(params.cellInformationList);
695 
696  EpcX2Header x2Header;
699  x2Header.SetLengthOfIes(x2LoadInfoHeader.GetLengthOfIes());
700  x2Header.SetNumberOfIes(x2LoadInfoHeader.GetNumberOfIes());
701 
702  NS_LOG_INFO("X2 header: " << x2Header);
703  NS_LOG_INFO("X2 LoadInformation header: " << x2LoadInfoHeader);
704 
705  // Build the X2 packet
706  Ptr<Packet> packet = Create<Packet>();
707  packet->AddHeader(x2LoadInfoHeader);
708  packet->AddHeader(x2Header);
709  NS_LOG_INFO("packetLen = " << packet->GetSize());
710 
711  // Send the X2 message through the socket
712  sourceSocket->SendTo(packet, 0, InetSocketAddress(targetIpAddr, m_x2cUdpPort));
713 }
714 
715 void
717 {
718  NS_LOG_FUNCTION(this);
719 
720  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
721  NS_LOG_LOGIC("enb1MeasurementId = " << params.enb1MeasurementId);
722  NS_LOG_LOGIC("enb2MeasurementId = " << params.enb2MeasurementId);
723  NS_LOG_LOGIC("cellMeasurementResultList size = " << params.cellMeasurementResultList.size());
724 
726  "Missing infos for targetCellId = " << params.targetCellId);
727  Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets[params.targetCellId];
728  Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
729  Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
730 
731  NS_LOG_LOGIC("sourceSocket = " << sourceSocket);
732  NS_LOG_LOGIC("targetIpAddr = " << targetIpAddr);
733 
734  NS_LOG_INFO("Send X2 message: RESOURCE STATUS UPDATE");
735 
736  // Build the X2 message
737  EpcX2ResourceStatusUpdateHeader x2ResourceStatUpdHeader;
738  x2ResourceStatUpdHeader.SetEnb1MeasurementId(params.enb1MeasurementId);
739  x2ResourceStatUpdHeader.SetEnb2MeasurementId(params.enb2MeasurementId);
740  x2ResourceStatUpdHeader.SetCellMeasurementResultList(params.cellMeasurementResultList);
741 
742  EpcX2Header x2Header;
745  x2Header.SetLengthOfIes(x2ResourceStatUpdHeader.GetLengthOfIes());
746  x2Header.SetNumberOfIes(x2ResourceStatUpdHeader.GetNumberOfIes());
747 
748  NS_LOG_INFO("X2 header: " << x2Header);
749  NS_LOG_INFO("X2 ResourceStatusUpdate header: " << x2ResourceStatUpdHeader);
750 
751  // Build the X2 packet
752  Ptr<Packet> packet = Create<Packet>();
753  packet->AddHeader(x2ResourceStatUpdHeader);
754  packet->AddHeader(x2Header);
755  NS_LOG_INFO("packetLen = " << packet->GetSize());
756 
757  // Send the X2 message through the socket
758  sourceSocket->SendTo(packet, 0, InetSocketAddress(targetIpAddr, m_x2cUdpPort));
759 }
760 
761 void
763 {
764  NS_LOG_FUNCTION(this);
765 
766  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
767  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
768  NS_LOG_LOGIC("gtpTeid = " << params.gtpTeid);
769 
771  "Missing infos for targetCellId = " << params.targetCellId);
772  Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets[params.targetCellId];
773  Ptr<Socket> sourceSocket = socketInfo->m_localUserPlaneSocket;
774  Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
775 
776  NS_LOG_LOGIC("sourceSocket = " << sourceSocket);
777  NS_LOG_LOGIC("targetIpAddr = " << targetIpAddr);
778 
779  GtpuHeader gtpu;
780  gtpu.SetTeid(params.gtpTeid);
781  gtpu.SetLength(params.ueData->GetSize() + gtpu.GetSerializedSize() -
782  8);
783  NS_LOG_INFO("GTP-U header: " << gtpu);
784 
785  Ptr<Packet> packet = params.ueData;
786  packet->AddHeader(gtpu);
787 
788  NS_LOG_INFO("Forward UE DATA through X2 interface");
789  sourceSocket->SendTo(packet, 0, InetSocketAddress(targetIpAddr, m_x2uUdpPort));
790 }
791 
792 void
794 {
795  NS_LOG_FUNCTION(this);
796 
797  NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
798  NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
799  NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
800  NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
801 
803  "Socket infos not defined for targetCellId = " << params.targetCellId);
804 
805  Ptr<Socket> localSocket = m_x2InterfaceSockets[params.targetCellId]->m_localCtrlPlaneSocket;
806  Ipv4Address remoteIpAddr = m_x2InterfaceSockets[params.targetCellId]->m_remoteIpAddr;
807 
808  NS_LOG_LOGIC("localSocket = " << localSocket);
809  NS_LOG_LOGIC("remoteIpAddr = " << remoteIpAddr);
810 
811  NS_LOG_INFO("Send X2 message: HANDOVER CANCEL");
812 
813  // Build the X2 message
814  EpcX2HandoverCancelHeader x2HandoverCancelHeader;
815  x2HandoverCancelHeader.SetOldEnbUeX2apId(params.oldEnbUeX2apId);
816  x2HandoverCancelHeader.SetNewEnbUeX2apId(params.newEnbUeX2apId);
817  x2HandoverCancelHeader.SetCause(params.cause);
818 
819  EpcX2Header x2Header;
822  x2Header.SetLengthOfIes(x2HandoverCancelHeader.GetLengthOfIes());
823  x2Header.SetNumberOfIes(x2HandoverCancelHeader.GetNumberOfIes());
824 
825  NS_LOG_INFO("X2 header: " << x2Header);
826  NS_LOG_INFO("X2 UeContextRelease header: " << x2HandoverCancelHeader);
827 
828  // Build the X2 packet
829  Ptr<Packet> packet = Create<Packet>();
830  packet->AddHeader(x2HandoverCancelHeader);
831  packet->AddHeader(x2Header);
832  NS_LOG_INFO("packetLen = " << packet->GetSize());
833 
834  // Send the X2 message through the socket
835  localSocket->SendTo(packet, 0, InetSocketAddress(remoteIpAddr, m_x2cUdpPort));
836 }
837 
838 } // 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: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
friend class EpcX2SpecificEpcX2SapProvider< EpcX2 >
allow EpcX2SpecificEpcX2SapProvider<EpcX2> class friend access
Definition: epc-x2.h:101
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
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: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
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.
Definition: ipv4-address.h:42
A base class which provides memory management and object aggregation.
Definition: object.h:89
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:294
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:268
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:861
void SetRecvCallback(Callback< void, Ptr< Socket >> receivedData)
Notify application when new data is available to be read.
Definition: socket.cc:128
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
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:72
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
a unique identifier for an interface.
Definition: type-id.h:59
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Definition: type-id.cc:835
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:931
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
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#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:86
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:282
#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:275
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
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:704
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