A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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:
+ Collaboration diagram for ns3::GlobalRouter:

Public Member Functions

 GlobalRouter ()
 Create a Global Router class.
 
 GlobalRouter (const GlobalRouter &)=delete
 
uint32_t DiscoverLSAs ()
 Walk the connected channels, discover the adjacent routers and build the associated number of Global Routing Link State Advertisements that this router can export.
 
Ipv4RoutingTableEntryGetInjectedRoute (uint32_t i)
 Return the injected route indexed by i.
 
bool GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const
 Get a Global Routing Link State Advertisements that this router has said that it can export.
 
uint32_t GetNInjectedRoutes ()
 Get the number of injected routes that have been added to the routing table.
 
uint32_t GetNumLSAs () const
 Get the Number of Global Routing Link State Advertisements that this router can export.
 
Ipv4Address GetRouterId () const
 Get the Router ID associated with this Global Router.
 
Ptr< Ipv4GlobalRoutingGetRoutingProtocol ()
 Get the specific Global Routing Protocol used.
 
void InjectRoute (Ipv4Address network, Ipv4Mask networkMask)
 Inject a route to be circulated to other routers as an external route.
 
GlobalRouteroperator= (const GlobalRouter &)=delete
 
void RemoveInjectedRoute (uint32_t i)
 Withdraw a route from the global unicast routing table.
 
void SetRoutingProtocol (Ptr< Ipv4GlobalRouting > routing)
 Set the specific Global Routing Protocol to be used.
 
bool WithdrawRoute (Ipv4Address network, Ipv4Mask networkMask)
 Withdraw a route from the global unicast routing table.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
virtual TypeId GetInstanceTypeId () const =0
 Get the most derived TypeId for this Object.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Types

typedef std::list< Ipv4RoutingTableEntry * > InjectedRoutes
 container of Ipv4RoutingTableEntry
 
typedef std::list< Ipv4RoutingTableEntry * >::const_iterator InjectedRoutesCI
 Const Iterator to container of Ipv4RoutingTableEntry.
 
typedef std::list< Ipv4RoutingTableEntry * >::iterator InjectedRoutesI
 Iterator to container of Ipv4RoutingTableEntry.
 
typedef std::list< GlobalRoutingLSA * > ListOfLSAs_t
 container for the GlobalRoutingLSAs
 

Private Member Functions

 ~GlobalRouter () override
 
bool AnotherRouterOnLink (Ptr< NetDevice > nd) const
 Checks for the presence of another router on the NetDevice.
 
bool BridgeHasAlreadyBeenVisited (Ptr< BridgeNetDevice > device) const
 When recursively checking for devices on the link, check whether a given device has already been visited.
 
void BuildNetworkLSAs (NetDeviceContainer c)
 Build one NetworkLSA for each net device talking to a network that we are the designated router for.
 
void ClearBridgesVisited () const
 Clear the list of bridges visited on the link.
 
void ClearLSAs ()
 Clear list of LSAs.
 
void DoDispose () override
 Destructor implementation.
 
NetDeviceContainer FindAllNonBridgedDevicesOnLink (Ptr< Channel > ch) const
 Return a container of all non-bridged NetDevices on a link.
 
Ipv4Address FindDesignatedRouterForLink (Ptr< NetDevice > ndLocal) const
 Finds a designated router.
 
Ptr< NetDeviceGetAdjacent (Ptr< NetDevice > nd, Ptr< Channel > ch) const
 Link through the given channel and find the net device that's on the other end.
 
void MarkBridgeAsVisited (Ptr< BridgeNetDevice > device) const
 When recursively checking for devices on the link, mark a given device as having been visited.
 
Ptr< BridgeNetDeviceNetDeviceIsBridged (Ptr< NetDevice > nd) const
 Decide whether or not a given net device is being bridged by a BridgeNetDevice.
 
void ProcessBridgedBroadcastLink (Ptr< NetDevice > nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c)
 Process a bridged broadcast link.
 
void ProcessBroadcastLink (Ptr< NetDevice > nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c)
 Process a generic broadcast link.
 
void ProcessPointToPointLink (Ptr< NetDevice > ndLocal, GlobalRoutingLSA *pLSA)
 Process a point to point link.
 
void ProcessSingleBroadcastLink (Ptr< NetDevice > nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c)
 Process a single broadcast link.
 

Private Attributes

std::vector< Ptr< BridgeNetDevice > > m_bridgesVisited
 Container of bridges visited.
 
InjectedRoutes m_injectedRoutes
 Routes we are exporting.
 
ListOfLSAs_t m_LSAs
 database of GlobalRoutingLSAs
 
Ipv4Address m_routerId
 router ID (its IPv4 address)
 
Ptr< Ipv4GlobalRoutingm_routingProtocol
 the Ipv4GlobalRouting in use
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

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.

Config Paths

ns3::GlobalRouter is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/$ns3::GlobalRouter"

No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 128 bytes (on a 64-bit architecture).

Definition at line 595 of file global-router-interface.h.

Member Typedef Documentation

◆ InjectedRoutes

container of Ipv4RoutingTableEntry

Definition at line 862 of file global-router-interface.h.

◆ InjectedRoutesCI

typedef std::list<Ipv4RoutingTableEntry*>::const_iterator ns3::GlobalRouter::InjectedRoutesCI
private

Const Iterator to container of Ipv4RoutingTableEntry.

Definition at line 864 of file global-router-interface.h.

◆ InjectedRoutesI

typedef std::list<Ipv4RoutingTableEntry*>::iterator ns3::GlobalRouter::InjectedRoutesI
private

Iterator to container of Ipv4RoutingTableEntry.

Definition at line 866 of file global-router-interface.h.

◆ ListOfLSAs_t

container for the GlobalRoutingLSAs

Definition at line 855 of file global-router-interface.h.

Constructor & Destructor Documentation

◆ GlobalRouter() [1/2]

ns3::GlobalRouter::GlobalRouter ( )

Create a Global Router class.

Definition at line 507 of file global-router-interface.cc.

References ns3::GlobalRouteManager::AllocateRouterId(), m_routerId, NS_LOG_FUNCTION, and ns3::Ipv4Address::Set().

+ Here is the call graph for this function:

◆ GlobalRouter() [2/2]

ns3::GlobalRouter::GlobalRouter ( const GlobalRouter )
delete

◆ ~GlobalRouter()

ns3::GlobalRouter::~GlobalRouter ( )
overrideprivate

Definition at line 514 of file global-router-interface.cc.

References ClearLSAs(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Function Documentation

◆ AnotherRouterOnLink()

bool ns3::GlobalRouter::AnotherRouterOnLink ( Ptr< NetDevice nd) const
private

Checks for the presence of another router on the NetDevice.

Given a node and an attached net device, take a look off in the channel to which the net device is attached and look for a node on the other side that has a GlobalRouter interface aggregated.

Parameters
ndNetDevice to scan
Returns
true if a router is found

Definition at line 1476 of file global-router-interface.cc.

References AnotherRouterOnLink(), BridgeHasAlreadyBeenVisited(), MarkBridgeAsVisited(), NetDeviceIsBridged(), NS_ABORT_MSG, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by AnotherRouterOnLink(), ProcessBridgedBroadcastLink(), and ProcessSingleBroadcastLink().

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

◆ BridgeHasAlreadyBeenVisited()

bool ns3::GlobalRouter::BridgeHasAlreadyBeenVisited ( Ptr< BridgeNetDevice device) const
private

When recursively checking for devices on the link, check whether a given device has already been visited.

Parameters
devicethe bridge device to check
Returns
true if bridge has already been visited

Definition at line 1783 of file global-router-interface.cc.

References m_bridgesVisited, and NS_LOG_LOGIC.

Referenced by AnotherRouterOnLink(), FindAllNonBridgedDevicesOnLink(), and FindDesignatedRouterForLink().

+ Here is the caller graph for this function:

◆ BuildNetworkLSAs()

void ns3::GlobalRouter::BuildNetworkLSAs ( NetDeviceContainer  c)
private

Build one NetworkLSA for each net device talking to a network that we are the designated router for.

Parameters
cthe devices.

Definition at line 1154 of file global-router-interface.cc.

References ClearBridgesVisited(), FindAllNonBridgedDevicesOnLink(), ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), ns3::GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED, m_LSAs, m_routerId, ns3::GlobalRoutingLSA::NetworkLSA, NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.

Referenced by DiscoverLSAs().

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

◆ ClearBridgesVisited()

void ns3::GlobalRouter::ClearBridgesVisited ( ) const
private

Clear the list of bridges visited on the link.

Definition at line 1774 of file global-router-interface.cc.

References m_bridgesVisited.

Referenced by BuildNetworkLSAs(), ProcessBridgedBroadcastLink(), and ProcessSingleBroadcastLink().

+ Here is the caller graph for this function:

◆ ClearLSAs()

void ns3::GlobalRouter::ClearLSAs ( )
private

Clear list of LSAs.

Definition at line 548 of file global-router-interface.cc.

References m_LSAs, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ~GlobalRouter(), and DiscoverLSAs().

+ Here is the caller graph for this function:

◆ DiscoverLSAs()

uint32_t ns3::GlobalRouter::DiscoverLSAs ( )

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.

Definition at line 579 of file global-router-interface.cc.

References ns3::GlobalRoutingLSA::ASExternalLSAs, BuildNetworkLSAs(), ClearLSAs(), ns3::NetDeviceContainer::GetN(), ns3::GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED, m_injectedRoutes, m_LSAs, m_routerId, NetDeviceIsBridged(), NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ProcessBroadcastLink(), ProcessPointToPointLink(), ns3::GlobalRoutingLSA::RouterLSA, and ns3::GlobalRoutingLSA::SetLSType().

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::GlobalRouter::DoDispose ( )
overrideprivatevirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 535 of file global-router-interface.cc.

References ns3::Object::DoDispose(), m_injectedRoutes, m_routingProtocol, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ FindAllNonBridgedDevicesOnLink()

NetDeviceContainer ns3::GlobalRouter::FindAllNonBridgedDevicesOnLink ( Ptr< Channel ch) const
private

Return a container of all non-bridged NetDevices on a link.

This method will recursively find all of the 'edge' devices in an L2 broadcast domain. If there are no bridged devices, then the container returned is simply the set of devices on the channel passed in as an argument. If the link has bridges on it (and therefore multiple ns3::Channel objects interconnected by bridges), the method will find all of the non-bridged devices in the L2 broadcast domain.

Parameters
cha channel from the link
Returns
the NetDeviceContainer.

Definition at line 1274 of file global-router-interface.cc.

