5G-LENA
nr-v3.0-25-g90be5d1
The 5G/NR module for the ns-3 simulator
|
Create an EPC network with PointToPoint links. More...
#include "nr-point-to-point-epc-helper.h"
Public Member Functions | |
NrPointToPointEpcHelper () | |
Constructor. | |
~NrPointToPointEpcHelper () override | |
Destructor. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Register this type. More... | |
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.
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 7.0.0.0 Ipv4AddressHelper ipv4h; Ipv4StaticRoutingHelper ipv4RoutingHelper; ipv4h.SetBase ("1.0.0.0", "255.0.0.0"); Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices); Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ()); remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
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.
Definition at line 107 of file nr-point-to-point-epc-helper.h.
|
static |
Register this type.
Definition at line 41 of file nr-point-to-point-epc-helper.cc.