5G-LENA nr-v3.1-69-g2dd513a7
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. | |
void | AddGnb (Ptr< Node > gnbNode, Ptr< NetDevice > nrGnbNetDevice, std::vector< uint16_t > cellIds) override |
void | DoDispose () override |
TypeId | GetInstanceTypeId () const override |
Public Member Functions inherited from ns3::NrNoBackhaulEpcHelper | |
NrNoBackhaulEpcHelper () | |
~NrNoBackhaulEpcHelper () override | |
uint8_t | ActivateEpsBearer (Ptr< NetDevice > ueNrDevice, uint64_t imsi, Ptr< NrEpcTft > tft, NrEpsBearer bearer) override |
void | AddS1Interface (Ptr< Node > gnb, Ipv4Address gnbAddress, Ipv4Address sgwAddress, std::vector< uint16_t > cellIds) override |
void | AddUe (Ptr< NetDevice > ueNrDevice, uint64_t imsi) override |
void | AddX2Interface (Ptr< Node > gnbNode1, Ptr< Node > gnbNode2) override |
int64_t | AssignStreams (int64_t stream) override |
Ipv4InterfaceContainer | AssignUeIpv4Address (NetDeviceContainer ueDevices) override |
Ipv6InterfaceContainer | AssignUeIpv6Address (NetDeviceContainer ueDevices) override |
void | DoDispose () override |
TypeId | GetInstanceTypeId () const override |
Ptr< Node > | GetPgwNode () const override |
Ptr< Node > | GetSgwNode () const override |
Ipv4Address | GetUeDefaultGatewayAddress () override |
Ipv6Address | GetUeDefaultGatewayAddress6 () override |
Public Member Functions inherited from ns3::NrEpcHelper | |
NrEpcHelper () | |
~NrEpcHelper () override | |
void | DoDispose () override |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::NrNoBackhaulEpcHelper | |
static TypeId | GetTypeId () |
Static Public Member Functions inherited from ns3::NrEpcHelper | |
static TypeId | GetTypeId () |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::NrNoBackhaulEpcHelper | |
virtual void | DoActivateEpsBearerForUe (const Ptr< NetDevice > &ueDevice, const Ptr< NrEpcTft > &tft, const NrEpsBearer &bearer) const |
DoActivateEpsBearerForUe: Schedule ActivateEpsBearer on the UE. | |
virtual void | DoAddX2Interface (const Ptr< NrEpcX2 > &gnb1X2, const Ptr< NetDevice > &gnb1NrDev, const Ipv4Address &gnb1X2Address, const Ptr< NrEpcX2 > &gnb2X2, const Ptr< NetDevice > &gnb2NrDev, const Ipv4Address &gnb2X2Address) const |
DoAddX2Interface: Call AddX2Interface on top of the Gnb device pointers. | |
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> nrEpcHelper = CreateObject<NrPointToPointEpcHelper> (); ... Ptr<NrHelper> nrHelper = CreateObject<NrHelper> (); nrHelper->SetEpcHelper (nrEpcHelper);
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:
nrEpcHelper->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 = nrEpcHelper->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 = nrEpcHelper->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 (nrEpcHelper->GetUeDefaultGatewayAddress (), 1); }
For everything else, please see also the NrHelper documentation.
Introspection did not find any typical Config paths.
No TraceSources are defined for this type.
Size of this type is 536 bytes (on a 64-bit architecture).
Definition at line 112 of file nr-point-to-point-epc-helper.h.
ns3::NrPointToPointEpcHelper::NrPointToPointEpcHelper | ( | ) |
Constructor.
Definition at line 25 of file nr-point-to-point-epc-helper.cc.
|
override |
Destructor.
Definition at line 39 of file nr-point-to-point-epc-helper.cc.
|
overridevirtual |
Add an gNB to the EPC
gnbNode | the previously created gNB node which is to be added to the EPC |
nrGnbNetDevice | the NrGnbNetDevice of the gNB node |
cellIds | IDs of cells served by this gNB |
Reimplemented from ns3::NrNoBackhaulEpcHelper.
Definition at line 97 of file nr-point-to-point-epc-helper.cc.
References ns3::NrNoBackhaulEpcHelper::AddGnb(), ns3::NrNoBackhaulEpcHelper::AddS1Interface(), and ns3::NrNoBackhaulEpcHelper::GetSgwNode().
|
override |
Definition at line 90 of file nr-point-to-point-epc-helper.cc.
|
override |
Definition at line 84 of file nr-point-to-point-epc-helper.cc.
|
static |
Register this type.
Definition at line 45 of file nr-point-to-point-epc-helper.cc.