5G-LENA nr-v3.0-32-g83aee33
The 5G/NR module for the ns-3 simulator
No Matches
ns3::NrPointToPointEpcHelper Class Reference

Create an EPC network with PointToPoint links. More...

#include "nr-point-to-point-epc-helper.h"

+ Inheritance diagram for ns3::NrPointToPointEpcHelper:
+ Collaboration diagram for ns3::NrPointToPointEpcHelper:

Public Member Functions

 NrPointToPointEpcHelper ()
 ~NrPointToPointEpcHelper () override

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.

Protected Member Functions

void DoActivateEpsBearerForUe (const Ptr< NetDevice > &ueDevice, const Ptr< EpcTft > &tft, const EpsBearer &bearer) const override
void DoAddX2Interface (const Ptr< EpcX2 > &gnb1X2, const Ptr< NetDevice > &gnb1NetDev, const Ipv4Address &gnb1X2Address, const Ptr< EpcX2 > &gnb2X2, const Ptr< NetDevice > &gnb2NetDev, const Ipv4Address &gnb2X2Address) const override

Detailed Description

Create an EPC network with PointToPoint links.

The class is based on the LTE version. The usage is, in most of the cases, automatic inside the NrHelper. All the user has to do, is:

  Ptr<NrPointToPointEpcHelper> epcHelper = CreateObject<NrPointToPointEpcHelper> ();
  Ptr<NrHelper> nrHelper = CreateObject<NrHelper> ();
  nrHelper->SetEpcHelper (epcHelper);

This helper will then used to create the links between the GNBs and the EPC. All links will be point-to-point, with some properties. The user can set the point-to-point links properties by using:

  epcHelper->SetAttribute ("AttributeName", UintegerValue (10));

And these attribute will be valid for all the code that follows the SetAttribute call. The list of attributes can be seen in the class PointToPointEpcHelper in the ns-3 code base.

Obtaining the PGW node

You can obtain the pointer to the PGW node by doing:

  Ptr<Node> pgw = epcHelper->GetPgwNode ();

After that, you would probably want to setup a network between the PGW and your remote nodes, to create your topology. As example, there is the code that setup a point to point link between the PGW and a single remote node:

  // Create our remote host
  NodeContainer remoteHostContainer;
  remoteHostContainer.Create (1);
  Ptr<Node> remoteHost = remoteHostContainer.Get (0);

  // Install internet stack on the remote host
  InternetStackHelper internet;
  internet.Install (remoteHostContainer);

  // connect a remoteHost to pgw
  PointToPointHelper p2ph;
  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (2500));
  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.000)));
  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);

  // Here is the routing part.. please note that UEs will always be in the
  // class
  Ipv4AddressHelper ipv4h;
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
  ipv4h.SetBase ("", "");
  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting
(remoteHost->GetObject<Ipv4> ()); remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address
(""), Ipv4Mask (""), 1); 

Assigning IPV4 addresses

Another important thing that this helper can do is assigning automatically the IPv4 addresses to the UE:

  NetDeviceContainer netDeviceContainerForUe = ...;
  Ipv4InterfaceContainer ueLowLatIpIface = epcHelper->AssignUeIpv4Address (netDeviceContainerForUe);

And, of course, you would like to set the default routing for the UE, which is the address of the EPC:

  // Set the default gateway for the UEs
  for (uint32_t j = 0; j < ueContainer.GetN(); ++j)
      Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting
(ueContainer.Get(j)->GetObject<Ipv4> ()); ueStaticRouting->SetDefaultRoute
(epcHelper->GetUeDefaultGatewayAddress (), 1);

For everything else, please see also the NrHelper documentation.

See also

Definition at line 107 of file nr-point-to-point-epc-helper.h.

Constructor & Destructor Documentation

◆ NrPointToPointEpcHelper()

ns3::NrPointToPointEpcHelper::NrPointToPointEpcHelper ( )


Definition at line 29 of file nr-point-to-point-epc-helper.cc.

◆ ~NrPointToPointEpcHelper()

ns3::NrPointToPointEpcHelper::~NrPointToPointEpcHelper ( )


Definition at line 35 of file nr-point-to-point-epc-helper.cc.

Member Function Documentation

◆ DoActivateEpsBearerForUe()

void ns3::NrPointToPointEpcHelper::DoActivateEpsBearerForUe ( const Ptr< NetDevice > &  ueDevice,
const Ptr< EpcTft > &  tft,
const EpsBearer &  bearer 
) const

Definition at line 82 of file nr-point-to-point-epc-helper.cc.

◆ DoAddX2Interface()

void ns3::NrPointToPointEpcHelper::DoAddX2Interface ( const Ptr< EpcX2 > &  gnb1X2,
const Ptr< NetDevice > &  gnb1NetDev,
const Ipv4Address &  gnb1X2Address,
const Ptr< EpcX2 > &  gnb2X2,
const Ptr< NetDevice > &  gnb2NetDev,
const Ipv4Address &  gnb2X2Address 
) const

Definition at line 51 of file nr-point-to-point-epc-helper.cc.

◆ GetTypeId()

TypeId ns3::NrPointToPointEpcHelper::GetTypeId ( )

Register this type.

The object TypeId.

Definition at line 41 of file nr-point-to-point-epc-helper.cc.

The documentation for this class was generated from the following files: