A Discrete-Event Network Simulator
API
epc-x2.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/inet-socket-address.h"
23 #include "ns3/packet.h"
24 #include "ns3/node.h"
25 #include "ns3/epc-gtpu-header.h"
26 
27 #include "ns3/epc-x2-header.h"
28 #include "ns3/epc-x2.h"
29 
30 namespace ns3 {
31 
32 NS_LOG_COMPONENT_DEFINE ("EpcX2");
33 
34 X2IfaceInfo::X2IfaceInfo (Ipv4Address remoteIpAddr, Ptr<Socket> localCtrlPlaneSocket, Ptr<Socket> localUserPlaneSocket)
35 {
36  m_remoteIpAddr = remoteIpAddr;
37  m_localCtrlPlaneSocket = localCtrlPlaneSocket;
38  m_localUserPlaneSocket = localUserPlaneSocket;
39 }
40 
42 {
45 }
46 
49 {
50  NS_LOG_FUNCTION (this);
54  return *this;
55 }
56 
58 
59 X2CellInfo::X2CellInfo (uint16_t localCellId, uint16_t remoteCellId)
60 {
61  m_localCellId = localCellId;
62  m_remoteCellId = remoteCellId;
63 }
64 
66 {
67  m_localCellId = 0;
68  m_remoteCellId = 0;
69 }
70 
71 X2CellInfo&
73 {
74  NS_LOG_FUNCTION (this);
77  return *this;
78 }
79 
81 
83 
85  : m_x2cUdpPort (4444),
86  m_x2uUdpPort (2152)
87 {
88  NS_LOG_FUNCTION (this);
89 
91 }
92 
94 {
95  NS_LOG_FUNCTION (this);
96 }
97 
98 void
100 {
101  NS_LOG_FUNCTION (this);
102 
103  m_x2InterfaceSockets.clear ();
104  m_x2InterfaceCellIds.clear ();
105  delete m_x2SapProvider;
106 }
107 
108 TypeId
110 {
111  static TypeId tid = TypeId ("ns3::EpcX2")
112  .SetParent<Object> ()
113  .SetGroupName("Lte");
114  return tid;
115 }
116 
117 void
119 {
120  NS_LOG_FUNCTION (this << s);
121  m_x2SapUser = s;
122 }
123 
126 {
127  NS_LOG_FUNCTION (this);
128  return m_x2SapProvider;
129 }
130 
131 
132 void
133 EpcX2::AddX2Interface (uint16_t localCellId, Ipv4Address localX2Address, uint16_t remoteCellId, Ipv4Address remoteX2Address)
134 {
135  NS_LOG_FUNCTION (this << localCellId << localX2Address << remoteCellId << remoteX2Address);
136 
137  int retval;
138 
139  // Get local eNB where this X2 entity belongs to
140  Ptr<Node> localEnb = GetObject<Node> ();
141 
142  // Create X2-C socket for the local eNB
143  Ptr<Socket> localX2cSocket = Socket::CreateSocket (localEnb, TypeId::LookupByName ("ns3::UdpSocketFactory"));
144  retval = localX2cSocket->Bind (InetSocketAddress (localX2Address, m_x2cUdpPort));
145  NS_ASSERT (retval == 0);
146  localX2cSocket->SetRecvCallback (MakeCallback (&EpcX2::RecvFromX2cSocket, this));
147 
148  // Create X2-U socket for the local eNB
149  Ptr<Socket> localX2uSocket = Socket::CreateSocket (localEnb, TypeId::LookupByName ("ns3::UdpSocketFactory"));
150  retval = localX2uSocket->Bind (InetSocketAddress (localX2Address, m_x2uUdpPort));
151  NS_ASSERT (retval == 0);
152  localX2uSocket->SetRecvCallback (MakeCallback (&EpcX2::RecvFromX2uSocket, this));
153 
154 
155  NS_ASSERT_MSG (m_x2InterfaceSockets.find (remoteCellId) == m_x2InterfaceSockets.end (),
156  "Mapping for remoteCellId = " << remoteCellId << " is already known");
157  m_x2InterfaceSockets [remoteCellId] = Create<X2IfaceInfo> (remoteX2Address, localX2cSocket, localX2uSocket);
158 
159  NS_ASSERT_MSG (m_x2InterfaceCellIds.find (localX2cSocket) == m_x2InterfaceCellIds.end (),
160  "Mapping for control plane localSocket = " << localX2cSocket << " is already known");
161  m_x2InterfaceCellIds [localX2cSocket] = Create<X2CellInfo> (localCellId, remoteCellId);
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> (localCellId, remoteCellId);
166 }
167 
168 
169 void
171 {
172  NS_LOG_FUNCTION (this << socket);
173 
174  NS_LOG_LOGIC ("Recv X2 message: from Socket");
175  Ptr<Packet> packet = socket->Recv ();
176  NS_LOG_LOGIC ("packetLen = " << packet->GetSize ());
177 
179  "Missing infos of local and remote CellId");
180  Ptr<X2CellInfo> cellsInfo = m_x2InterfaceCellIds [socket];
181 
182  EpcX2Header x2Header;
183  packet->RemoveHeader (x2Header);
184 
185  NS_LOG_LOGIC ("X2 header: " << x2Header);
186 
187  uint8_t messageType = x2Header.GetMessageType ();
188  uint8_t procedureCode = x2Header.GetProcedureCode ();
189 
190  if (procedureCode == EpcX2Header::HandoverPreparation)
191  {
192  if (messageType == EpcX2Header::InitiatingMessage)
193  {
194  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST");
195 
196  EpcX2HandoverRequestHeader x2HoReqHeader;
197  packet->RemoveHeader (x2HoReqHeader);
198 
199  NS_LOG_INFO ("X2 HandoverRequest header: " << x2HoReqHeader);
200 
202  params.oldEnbUeX2apId = x2HoReqHeader.GetOldEnbUeX2apId ();
203  params.cause = x2HoReqHeader.GetCause ();
204  params.sourceCellId = cellsInfo->m_remoteCellId;
205  params.targetCellId = x2HoReqHeader.GetTargetCellId ();
206  params.mmeUeS1apId = x2HoReqHeader.GetMmeUeS1apId ();
209  params.bearers = x2HoReqHeader.GetBearers ();
210  params.rrcContext = packet;
211 
212  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
213  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
214  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
215  NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId);
216  NS_LOG_LOGIC ("cellsInfo->m_localCellId = " << cellsInfo->m_localCellId);
217  NS_ASSERT_MSG (params.targetCellId == cellsInfo->m_localCellId,
218  "TargetCellId mismatches with localCellId");
219 
221  }
222  else if (messageType == EpcX2Header::SuccessfulOutcome)
223  {
224  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK");
225 
226  EpcX2HandoverRequestAckHeader x2HoReqAckHeader;
227  packet->RemoveHeader (x2HoReqAckHeader);
228 
229  NS_LOG_INFO ("X2 HandoverRequestAck header: " << x2HoReqAckHeader);
230 
232  params.oldEnbUeX2apId = x2HoReqAckHeader.GetOldEnbUeX2apId ();
233  params.newEnbUeX2apId = x2HoReqAckHeader.GetNewEnbUeX2apId ();
234  params.sourceCellId = cellsInfo->m_localCellId;
235  params.targetCellId = cellsInfo->m_remoteCellId;
236  params.admittedBearers = x2HoReqAckHeader.GetAdmittedBearers ();
237  params.notAdmittedBearers = x2HoReqAckHeader.GetNotAdmittedBearers ();
238  params.rrcContext = packet;
239 
240  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
241  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
242  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
243  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
244 
246  }
247  else // messageType == EpcX2Header::UnsuccessfulOutcome
248  {
249  NS_LOG_LOGIC ("Recv X2 message: HANDOVER PREPARATION FAILURE");
250 
251  EpcX2HandoverPreparationFailureHeader x2HoPrepFailHeader;
252  packet->RemoveHeader (x2HoPrepFailHeader);
253 
254  NS_LOG_INFO ("X2 HandoverPreparationFailure header: " << x2HoPrepFailHeader);
255 
257  params.oldEnbUeX2apId = x2HoPrepFailHeader.GetOldEnbUeX2apId ();
258  params.sourceCellId = cellsInfo->m_localCellId;
259  params.targetCellId = cellsInfo->m_remoteCellId;
260  params.cause = x2HoPrepFailHeader.GetCause ();
261  params.criticalityDiagnostics = x2HoPrepFailHeader.GetCriticalityDiagnostics ();
262 
263  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
264  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
265  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
266  NS_LOG_LOGIC ("cause = " << params.cause);
267  NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics);
268 
270  }
271  }
272  else if (procedureCode == EpcX2Header::LoadIndication)
273  {
274  if (messageType == EpcX2Header::InitiatingMessage)
275  {
276  NS_LOG_LOGIC ("Recv X2 message: LOAD INFORMATION");
277 
278  EpcX2LoadInformationHeader x2LoadInfoHeader;
279  packet->RemoveHeader (x2LoadInfoHeader);
280 
281  NS_LOG_INFO ("X2 LoadInformation header: " << x2LoadInfoHeader);
282 
284  params.cellInformationList = x2LoadInfoHeader.GetCellInformationList ();
285 
286  NS_LOG_LOGIC ("cellInformationList size = " << params.cellInformationList.size ());
287 
289  }
290  }
291  else if (procedureCode == EpcX2Header::SnStatusTransfer)
292  {
293  if (messageType == EpcX2Header::InitiatingMessage)
294  {
295  NS_LOG_LOGIC ("Recv X2 message: SN STATUS TRANSFER");
296 
297  EpcX2SnStatusTransferHeader x2SnStatusXferHeader;
298  packet->RemoveHeader (x2SnStatusXferHeader);
299 
300  NS_LOG_INFO ("X2 SnStatusTransfer header: " << x2SnStatusXferHeader);
301 
303  params.oldEnbUeX2apId = x2SnStatusXferHeader.GetOldEnbUeX2apId ();
304  params.newEnbUeX2apId = x2SnStatusXferHeader.GetNewEnbUeX2apId ();
305  params.sourceCellId = cellsInfo->m_remoteCellId;
306  params.targetCellId = cellsInfo->m_localCellId;
308 
309  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
310  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
311  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
312  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
313  NS_LOG_LOGIC ("erabsList size = " << params.erabsSubjectToStatusTransferList.size ());
314 
316  }
317  }
318  else if (procedureCode == EpcX2Header::UeContextRelease)
319  {
320  if (messageType == EpcX2Header::InitiatingMessage)
321  {
322  NS_LOG_LOGIC ("Recv X2 message: UE CONTEXT RELEASE");
323 
324  EpcX2UeContextReleaseHeader x2UeCtxReleaseHeader;
325  packet->RemoveHeader (x2UeCtxReleaseHeader);
326 
327  NS_LOG_INFO ("X2 UeContextRelease header: " << x2UeCtxReleaseHeader);
328 
330  params.oldEnbUeX2apId = x2UeCtxReleaseHeader.GetOldEnbUeX2apId ();
331  params.newEnbUeX2apId = x2UeCtxReleaseHeader.GetNewEnbUeX2apId ();
332 
333  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
334  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
335 
337  }
338  }
339  else if (procedureCode == EpcX2Header::ResourceStatusReporting)
340  {
341  if (messageType == EpcX2Header::InitiatingMessage)
342  {
343  NS_LOG_LOGIC ("Recv X2 message: RESOURCE STATUS UPDATE");
344 
345  EpcX2ResourceStatusUpdateHeader x2ResStatUpdHeader;
346  packet->RemoveHeader (x2ResStatUpdHeader);
347 
348  NS_LOG_INFO ("X2 ResourceStatusUpdate header: " << x2ResStatUpdHeader);
349 
351  params.targetCellId = 0;
352  params.enb1MeasurementId = x2ResStatUpdHeader.GetEnb1MeasurementId ();
353  params.enb2MeasurementId = x2ResStatUpdHeader.GetEnb2MeasurementId ();
354  params.cellMeasurementResultList = x2ResStatUpdHeader.GetCellMeasurementResultList ();
355 
356  NS_LOG_LOGIC ("enb1MeasurementId = " << params.enb1MeasurementId);
357  NS_LOG_LOGIC ("enb2MeasurementId = " << params.enb2MeasurementId);
358  NS_LOG_LOGIC ("cellMeasurementResultList size = " << params.cellMeasurementResultList.size ());
359 
361  }
362  }
363  else
364  {
365  NS_ASSERT_MSG (false, "ProcedureCode NOT SUPPORTED!!!");
366  }
367 }
368 
369 
370 void
372 {
373  NS_LOG_FUNCTION (this << socket);
374 
375  NS_LOG_LOGIC ("Recv UE DATA through X2-U interface from Socket");
376  Ptr<Packet> packet = socket->Recv ();
377  NS_LOG_LOGIC ("packetLen = " << packet->GetSize ());
378 
380  "Missing infos of local and remote CellId");
381  Ptr<X2CellInfo> cellsInfo = m_x2InterfaceCellIds [socket];
382 
383  GtpuHeader gtpu;
384  packet->RemoveHeader (gtpu);
385 
386  NS_LOG_LOGIC ("GTP-U header: " << gtpu);
387 
389  params.sourceCellId = cellsInfo->m_remoteCellId;
390  params.targetCellId = cellsInfo->m_localCellId;
391  params.gtpTeid = gtpu.GetTeid ();
392  params.ueData = packet;
393 
394  m_x2SapUser->RecvUeData (params);
395 }
396 
397 
398 //
399 // Implementation of the X2 SAP Provider
400 //
401 void
403 {
404  NS_LOG_FUNCTION (this);
405 
406  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
407  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
408  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
409  NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId);
410 
412  "Missing infos for targetCellId = " << params.targetCellId);
413  Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets [params.targetCellId];
414  Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
415  Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
416 
417  NS_LOG_LOGIC ("sourceSocket = " << sourceSocket);
418  NS_LOG_LOGIC ("targetIpAddr = " << targetIpAddr);
419 
420  NS_LOG_INFO ("Send X2 message: HANDOVER REQUEST");
421 
422  // Build the X2 message
423  EpcX2HandoverRequestHeader x2HoReqHeader;
424  x2HoReqHeader.SetOldEnbUeX2apId (params.oldEnbUeX2apId);
425  x2HoReqHeader.SetCause (params.cause);
426  x2HoReqHeader.SetTargetCellId (params.targetCellId);
427  x2HoReqHeader.SetMmeUeS1apId (params.mmeUeS1apId);
430  x2HoReqHeader.SetBearers (params.bearers);
431 
432  EpcX2Header x2Header;
435  x2Header.SetLengthOfIes (x2HoReqHeader.GetLengthOfIes ());
436  x2Header.SetNumberOfIes (x2HoReqHeader.GetNumberOfIes ());
437 
438  NS_LOG_INFO ("X2 header: " << x2Header);
439  NS_LOG_INFO ("X2 HandoverRequest header: " << x2HoReqHeader);
440 
441  // Build the X2 packet
442  Ptr<Packet> packet = (params.rrcContext != 0) ? (params.rrcContext) : (Create <Packet> ());
443  packet->AddHeader (x2HoReqHeader);
444  packet->AddHeader (x2Header);
445  NS_LOG_INFO ("packetLen = " << packet->GetSize ());
446 
447  // Send the X2 message through the socket
448  sourceSocket->SendTo (packet, 0, InetSocketAddress (targetIpAddr, m_x2cUdpPort));
449 }
450 
451 
452 void
454 {
455  NS_LOG_FUNCTION (this);
456 
457  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
458  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
459  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
460  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
461 
463  "Socket infos not defined for sourceCellId = " << params.sourceCellId);
464 
465  Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localCtrlPlaneSocket;
466  Ipv4Address remoteIpAddr = m_x2InterfaceSockets [params.sourceCellId]->m_remoteIpAddr;
467 
468  NS_LOG_LOGIC ("localSocket = " << localSocket);
469  NS_LOG_LOGIC ("remoteIpAddr = " << remoteIpAddr);
470 
471  NS_LOG_INFO ("Send X2 message: HANDOVER REQUEST ACK");
472 
473  // Build the X2 message
474  EpcX2HandoverRequestAckHeader x2HoAckHeader;
475  x2HoAckHeader.SetOldEnbUeX2apId (params.oldEnbUeX2apId);
476  x2HoAckHeader.SetNewEnbUeX2apId (params.newEnbUeX2apId);
477  x2HoAckHeader.SetAdmittedBearers (params.admittedBearers);
478  x2HoAckHeader.SetNotAdmittedBearers (params.notAdmittedBearers);
479 
480  EpcX2Header x2Header;
483  x2Header.SetLengthOfIes (x2HoAckHeader.GetLengthOfIes ());
484  x2Header.SetNumberOfIes (x2HoAckHeader.GetNumberOfIes ());
485 
486  NS_LOG_INFO ("X2 header: " << x2Header);
487  NS_LOG_INFO ("X2 HandoverAck header: " << x2HoAckHeader);
488  NS_LOG_INFO ("RRC context: " << params.rrcContext);
489 
490  // Build the X2 packet
491  Ptr<Packet> packet = (params.rrcContext != 0) ? (params.rrcContext) : (Create <Packet> ());
492  packet->AddHeader (x2HoAckHeader);
493  packet->AddHeader (x2Header);
494  NS_LOG_INFO ("packetLen = " << packet->GetSize ());
495 
496  // Send the X2 message through the socket
497  localSocket->SendTo (packet, 0, InetSocketAddress (remoteIpAddr, m_x2cUdpPort));
498 }
499 
500 
501 void
503 {
504  NS_LOG_FUNCTION (this);
505 
506  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
507  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
508  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
509  NS_LOG_LOGIC ("cause = " << params.cause);
510  NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics);
511 
513  "Socket infos not defined for sourceCellId = " << params.sourceCellId);
514 
515  Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localCtrlPlaneSocket;
516  Ipv4Address remoteIpAddr = m_x2InterfaceSockets [params.sourceCellId]->m_remoteIpAddr;
517 
518  NS_LOG_LOGIC ("localSocket = " << localSocket);
519  NS_LOG_LOGIC ("remoteIpAddr = " << remoteIpAddr);
520 
521  NS_LOG_INFO ("Send X2 message: HANDOVER PREPARATION FAILURE");
522 
523  // Build the X2 message
524  EpcX2HandoverPreparationFailureHeader x2HoPrepFailHeader;
525  x2HoPrepFailHeader.SetOldEnbUeX2apId (params.oldEnbUeX2apId);
526  x2HoPrepFailHeader.SetCause (params.cause);
527  x2HoPrepFailHeader.SetCriticalityDiagnostics (params.criticalityDiagnostics);
528 
529  EpcX2Header x2Header;
532  x2Header.SetLengthOfIes (x2HoPrepFailHeader.GetLengthOfIes ());
533  x2Header.SetNumberOfIes (x2HoPrepFailHeader.GetNumberOfIes ());
534 
535  NS_LOG_INFO ("X2 header: " << x2Header);
536  NS_LOG_INFO ("X2 HandoverPrepFail header: " << x2HoPrepFailHeader);
537 
538  // Build the X2 packet
539  Ptr<Packet> packet = Create <Packet> ();
540  packet->AddHeader (x2HoPrepFailHeader);
541  packet->AddHeader (x2Header);
542  NS_LOG_INFO ("packetLen = " << packet->GetSize ());
543 
544  // Send the X2 message through the socket
545  localSocket->SendTo (packet, 0, InetSocketAddress (remoteIpAddr, m_x2cUdpPort));
546 }
547 
548 
549 void
551 {
552  NS_LOG_FUNCTION (this);
553 
554  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
555  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
556  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
557  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
558  NS_LOG_LOGIC ("erabsList size = " << params.erabsSubjectToStatusTransferList.size ());
559 
561  "Socket infos not defined for targetCellId = " << params.targetCellId);
562 
563  Ptr<Socket> localSocket = m_x2InterfaceSockets [params.targetCellId]->m_localCtrlPlaneSocket;
564  Ipv4Address remoteIpAddr = m_x2InterfaceSockets [params.targetCellId]->m_remoteIpAddr;
565 
566  NS_LOG_LOGIC ("localSocket = " << localSocket);
567  NS_LOG_LOGIC ("remoteIpAddr = " << remoteIpAddr);
568 
569  NS_LOG_INFO ("Send X2 message: SN STATUS TRANSFER");
570 
571  // Build the X2 message
572  EpcX2SnStatusTransferHeader x2SnStatusXferHeader;
573  x2SnStatusXferHeader.SetOldEnbUeX2apId (params.oldEnbUeX2apId);
574  x2SnStatusXferHeader.SetNewEnbUeX2apId (params.newEnbUeX2apId);
576 
577  EpcX2Header x2Header;
580  x2Header.SetLengthOfIes (x2SnStatusXferHeader.GetLengthOfIes ());
581  x2Header.SetNumberOfIes (x2SnStatusXferHeader.GetNumberOfIes ());
582 
583  NS_LOG_INFO ("X2 header: " << x2Header);
584  NS_LOG_INFO ("X2 SnStatusTransfer header: " << x2SnStatusXferHeader);
585 
586  // Build the X2 packet
587  Ptr<Packet> packet = Create <Packet> ();
588  packet->AddHeader (x2SnStatusXferHeader);
589  packet->AddHeader (x2Header);
590  NS_LOG_INFO ("packetLen = " << packet->GetSize ());
591 
592  // Send the X2 message through the socket
593  localSocket->SendTo (packet, 0, InetSocketAddress (remoteIpAddr, m_x2cUdpPort));
594 }
595 
596 
597 void
599 {
600  NS_LOG_FUNCTION (this);
601 
602  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
603  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
604  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
605 
607  "Socket infos not defined for sourceCellId = " << params.sourceCellId);
608 
609  Ptr<Socket> localSocket = m_x2InterfaceSockets [params.sourceCellId]->m_localCtrlPlaneSocket;
610  Ipv4Address remoteIpAddr = m_x2InterfaceSockets [params.sourceCellId]->m_remoteIpAddr;
611 
612  NS_LOG_LOGIC ("localSocket = " << localSocket);
613  NS_LOG_LOGIC ("remoteIpAddr = " << remoteIpAddr);
614 
615  NS_LOG_INFO ("Send X2 message: UE CONTEXT RELEASE");
616 
617  // Build the X2 message
618  EpcX2UeContextReleaseHeader x2UeCtxReleaseHeader;
619  x2UeCtxReleaseHeader.SetOldEnbUeX2apId (params.oldEnbUeX2apId);
620  x2UeCtxReleaseHeader.SetNewEnbUeX2apId (params.newEnbUeX2apId);
621 
622  EpcX2Header x2Header;
625  x2Header.SetLengthOfIes (x2UeCtxReleaseHeader.GetLengthOfIes ());
626  x2Header.SetNumberOfIes (x2UeCtxReleaseHeader.GetNumberOfIes ());
627 
628  NS_LOG_INFO ("X2 header: " << x2Header);
629  NS_LOG_INFO ("X2 UeContextRelease header: " << x2UeCtxReleaseHeader);
630 
631  // Build the X2 packet
632  Ptr<Packet> packet = Create <Packet> ();
633  packet->AddHeader (x2UeCtxReleaseHeader);
634  packet->AddHeader (x2Header);
635  NS_LOG_INFO ("packetLen = " << packet->GetSize ());
636 
637  // Send the X2 message through the socket
638  localSocket->SendTo (packet, 0, InetSocketAddress (remoteIpAddr, m_x2cUdpPort));
639 }
640 
641 
642 void
644 {
645  NS_LOG_FUNCTION (this);
646 
647  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
648  NS_LOG_LOGIC ("cellInformationList size = " << params.cellInformationList.size ());
649 
651  "Missing infos for targetCellId = " << params.targetCellId);
652  Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets [params.targetCellId];
653  Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
654  Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
655 
656  NS_LOG_LOGIC ("sourceSocket = " << sourceSocket);
657  NS_LOG_LOGIC ("targetIpAddr = " << targetIpAddr);
658 
659  NS_LOG_INFO ("Send X2 message: LOAD INFORMATION");
660 
661  // Build the X2 message
662  EpcX2LoadInformationHeader x2LoadInfoHeader;
663  x2LoadInfoHeader.SetCellInformationList (params.cellInformationList);
664 
665  EpcX2Header x2Header;
668  x2Header.SetLengthOfIes (x2LoadInfoHeader.GetLengthOfIes ());
669  x2Header.SetNumberOfIes (x2LoadInfoHeader.GetNumberOfIes ());
670 
671  NS_LOG_INFO ("X2 header: " << x2Header);
672  NS_LOG_INFO ("X2 LoadInformation header: " << x2LoadInfoHeader);
673 
674  // Build the X2 packet
675  Ptr<Packet> packet = Create <Packet> ();
676  packet->AddHeader (x2LoadInfoHeader);
677  packet->AddHeader (x2Header);
678  NS_LOG_INFO ("packetLen = " << packet->GetSize ());
679 
680  // Send the X2 message through the socket
681  sourceSocket->SendTo (packet, 0, InetSocketAddress (targetIpAddr, m_x2cUdpPort));
682 
683 }
684 
685 
686 void
688 {
689  NS_LOG_FUNCTION (this);
690 
691  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
692  NS_LOG_LOGIC ("enb1MeasurementId = " << params.enb1MeasurementId);
693  NS_LOG_LOGIC ("enb2MeasurementId = " << params.enb2MeasurementId);
694  NS_LOG_LOGIC ("cellMeasurementResultList size = " << params.cellMeasurementResultList.size ());
695 
697  "Missing infos for targetCellId = " << params.targetCellId);
698  Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets [params.targetCellId];
699  Ptr<Socket> sourceSocket = socketInfo->m_localCtrlPlaneSocket;
700  Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
701 
702  NS_LOG_LOGIC ("sourceSocket = " << sourceSocket);
703  NS_LOG_LOGIC ("targetIpAddr = " << targetIpAddr);
704 
705  NS_LOG_INFO ("Send X2 message: RESOURCE STATUS UPDATE");
706 
707  // Build the X2 message
708  EpcX2ResourceStatusUpdateHeader x2ResourceStatUpdHeader;
709  x2ResourceStatUpdHeader.SetEnb1MeasurementId (params.enb1MeasurementId);
710  x2ResourceStatUpdHeader.SetEnb2MeasurementId (params.enb2MeasurementId);
711  x2ResourceStatUpdHeader.SetCellMeasurementResultList (params.cellMeasurementResultList);
712 
713  EpcX2Header x2Header;
716  x2Header.SetLengthOfIes (x2ResourceStatUpdHeader.GetLengthOfIes ());
717  x2Header.SetNumberOfIes (x2ResourceStatUpdHeader.GetNumberOfIes ());
718 
719  NS_LOG_INFO ("X2 header: " << x2Header);
720  NS_LOG_INFO ("X2 ResourceStatusUpdate header: " << x2ResourceStatUpdHeader);
721 
722  // Build the X2 packet
723  Ptr<Packet> packet = Create <Packet> ();
724  packet->AddHeader (x2ResourceStatUpdHeader);
725  packet->AddHeader (x2Header);
726  NS_LOG_INFO ("packetLen = " << packet->GetSize ());
727 
728  // Send the X2 message through the socket
729  sourceSocket->SendTo (packet, 0, InetSocketAddress (targetIpAddr, m_x2cUdpPort));
730 
731 }
732 
733 
734 void
736 {
737  NS_LOG_FUNCTION (this);
738 
739  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
740  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
741  NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid);
742 
744  "Missing infos for targetCellId = " << params.targetCellId);
745  Ptr<X2IfaceInfo> socketInfo = m_x2InterfaceSockets [params.targetCellId];
746  Ptr<Socket> sourceSocket = socketInfo->m_localUserPlaneSocket;
747  Ipv4Address targetIpAddr = socketInfo->m_remoteIpAddr;
748 
749  NS_LOG_LOGIC ("sourceSocket = " << sourceSocket);
750  NS_LOG_LOGIC ("targetIpAddr = " << targetIpAddr);
751 
752  GtpuHeader gtpu;
753  gtpu.SetTeid (params.gtpTeid);
754  gtpu.SetLength (params.ueData->GetSize () + gtpu.GetSerializedSize () - 8);
755  NS_LOG_INFO ("GTP-U header: " << gtpu);
756 
757  Ptr<Packet> packet = params.ueData;
758  packet->AddHeader (gtpu);
759 
760  NS_LOG_INFO ("Forward UE DATA through X2 interface");
761  sourceSocket->SendTo (packet, 0, InetSocketAddress (targetIpAddr, m_x2uUdpPort));
762 }
763 
764 } // namespace ns3
void SetNumberOfIes(uint32_t numberOfIes)
Set number of IEs function.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
virtual ~EpcX2(void)
Destructor.
Definition: epc-x2.cc:93
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:330
uint32_t GetNumberOfIes() const
Get number of IEs.
X2IfaceInfo.
Definition: epc-x2.h:39
EpcX2SnStatusTransferHeader.
uint32_t GetLengthOfIes() const
Get length of IEs function.
uint32_t mmeUeS1apId
MME UE S1 AP ID.
Definition: epc-x2-sap.h:234
virtual void DoSendHandoverRequest(EpcX2SapProvider::HandoverRequestParams params)
Send handover request function.
Definition: epc-x2.cc:402
virtual ~X2IfaceInfo(void)
Definition: epc-x2.cc:41
an Inet address class
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:343
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint16_t m_remoteCellId
remote cell ID
Definition: epc-x2.h:90
void SetNewEnbUeX2apId(uint16_t x2apId)
Set new ENB UE X2 AP ID function.
std::vector< EpcX2Sap::ErabsSubjectToStatusTransferItem > GetErabsSubjectToStatusTransferList() const
Get ERABs subject to status transfer list function.
Ptr< Socket > m_localUserPlaneSocket
local user plane socket
Definition: epc-x2.h:62
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
X2CellInfo & operator=(const X2CellInfo &)
Assignment operator.
Definition: epc-x2.cc:72
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:831
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:250
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:233
std::vector< CellMeasurementResultItem > cellMeasurementResultList
cell measurement result list
Definition: epc-x2-sap.h:319
uint16_t m_localCellId
local cell ID
Definition: epc-x2.h:89
Introspection did not find any typical Config paths.
Definition: epc-x2-header.h:33
virtual void RecvUeContextRelease(UeContextReleaseParams params)=0
Receive UE context release function.
Parameters of the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:228
void SetCause(uint16_t cause)
Set cause function.
static TypeId GetTypeId(void)
Get the type ID.
Definition: epc-x2.cc:109
uint32_t GetNumberOfIes() const
Get number of IEs function.
void SetLength(uint16_t length)
Set the length in octets of the payload.
uint16_t GetNewEnbUeX2apId() const
Get new ENB UE X2 AP ID function.
virtual void RecvSnStatusTransfer(SnStatusTransferParams params)=0
Receive SN status transfer function.
uint8_t GetMessageType() const
Get message type function.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
virtual void RecvHandoverRequest(HandoverRequestParams params)=0
Receive handover request function.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:249
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:292
virtual void DoSendLoadInformation(EpcX2SapProvider::LoadInformationParams params)
Send load information function.
Definition: epc-x2.cc:643
uint16_t m_x2cUdpPort
UDP ports to be used for the X2-C interface.
Definition: epc-x2.h:227
X2CellInfo.
Definition: epc-x2.h:69
uint16_t GetCriticalityDiagnostics() const
Get criticality diagnostics function.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:278
uint64_t GetUeAggregateMaxBitRateUplink() const
Get UE Aggregrate Max Bit Rate Uplik function.
virtual uint32_t GetSerializedSize(void) const
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:371
virtual ~X2CellInfo(void)
Definition: epc-x2.cc:65
virtual void DoSendUeData(EpcX2SapProvider::UeDataParams params)
Send UE data function.
Definition: epc-x2.cc:735
virtual void DoSendUeContextRelease(EpcX2SapProvider::UeContextReleaseParams params)
Send UE context release function.
Definition: epc-x2.cc:598
void SetLengthOfIes(uint32_t lengthOfIes)
Set length of IEs function.
uint16_t GetEnb1MeasurementId() const
Get ENB1 measurement ID function.
std::vector< EpcX2Sap::ErabToBeSetupItem > GetBearers() const
Get bearers function.
uint64_t ueAggregateMaxBitRateUplink
UE aggregrate max bit rate uplink.
Definition: epc-x2-sap.h:236
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:293
virtual void DoSendSnStatusTransfer(EpcX2SapProvider::SnStatusTransferParams params)
Send SN status transfer function.
Definition: epc-x2.cc:550
uint32_t GetLengthOfIes() const
Get length of IEs function.
EpcX2HandoverRequestAckHeader.
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.
Ptr< Packet > rrcContext
RRC context.
Definition: epc-x2-sap.h:254
uint32_t GetLengthOfIes() const
Get length of IEs function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
uint16_t m_x2uUdpPort
UDP ports to be used for the X2-U interface.
Definition: epc-x2.h:231
EpcX2HandoverRequestHeader.
virtual void DoSendResourceStatusUpdate(EpcX2SapProvider::ResourceStatusUpdateParams params)
Send resource status update function.
Definition: epc-x2.cc:687
void SetTargetCellId(uint16_t targetCellId)
Set target cell id function.
X2IfaceInfo & operator=(const X2IfaceInfo &)
Assignment operator.
Definition: epc-x2.cc:48
uint32_t GetTeid() const
Get a tunnel endpoint identificator (TEID)
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:248
uint32_t GetNumberOfIes() const
Get number of IEs function.
uint64_t ueAggregateMaxBitRateDownlink
UE aggregrate max bit rate downlink.
Definition: epc-x2-sap.h:235
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:170
void SetUeAggregateMaxBitRateUplink(uint64_t bitRate)
Set UE Aggregrate Max Bit Rate Uplik function.
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition: epc-x2-sap.h:262
Ptr< Socket > m_localCtrlPlaneSocket
local control plane socket
Definition: epc-x2.h:61
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:305
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
uint16_t enb2MeasurementId
ENB2 measurement ID.
Definition: epc-x2-sap.h:318
std::vector< ErabAdmittedItem > admittedBearers
admitted bearers
Definition: epc-x2-sap.h:252
std::vector< CellInformationItem > cellInformationList
cell information list
Definition: epc-x2-sap.h:306
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:276
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
virtual void DoSendHandoverRequestAck(EpcX2SapProvider::HandoverRequestAckParams params)
Send handover request ack function.
Definition: epc-x2.cc:453
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:264
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
void SetEnb1MeasurementId(uint16_t enb1MeasurementId)
Set ENB1 measurement ID function.
EpcX2ResourceStatusUpdateHeader.
EpcX2HandoverPreparationFailureHeader.
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read.
Definition: socket.cc:128
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:71
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:216
EpcX2()
Constructor.
Definition: epc-x2.cc:84
X2IfaceInfo(Ipv4Address remoteIpAddr, Ptr< Socket > localCtrlPlaneSocket, Ptr< Socket > localUserPlaneSocket)
Constructor.
Definition: epc-x2.cc:34
void SetUeAggregateMaxBitRateDownlink(uint64_t bitRate)
Set UE Aggregrate Max Bit Rate Downlink function.
virtual void RecvHandoverPreparationFailure(HandoverPreparationFailureParams params)=0
Receive handover preparation failure function.
Ptr< Packet > rrcContext
RRC context.
Definition: epc-x2-sap.h:238
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:281
std::vector< EpcX2Sap::CellMeasurementResultItem > GetCellMeasurementResultList() const
Get cell measurement results list function.
X2CellInfo(uint16_t localCellId, uint16_t remoteCellId)
Constructor.
Definition: epc-x2.cc:59
uint32_t gtpTeid
GTP TEID.
Definition: epc-x2-sap.h:332
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:314
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:278
This entity is installed inside an eNB and provides the functionality for the X2 interface.
Definition: epc-x2.h:99
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:251
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
Parameters of the UE CONTEXT RELEASE message.
Definition: epc-x2-sap.h:290
void SetNotAdmittedBearers(std::vector< EpcX2Sap::ErabNotAdmittedItem > bearers)
Set not admitted bearers function.
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:294
std::vector< EpcX2Sap::ErabNotAdmittedItem > GetNotAdmittedBearers() const
Get not admitted bearers function.
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:246
uint32_t GetNumberOfIes() const
Get number of IEs function.
void SetProcedureCode(uint8_t procedureCode)
Set procedure code function.
uint32_t GetLengthOfIes() const
Get length of IEs function.
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:406
void SetNewEnbUeX2apId(uint16_t x2apId)
Set new ENB UE X2 AP ID function.
uint32_t GetMmeUeS1apId() const
Get MME UE S1 AP ID function.
virtual void RecvUeData(UeDataParams params)=0
Receive UE data function.
uint32_t GetNumberOfIes() const
Get number of IEs function.
std::vector< ErabToBeSetupItem > bearers
bearers
Definition: epc-x2-sap.h:237
EpcX2SapUser * m_x2SapUser
X2 SAP user.
Definition: epc-x2.h:206
uint32_t GetNumberOfIes() const
Get number of IEs function.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:230
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:280
virtual void DoSendHandoverPreparationFailure(EpcX2SapProvider::HandoverPreparationFailureParams params)
Send handover preparation failure function.
Definition: epc-x2.cc:502
uint32_t GetLengthOfIes() const
Get length of IEs function.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
void SetTeid(uint32_t teid)
Set TEID function.
EpcX2SapProvider * GetEpcX2SapProvider()
Definition: epc-x2.cc:125
uint16_t enb1MeasurementId
ENB1 measurement ID.
Definition: epc-x2-sap.h:317
void SetEpcX2SapUser(EpcX2SapUser *s)
Definition: epc-x2.cc:118
uint16_t GetCause() const
Get cause function.
void SetErabsSubjectToStatusTransferList(std::vector< EpcX2Sap::ErabsSubjectToStatusTransferItem > erabs)
Set ERABs subject to status transfer list function.
std::vector< ErabNotAdmittedItem > notAdmittedBearers
not admitted bearers
Definition: epc-x2-sap.h:253
EpcX2SpecificEpcX2SapProvider.
Definition: epc-x2-sap.h:470
uint16_t GetOldEnbUeX2apId() const
Get old ENB X2 AP ID function.
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:279
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.
uint16_t GetTargetCellId() const
Get target cell id function.
std::vector< EpcX2Sap::ErabAdmittedItem > GetAdmittedBearers() const
Get admittied bearers function.
EpcX2LoadInformationHeader.
uint16_t GetNewEnbUeX2apId() const
Get new ENB UE X2 AP ID function.
uint8_t GetProcedureCode() const
Get procedure code function.
void SetNewEnbUeX2apId(uint16_t x2apId)
Set new ENB UE X2 AP ID function.
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:303
uint16_t criticalityDiagnostics
criticality diagnostics
Definition: epc-x2-sap.h:268
void SetEnb2MeasurementId(uint16_t enb2MeasurementId)
Set ENB2 measurement ID function.
void SetCellInformationList(std::vector< EpcX2Sap::CellInformationItem > cellInformationList)
Set cell information list function.
void SetAdmittedBearers(std::vector< EpcX2Sap::ErabAdmittedItem > bearers)
Set admitted bearers function.
uint16_t GetCause() const
Get cause function.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
void SetBearers(std::vector< EpcX2Sap::ErabToBeSetupItem > bearers)
Set bearers function.
Ptr< Packet > ueData
UE data.
Definition: epc-x2-sap.h:333
uint16_t GetEnb2MeasurementId() const
Get ENB2 measurement ID function.
EpcX2SapProvider * m_x2SapProvider
X2 SAP provider.
Definition: epc-x2.h:207
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB UE X2 AP ID function.
std::map< Ptr< Socket >, Ptr< X2CellInfo > > m_x2InterfaceCellIds
Map the localSocket (the one receiving the X2 message) to the corresponding (sourceCellId, targetCellId) associated with the X2 interface.
Definition: epc-x2.h:222
uint32_t GetLengthOfIes() const
Get length of IEs.
A base class which provides memory management and object aggregation.
Definition: object.h:87
uint64_t GetUeAggregateMaxBitRateDownlink() const
Get UE Aggregate Max Bit Rate Downlink function.
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:331
virtual void RecvLoadInformation(LoadInformationParams params)=0
Receive load information function.
EpcX2UeContextReleaseHeader.
void AddX2Interface(uint16_t enb1CellId, Ipv4Address enb1X2Address, uint16_t enb2CellId, Ipv4Address enb2X2Address)
Add an X2 interface to this EPC X2 entity.
Definition: epc-x2.cc:133
std::vector< EpcX2Sap::CellInformationItem > GetCellInformationList() const
Get cell information list function.
void SetOldEnbUeX2apId(uint16_t x2apId)
Set old ENB X2 AP ID function.
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:316
void SetCause(uint16_t cause)
Set cause function.
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.
virtual void DoDispose(void)
Destructor implementation.
Definition: epc-x2.cc:99
virtual void RecvHandoverRequestAck(HandoverRequestAckParams params)=0
Receive handover request ack function.
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:328
Ipv4Address m_remoteIpAddr
remote IP address
Definition: epc-x2.h:60
uint32_t GetNumberOfIes() const
Set length of IEs function.
std::vector< ErabsSubjectToStatusTransferItem > erabsSubjectToStatusTransferList
ERABs subject to status transfer list.
Definition: epc-x2-sap.h:282
a unique identifier for an interface.
Definition: type-id.h:58
void SetCriticalityDiagnostics(uint16_t criticalityDiagnostics)
Set criticality diagnostics function.
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:232
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
void SetCellMeasurementResultList(std::vector< EpcX2Sap::CellMeasurementResultItem > cellMeasurementResultList)
Set cell measurement results list function.
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
virtual void RecvResourceStatusUpdate(ResourceStatusUpdateParams params)=0
Receive resource status update function.
void SetMessageType(uint8_t messageType)
Set message type function.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Definition: type-id.cc:824
uint16_t GetNewEnbUeX2apId() const
Get new ENB UE X2 AP ID function.
Implementation of the GPRS Tunnelling Protocol header according to GTPv1-U Release 10 as per 3Gpp TS ...
void SetMmeUeS1apId(uint32_t mmeUeS1apId)
Set MME UE S1 AP ID function.
uint16_t GetOldEnbUeX2apId() const
Get old ENB UE X2 AP ID function.