References ns3::NetDeviceContainer::Add(), BridgeHasAlreadyBeenVisited(), FindAllNonBridgedDevicesOnLink(), ns3::NetDeviceContainer::GetN(), MarkBridgeAsVisited(), NetDeviceIsBridged(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by BuildNetworkLSAs(), and FindAllNonBridgedDevicesOnLink().

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

◆ FindDesignatedRouterForLink()

Ipv4Address ns3::GlobalRouter::FindDesignatedRouterForLink ( Ptr< NetDevice ndLocal) const
private

Finds a designated router.

Given a local net device, we need to walk the channel to which the net device is attached and look for nodes with GlobalRouter interfaces on them (one of them will be us). Of these, the router with the lowest IP address on the net device connecting to the channel becomes the designated router for the link.

Parameters
ndLocallocal NetDevice to scan
Returns
the IP address of the designated router

Definition at line 1320 of file global-router-interface.cc.

References BridgeHasAlreadyBeenVisited(), FindDesignatedRouterForLink(), MarkBridgeAsVisited(), NetDeviceIsBridged(), NS_ABORT_MSG, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.

Referenced by FindDesignatedRouterForLink(), ProcessBridgedBroadcastLink(), and ProcessSingleBroadcastLink().

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

◆ GetAdjacent()

Ptr< NetDevice > ns3::GlobalRouter::GetAdjacent ( Ptr< NetDevice nd,
Ptr< Channel ch 
) const
private

Link through the given channel and find the net device that's on the other end.

This only makes sense with a point-to-point channel.

Parameters
ndoutgoing NetDevice
chchannel
Returns
the NetDevice on the other end

Definition at line 1695 of file global-router-interface.cc.

References NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ProcessPointToPointLink().

+ Here is the caller graph for this function:

◆ GetInjectedRoute()

Ipv4RoutingTableEntry * ns3::GlobalRouter::GetInjectedRoute ( uint32_t  i)

Return the injected route indexed by i.

Parameters
ithe index of the route
Returns
a pointer to that Ipv4RoutingTableEntry is returned

Definition at line 1627 of file global-router-interface.cc.

References m_injectedRoutes, NS_ASSERT, and NS_LOG_FUNCTION.

◆ GetLSA()

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
nThe index number of the LSA you want to read.
lsaThe GlobalRoutingLSA class to receive the LSA information.
Returns
The number of Global Router Link State Advertisements.

Definition at line 1589 of file global-router-interface.cc.

References ns3::GlobalRoutingLSA::IsEmpty(), m_LSAs, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetNInjectedRoutes()

uint32_t ns3::GlobalRouter::GetNInjectedRoutes ( )

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

Returns
number of injected routes

Definition at line 1648 of file global-router-interface.cc.

References m_injectedRoutes, and NS_LOG_FUNCTION.

◆ GetNumLSAs()

uint32_t ns3::GlobalRouter::GetNumLSAs ( ) 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.

Definition at line 1579 of file global-router-interface.cc.

References m_LSAs, and NS_LOG_FUNCTION.

◆ GetRouterId()

Ipv4Address ns3::GlobalRouter::GetRouterId ( ) 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.

Definition at line 566 of file global-router-interface.cc.

References m_routerId, and NS_LOG_FUNCTION.

◆ GetRoutingProtocol()

Ptr< Ipv4GlobalRouting > ns3::GlobalRouter::GetRoutingProtocol ( )

Get the specific Global Routing Protocol used.

Returns
the routing protocol

Definition at line 528 of file global-router-interface.cc.

References m_routingProtocol, and NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::GlobalRouter::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 501 of file global-router-interface.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ InjectRoute()

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

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

Parameters
networkThe Network to inject
networkMaskThe Network Mask to inject

Definition at line 1615 of file global-router-interface.cc.

References ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(), m_injectedRoutes, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ MarkBridgeAsVisited()

void ns3::GlobalRouter::MarkBridgeAsVisited ( Ptr< BridgeNetDevice device) const
private

When recursively checking for devices on the link, mark a given device as having been visited.

Parameters
devicethe bridge device to mark

Definition at line 1800 of file global-router-interface.cc.

References m_bridgesVisited, and NS_LOG_FUNCTION.

Referenced by AnotherRouterOnLink(), FindAllNonBridgedDevicesOnLink(), and FindDesignatedRouterForLink().

+ Here is the caller graph for this function:

◆ NetDeviceIsBridged()

Ptr< BridgeNetDevice > ns3::GlobalRouter::NetDeviceIsBridged ( Ptr< NetDevice nd) const
private

Decide whether or not a given net device is being bridged by a BridgeNetDevice.

Parameters
ndthe NetDevice
Returns
the BridgeNetDevice smart pointer or null if not found

Definition at line 1729 of file global-router-interface.cc.

References NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by AnotherRouterOnLink(), DiscoverLSAs(), FindAllNonBridgedDevicesOnLink(), and FindDesignatedRouterForLink().

+ Here is the caller graph for this function:

◆ operator=()

GlobalRouter & ns3::GlobalRouter::operator= ( const GlobalRouter )
delete

◆ ProcessBridgedBroadcastLink()

void ns3::GlobalRouter::ProcessBridgedBroadcastLink ( Ptr< NetDevice nd,
GlobalRoutingLSA pLSA,
NetDeviceContainer c 
)
private

Process a bridged broadcast link.

Parameters
ndthe NetDevice
pLSAthe Global LSA
cthe returned NetDevice container

Definition at line 860 of file global-router-interface.cc.

References ns3::NetDeviceContainer::Add(), ns3::GlobalRoutingLSA::AddLinkRecord(), AnotherRouterOnLink(), ClearBridgesVisited(), ns3::Ipv4Address::CombineMask(), FindDesignatedRouterForLink(), ns3::Ipv4Mask::Get(), ns3::Ipv4Mask::GetPrefixLength(), NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Ipv4Address::Set(), ns3::GlobalRoutingLinkRecord::SetLinkData(), ns3::GlobalRoutingLinkRecord::SetLinkId(), ns3::GlobalRoutingLinkRecord::SetLinkType(), ns3::GlobalRoutingLinkRecord::SetMetric(), ns3::GlobalRoutingLinkRecord::StubNetwork, and ns3::GlobalRoutingLinkRecord::TransitNetwork.

Referenced by ProcessBroadcastLink().

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

◆ ProcessBroadcastLink()

void ns3::GlobalRouter::ProcessBroadcastLink ( Ptr< NetDevice nd,
GlobalRoutingLSA pLSA,
NetDeviceContainer c 
)
private

Process a generic broadcast link.

Parameters
ndthe NetDevice
pLSAthe Global LSA
cthe returned NetDevice container

Definition at line 725 of file global-router-interface.cc.

References NS_LOG_FUNCTION, ProcessBridgedBroadcastLink(), and ProcessSingleBroadcastLink().

Referenced by DiscoverLSAs().

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

◆ ProcessPointToPointLink()

void ns3::GlobalRouter::ProcessPointToPointLink ( Ptr< NetDevice ndLocal,
GlobalRoutingLSA pLSA 
)
private

Process a point to point link.

Parameters
ndLocalthe NetDevice
pLSAthe Global LSA

Definition at line 1026 of file global-router-interface.cc.

References ns3::GlobalRoutingLSA::AddLinkRecord(), ns3::Ipv4Mask::Get(), GetAdjacent(), NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::GlobalRoutingLinkRecord::PointToPoint, ns3::GlobalRoutingLinkRecord::SetLinkData(), ns3::GlobalRoutingLinkRecord::SetLinkId(), ns3::GlobalRoutingLinkRecord::SetLinkType(), ns3::GlobalRoutingLinkRecord::SetMetric(), and ns3::GlobalRoutingLinkRecord::StubNetwork.

Referenced by DiscoverLSAs().

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

◆ ProcessSingleBroadcastLink()

void ns3::GlobalRouter::ProcessSingleBroadcastLink ( Ptr< NetDevice nd,
GlobalRoutingLSA pLSA,
NetDeviceContainer c 
)
private

Process a single broadcast link.

Parameters
ndthe NetDevice
pLSAthe Global LSA
cthe returned NetDevice container

Definition at line 740 of file global-router-interface.cc.

References ns3::NetDeviceContainer::Add(), ns3::GlobalRoutingLSA::AddLinkRecord(), AnotherRouterOnLink(), ClearBridgesVisited(), ns3::Ipv4Address::CombineMask(), FindDesignatedRouterForLink(), ns3::Ipv4Mask::Get(), ns3::Ipv4Mask::GetPrefixLength(), NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Ipv4Address::Set(), ns3::GlobalRoutingLinkRecord::StubNetwork, and ns3::GlobalRoutingLinkRecord::TransitNetwork.

Referenced by ProcessBroadcastLink().

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

◆ RemoveInjectedRoute()

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
iThe index (into the injected routing list) of the route to remove.
See also
GlobalRouter::WithdrawRoute ()

Definition at line 1655 of file global-router-interface.cc.

References m_injectedRoutes, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ SetRoutingProtocol()

void ns3::GlobalRouter::SetRoutingProtocol ( Ptr< Ipv4GlobalRouting routing)

Set the specific Global Routing Protocol to be used.

Parameters
routingthe routing protocol

Definition at line 521 of file global-router-interface.cc.

References m_routingProtocol, and NS_LOG_FUNCTION.

◆ WithdrawRoute()

bool ns3::GlobalRouter::WithdrawRoute ( Ipv4Address  network,
Ipv4Mask  networkMask 
)

Withdraw a route from the global unicast routing table.

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

Definition at line 1674 of file global-router-interface.cc.

References m_injectedRoutes, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Member Data Documentation

◆ m_bridgesVisited

std::vector<Ptr<BridgeNetDevice> > ns3::GlobalRouter::m_bridgesVisited
mutableprivate

Container of bridges visited.

Definition at line 874 of file global-router-interface.h.

Referenced by BridgeHasAlreadyBeenVisited(), ClearBridgesVisited(), and MarkBridgeAsVisited().

◆ m_injectedRoutes

InjectedRoutes ns3::GlobalRouter::m_injectedRoutes
private

◆ m_LSAs

ListOfLSAs_t ns3::GlobalRouter::m_LSAs
private

database of GlobalRoutingLSAs

Definition at line 856 of file global-router-interface.h.

Referenced by BuildNetworkLSAs(), ClearLSAs(), DiscoverLSAs(), GetLSA(), and GetNumLSAs().

◆ m_routerId

Ipv4Address ns3::GlobalRouter::m_routerId
private

router ID (its IPv4 address)

Definition at line 858 of file global-router-interface.h.

Referenced by GlobalRouter(), BuildNetworkLSAs(), DiscoverLSAs(), and GetRouterId().

◆ m_routingProtocol

Ptr<Ipv4GlobalRouting> ns3::GlobalRouter::m_routingProtocol
private

the Ipv4GlobalRouting in use

Definition at line 859 of file global-router-interface.h.

Referenced by DoDispose(), GetRoutingProtocol(), and SetRoutingProtocol().


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