A global global router. More...
#include "global-route-manager.h"
Public Member Functions | |
| GlobalRouteManager (const GlobalRouteManager &)=delete | |
| GlobalRouteManager & | operator= (const GlobalRouteManager &)=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 | InitializeRoutes () |
| Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables. | |
| static void | PrintRoute (Ptr< Node > sourceNode, Ipv4Address 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, Ipv4Address 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. | |
Static Private Attributes | |
| static uint32_t | routerId = 0 |
| Router ID counter. | |
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 33 of file global-route-manager.h.
|
delete |
References GlobalRouteManager().
Referenced by GlobalRouteManager(), and operator=().
|
static |
Allocate a 32-bit router ID from monotonically increasing counter.
Definition at line 54 of file global-route-manager.cc.
References NS_LOG_FUNCTION_NOARGS, and routerId.
Referenced by ns3::GlobalRouter::GlobalRouter().
|
static |
Build the routing database by gathering Link State Advertisements from each node exporting a GlobalRouter interface.
Definition at line 40 of file global-route-manager.cc.
References ns3::SimulationSingleton< T >::Get(), and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Ipv4GlobalRouting::NotifyAddAddress(), ns3::Ipv4GlobalRouting::NotifyInterfaceDown(), ns3::Ipv4GlobalRouting::NotifyInterfaceUp(), ns3::Ipv4GlobalRouting::NotifyRemoveAddress(), ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables(), and ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables().
|
static |
Delete all static routes on all nodes that have a GlobalRouterInterface.
Definition at line 33 of file global-route-manager.cc.
References ns3::SimulationSingleton< T >::Get(), and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Ipv4GlobalRouting::NotifyAddAddress(), ns3::Ipv4GlobalRouting::NotifyInterfaceDown(), ns3::Ipv4GlobalRouting::NotifyInterfaceUp(), ns3::Ipv4GlobalRouting::NotifyRemoveAddress(), and ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables().
|
static |
Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables.
Definition at line 47 of file global-route-manager.cc.
References ns3::SimulationSingleton< T >::Get(), and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Ipv4GlobalRouting::NotifyAddAddress(), ns3::Ipv4GlobalRouting::NotifyInterfaceDown(), ns3::Ipv4GlobalRouting::NotifyInterfaceUp(), ns3::Ipv4GlobalRouting::NotifyRemoveAddress(), ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables(), and ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables().
|
delete |
|
static |
prints the path from this node to the destination node at a particular time.
| sourceNode | The source node. |
| dest | The IPv4 address of the destination node. |
| nodeIdLookup | Print the Node Id |
| unit | The time unit for timestamps in the printed output. |
Definition at line 90 of file global-route-manager.cc.
References ns3::Create(), and PrintRoute().
|
static |
prints the path from this node to the destination node at a particular time.
| sourceNode | The source node. |
| dest | The IPv4 address of the destination node. |
| stream | The output stream to which the routing path will be written. |
| nodeIdLookup | Print the Node Id |
| unit | The time unit for timestamps in the printed output. |
Definition at line 67 of file global-route-manager.cc.
References ns3::Time::As(), ns3::SimulationSingleton< T >::Get(), and ns3::Now().
Referenced by PrintRoute(), PrintRoute(), ns3::Ipv4GlobalRoutingHelper::PrintRoute(), ns3::Ipv4GlobalRoutingHelper::PrintRoute(), ns3::Ipv4GlobalRoutingHelper::PrintRoute(), and ns3::Ipv4GlobalRoutingHelper::PrintRoute().
|
static |
prints the path from this node to the destination node at a particular time.
| sourceNode | The source node. |
| dest | The destination node. |
| nodeIdLookup | Print the Node Id |
| unit | The time unit for timestamps in the printed output. |
Definition at line 123 of file global-route-manager.cc.
References ns3::Create(), and PrintRoute().
|
static |
prints the path from this node to the destination node at a particular time.
| sourceNode | The source node. |
| dest | The destination node. |
| stream | The output stream to which the routing path will be written. |
| nodeIdLookup | Print the Node Id |
| unit | The time unit for timestamps in the printed output. |
Definition at line 100 of file global-route-manager.cc.
References ns3::Time::As(), ns3::SimulationSingleton< T >::Get(), and ns3::Now().
|
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 61 of file global-route-manager.cc.
References routerId.
Referenced by GlobalRoutingProtocolTestCase::DoRun(), LanRoutesTestCase::DoRun(), and LinkRoutesTestCase::DoRun().
|
staticprivate |
Router ID counter.
Definition at line 129 of file global-route-manager.h.
Referenced by AllocateRouterId(), and ResetRouterId().