A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::GlobalRouteManager< T > Class Template Reference

A global global router. More...

#include "global-route-manager.h"

Inheritance diagram for ns3::GlobalRouteManager< T >:
Collaboration diagram for ns3::GlobalRouteManager< T >:

Public Member Functions

 GlobalRouteManager (const GlobalRouteManager< T > &)=delete
GlobalRouteManageroperator= (const GlobalRouteManager< T > &)=delete

Static Public Member Functions

static uint32_t AllocateRouterId ()
 Allocate a 32-bit router ID from monotonically increasing counter.
static void BuildGlobalRoutingDatabase ()
 Build the routing database by gathering Link State Advertisements from each node exporting a GlobalRouter interface.
static void DeleteGlobalRoutes ()
 Delete all static routes on all nodes that have a GlobalRouterInterface.
static void InitializeRouters ()
 initialize all nodes as routers.
static void InitializeRoutes ()
 Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables.
static void PrintRoute (Ptr< Node > sourceNode, IpAddress dest, bool nodeIdLookup=true, Time::Unit unit=Time::S)
 prints the path from this node to the destination node at a particular time.
static void PrintRoute (Ptr< Node > sourceNode, IpAddress dest, Ptr< OutputStreamWrapper > stream, bool nodeIdLookup=true, Time::Unit unit=Time::S)
 prints the path from this node to the destination node at a particular time.
static void PrintRoute (Ptr< Node > sourceNode, Ptr< Node > dest, bool nodeIdLookup=true, Time::Unit unit=Time::S)
 prints the path from this node to the destination node at a particular time.
static void PrintRoute (Ptr< Node > sourceNode, Ptr< Node > dest, Ptr< OutputStreamWrapper > stream, bool nodeIdLookup=true, Time::Unit unit=Time::S)
 prints the path from this node to the destination node at a particular time.
static void ResetRouterId ()
 Reset the router ID counter to zero.

Private Types

using Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6>
 Alias for Ipv4 and Ipv6 classes.
using IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>
 Alias for Ipv4Address and Ipv6Address classes.
using IpManager = typename std::conditional_t<IsIpv4, Ipv4Manager, Ipv6Manager>
 Alias for Ipv4Manager and Ipv6Manager classes.

Static Private Attributes

static constexpr bool IsIpv4 = std::is_same_v<Ipv4Manager, T>
 Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.
static uint32_t routerId
 Router ID counter.

Detailed Description

template<typename T>
class ns3::GlobalRouteManager< T >

A global global router.

This singleton object can query interface each node in the system for a GlobalRouter interface. For those nodes, it fetches one or more Link State Advertisements and stores them in a local database. Then, it can compute shortest paths on a per-node basis to all routers, and finally configure each of the node's forwarding tables.

The design is guided by OSPFv2 RFC 2328 section 16.1.1 and quagga ospfd.

Definition at line 52 of file global-route-manager.h.

Member Typedef Documentation

◆ Ip

template<typename T>
using ns3::GlobalRouteManager< T >::Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6>
private

Alias for Ipv4 and Ipv6 classes.

Definition at line 60 of file global-route-manager.h.

◆ IpAddress

template<typename T>
using ns3::GlobalRouteManager< T >::IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>
private

Alias for Ipv4Address and Ipv6Address classes.

Definition at line 63 of file global-route-manager.h.

◆ IpManager

template<typename T>
using ns3::GlobalRouteManager< T >::IpManager = typename std::conditional_t<IsIpv4, Ipv4Manager, Ipv6Manager>
private

Alias for Ipv4Manager and Ipv6Manager classes.

Definition at line 66 of file global-route-manager.h.

Constructor & Destructor Documentation

◆ GlobalRouteManager()

template<typename T>
ns3::GlobalRouteManager< T >::GlobalRouteManager ( const GlobalRouteManager< T > & )
delete

Member Function Documentation

◆ AllocateRouterId()

template<typename T>
uint32_t ns3::GlobalRouteManager< T >::AllocateRouterId ( )
static

Allocate a 32-bit router ID from monotonically increasing counter.

Returns
A new new RouterId.

Definition at line 62 of file global-route-manager.cc.

References NS_LOG_FUNCTION_NOARGS, and routerId.

Referenced by ns3::GlobalRoutingLSA< ns3::Ipv4Manager >::GetStatus().

Here is the caller graph for this function:

◆ BuildGlobalRoutingDatabase()

template<typename T>
void ns3::GlobalRouteManager< T >::BuildGlobalRoutingDatabase ( )
static

Build the routing database by gathering Link State Advertisements from each node exporting a GlobalRouter interface.

Definition at line 44 of file global-route-manager.cc.

References NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::GlobalRouting< T >::NotifyAddAddress(), ns3::GlobalRouting< T >::NotifyInterfaceDown(), ns3::GlobalRouting< T >::NotifyInterfaceUp(), ns3::GlobalRouting< T >::NotifyRemoveAddress(), ns3::Ipv6GlobalRoutingHelper::PopulateRoutingTables(), and ns3::Ipv6GlobalRoutingHelper::RecomputeRoutingTables().

Here is the caller graph for this function:

◆ DeleteGlobalRoutes()

template<typename T>
void ns3::GlobalRouteManager< T >::DeleteGlobalRoutes ( )
static

Delete all static routes on all nodes that have a GlobalRouterInterface.

Definition at line 35 of file global-route-manager.cc.

References NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::GlobalRouting< T >::NotifyAddAddress(), ns3::GlobalRouting< T >::NotifyInterfaceDown(), ns3::GlobalRouting< T >::NotifyInterfaceUp(), ns3::GlobalRouting< T >::NotifyRemoveAddress(), and ns3::Ipv6GlobalRoutingHelper::RecomputeRoutingTables().

Here is the caller graph for this function:

◆ InitializeRouters()

template<typename T>
void ns3::GlobalRouteManager< T >::InitializeRouters ( )
static

initialize all nodes as routers.

this method queries all the nodes in the simulation and enables ipv6 forwarding on all of them.

Definition at line 147 of file global-route-manager.cc.

Referenced by ns3::Ipv6GlobalRoutingHelper::PopulateRoutingTables().

Here is the caller graph for this function:

◆ InitializeRoutes()

template<typename T>
void ns3::GlobalRouteManager< T >::InitializeRoutes ( )
static

Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables.

Definition at line 53 of file global-route-manager.cc.

References NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::GlobalRouting< T >::NotifyAddAddress(), ns3::GlobalRouting< T >::NotifyInterfaceDown(), ns3::GlobalRouting< T >::NotifyInterfaceUp(), ns3::GlobalRouting< T >::NotifyRemoveAddress(), ns3::Ipv6GlobalRoutingHelper::PopulateRoutingTables(), and ns3::Ipv6GlobalRoutingHelper::RecomputeRoutingTables().

Here is the caller graph for this function:

◆ operator=()

template<typename T>
GlobalRouteManager & ns3::GlobalRouteManager< T >::operator= ( const GlobalRouteManager< T > & )
delete

◆ PrintRoute() [1/4]

template<typename T>
void ns3::GlobalRouteManager< T >::PrintRoute ( Ptr< Node > sourceNode,
IpAddress dest,
bool nodeIdLookup = true,
Time::Unit unit = Time::S )
static

prints the path from this node to the destination node at a particular time.

Parameters
sourceNodeThe source node.
destThe IP address of the destination node.
nodeIdLookupPrint the Node Id
unitThe time unit for timestamps in the printed output.
See also
Ipv4GlobalRoutingHelper::PrintRoute

Definition at line 101 of file global-route-manager.cc.

References ns3::Create(), and PrintRoute().

Here is the call graph for this function:

◆ PrintRoute() [2/4]

template<typename T>
void ns3::GlobalRouteManager< T >::PrintRoute ( Ptr< Node > sourceNode,
IpAddress dest,
Ptr< OutputStreamWrapper > stream,
bool nodeIdLookup = true,
Time::Unit unit = Time::S )
static

prints the path from this node to the destination node at a particular time.

Parameters
sourceNodeThe source node.
destThe IPv4 address of the destination node.
streamThe output stream to which the routing path will be written.
nodeIdLookupPrint the Node Id
unitThe time unit for timestamps in the printed output.
See also
Ipv4GlobalRoutingHelper::PrintRoute

Definition at line 77 of file global-route-manager.cc.

References ns3::Time::As(), and ns3::Now().

Referenced by PrintRoute(), PrintRoute(), ns3::Ipv4GlobalRoutingHelper::PrintRoute(), ns3::Ipv4GlobalRoutingHelper::PrintRoute(), ns3::Ipv4GlobalRoutingHelper::PrintRoute(), and ns3::Ipv4GlobalRoutingHelper::PrintRoute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintRoute() [3/4]

template<typename T>
void ns3::GlobalRouteManager< T >::PrintRoute ( Ptr< Node > sourceNode,
Ptr< Node > dest,
bool nodeIdLookup = true,
Time::Unit unit = Time::S )
static

prints the path from this node to the destination node at a particular time.

Parameters
sourceNodeThe source node.
destThe destination node.
nodeIdLookupPrint the Node Id
unitThe time unit for timestamps in the printed output.
See also
Ipv4GlobalRoutingHelper::PrintRoute

Definition at line 136 of file global-route-manager.cc.

References ns3::Create(), and PrintRoute().

Here is the call graph for this function:

◆ PrintRoute() [4/4]

template<typename T>
void ns3::GlobalRouteManager< T >::PrintRoute ( Ptr< Node > sourceNode,
Ptr< Node > dest,
Ptr< OutputStreamWrapper > stream,
bool nodeIdLookup = true,
Time::Unit unit = Time::S )
static

prints the path from this node to the destination node at a particular time.

Parameters
sourceNodeThe source node.
destThe destination node.
streamThe output stream to which the routing path will be written.
nodeIdLookupPrint the Node Id
unitThe time unit for timestamps in the printed output.
See also
Ipv4GlobalRoutingHelper::PrintRoute

Definition at line 112 of file global-route-manager.cc.

References ns3::Time::As(), and ns3::Now().

Here is the call graph for this function:

◆ ResetRouterId()

template<typename T>
void ns3::GlobalRouteManager< T >::ResetRouterId ( )
static

Reset the router ID counter to zero.

This should only be called by tests to reset the router ID counter between simulations within the same program. This function should not be called In typical simulations or when using the GlobalRouting helper.

Definition at line 70 of file global-route-manager.cc.

References routerId.

Referenced by GlobalRoutingv4ProtocolTestCase::DoRun(), GlobalRoutingv6ProtocolTestCase::DoRun(), LanRoutesTestCase::DoRun(), and LinkRoutesTestCase::DoRun().

Here is the caller graph for this function:

Member Data Documentation

◆ IsIpv4

template<typename T>
bool ns3::GlobalRouteManager< T >::IsIpv4 = std::is_same_v<Ipv4Manager, T>
staticconstexprprivate

Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.

Definition at line 57 of file global-route-manager.h.

◆ routerId

template<typename T>
uint32_t ns3::GlobalRouteManager< T >::routerId
staticprivate

Router ID counter.

Definition at line 168 of file global-route-manager.h.

Referenced by AllocateRouterId(), and ResetRouterId().


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