Public Member Functions | Static Public Member Functions

ns3::GlobalRouter Class Reference

An interface aggregated to a node to provide global routing info. More...

#include <global-router-interface.h>

Inheritance diagram for ns3::GlobalRouter:
Inheritance graph
[legend]
Collaboration diagram for ns3::GlobalRouter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GlobalRouter ()
 Create a Global Router class.
void SetRoutingProtocol (Ptr< Ipv4GlobalRouting > routing)
Ptr< Ipv4GlobalRoutingGetRoutingProtocol (void)
Ipv4Address GetRouterId (void) const
 Get the Router ID associated with this Global Router.
uint32_t DiscoverLSAs (void)
 Walk the connected channels, discover the adjacent routers and build the associated number of Global Routing Link State Advertisements that this router can export.
uint32_t GetNumLSAs (void) const
 Get the Number of Global Routing Link State Advertisements that this router can export.
bool GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const
 Get a Global Routing Link State Advertisements that this router has said that it can export.
void InjectRoute (Ipv4Address network, Ipv4Mask networkMask)
 Inject a route to be circulated to other routers as an external route.
uint32_t GetNInjectedRoutes (void)
 Get the number of injected routes that have been added to the routing table.
Ipv4RoutingTableEntryGetInjectedRoute (uint32_t i)
 Return the injected route indexed by i.
void RemoveInjectedRoute (uint32_t i)
 Withdraw a route from the global unicast routing table.
bool WithdrawRoute (Ipv4Address network, Ipv4Mask networkMask)
 Withdraw a route from the global unicast routing table.

Static Public Member Functions

static TypeId GetTypeId (void)
 The Interface ID of the Global Router interface.

Detailed Description

An interface aggregated to a node to provide global routing info.

An interface aggregated to a node that provides global routing information to a global route manager. The presence of the interface indicates that the node is a router. The interface is the mechanism by which the router advertises its connections to neighboring routers. We're basically allowing the route manager to query for link state advertisements.


Member Function Documentation

uint32_t ns3::GlobalRouter::DiscoverLSAs ( void   ) 

Walk the connected channels, discover the adjacent routers and build the associated number of Global Routing Link State Advertisements that this router can export.

This is a fairly expensive operation in that every time it is called the current list of LSAs is built by walking connected point-to-point channels and peeking into adjacent IPV4 stacks to get address information. This is done to allow for limited dynamics of the Global Routing environment. By that we mean that you can discover new link state advertisements after a network topology change by calling DiscoverLSAs and then by reading those advertisements.

See also:
GlobalRoutingLSA
GlobalRouter::GetLSA ()
Returns:
The number of Global Routing Link State Advertisements.
Ipv4RoutingTableEntry* ns3::GlobalRouter::GetInjectedRoute ( uint32_t  i  ) 

Return the injected route indexed by i.

Parameters:
i the index of the route
Returns:
a pointer to that Ipv4RoutingTableEntry is returned
bool ns3::GlobalRouter::GetLSA ( uint32_t  n,
GlobalRoutingLSA lsa 
) const

Get a Global Routing Link State Advertisements that this router has said that it can export.

This is a fairly inexpensive expensive operation in that the hard work was done in GetNumLSAs. We just copy the indicated Global Routing Link State Advertisement into the requested GlobalRoutingLSA object.

You must call GlobalRouter::GetNumLSAs before calling this method in order to discover the adjacent routers and build the advertisements. GetNumLSAs will return the number of LSAs this router advertises. The parameter n (requested LSA number) must be in the range 0 to GetNumLSAs() - 1.

See also:
GlobalRoutingLSA
GlobalRouting::GetNumLSAs ()
Parameters:
n The index number of the LSA you want to read.
lsa The GlobalRoutingLSA class to receive the LSA information.
Returns:
The number of Global Router Link State Advertisements.
uint32_t ns3::GlobalRouter::GetNInjectedRoutes ( void   ) 

Get the number of injected routes that have been added to the routing table.

Returns:
number of injected routes
uint32_t ns3::GlobalRouter::GetNumLSAs ( void   )  const

Get the Number of Global Routing Link State Advertisements that this router can export.

To get meaningful information you must have previously called DiscoverLSAs. After you know how many LSAs are present in the router, you may call GetLSA () to retrieve the actual advertisement.

See also:
GlobalRouterLSA
GlobalRouting::DiscoverLSAs ()
GlobalRouting::GetLSA ()
Returns:
The number of Global Routing Link State Advertisements.
Ipv4Address ns3::GlobalRouter::GetRouterId ( void   )  const

Get the Router ID associated with this Global Router.

The Router IDs are allocated in the RoutingEnvironment -- one per Router, starting at 0.0.0.1 and incrementing with each instantiation of a router.

See also:
RoutingEnvironment::AllocateRouterId ()
Returns:
The Router ID associated with the Global Router.
static TypeId ns3::GlobalRouter::GetTypeId ( void   )  [static]

The Interface ID of the Global Router interface.

This method returns the TypeId associated to ns3::GlobalRouter.

See also:
Object::GetObject ()

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/LinkManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/SSManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/Classifier/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/NoiseModel/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/PropagationModel/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Mac/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Phy/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Transducer/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/LinkManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/SSManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/Classifier/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BandwidthManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BurstProfileManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/NoiseModel/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/PropagationModel/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/ConnectionManager/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/NoiseModel/$ns3::GlobalRouter
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/PropagationModel/$ns3::GlobalRouter

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

void ns3::GlobalRouter::InjectRoute ( Ipv4Address  network,
Ipv4Mask  networkMask 
)

Inject a route to be circulated to other routers as an external route.

Parameters:
network The Network to inject
networkMask The Network Mask to inject
void ns3::GlobalRouter::RemoveInjectedRoute ( uint32_t  i  ) 

Withdraw a route from the global unicast routing table.

Calling this function will cause all indexed routes numbered above index i to have their index decremented. For instance, it is possible to remove N injected routes by calling RemoveInjectedRoute (0) N times.

Parameters:
i The index (into the injected routing list) of the route to remove.
See also:
GlobalRouter::WithdrawRoute ()
bool ns3::GlobalRouter::WithdrawRoute ( Ipv4Address  network,
Ipv4Mask  networkMask 
)

Withdraw a route from the global unicast routing table.

Parameters:
network The Network to withdraw
networkMask The Network Mask to withdraw
Returns:
whether the operation succeeded (will return false if no such route)
See also:
GlobalRouter::RemoveInjectedRoute ()

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