A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::SPFVertex Class Reference

Vertex used in shortest path first (SPF) computations. More...

#include "global-route-manager-impl.h"

+ Collaboration diagram for ns3::SPFVertex:

Public Types

typedef std::pair< Ipv4Address, int32_tNodeExit_t
 IPv4 / interface container for exit nodes.
 
enum  VertexType { VertexUnknown = 0 , VertexRouter , VertexNetwork }
 Enumeration of the possible types of SPFVertex objects. More...
 

Public Member Functions

 SPFVertex ()
 Construct an empty ("uninitialized") SPFVertex (Shortest Path First Vertex).
 
 SPFVertex (const SPFVertex &)=delete
 
 SPFVertex (GlobalRoutingLSA *lsa)
 Construct an initialized SPFVertex (Shortest Path First Vertex).
 
 ~SPFVertex ()
 Destroy an SPFVertex (Shortest Path First Vertex).
 
uint32_t AddChild (SPFVertex *child)
 Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex.
 
void ClearVertexProcessed ()
 Clear the value of the VertexProcessed flag.
 
SPFVertexGetChild (uint32_t n) const
 Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex.
 
uint32_t GetDistanceFromRoot () const
 Get the distance from the root vertex to "this" SPFVertex object.
 
GlobalRoutingLSAGetLSA () const
 Get the Global Router Link State Advertisement returned by the Global Router represented by this SPFVertex during the route discovery process.
 
uint32_t GetNChildren () const
 Get the number of children of "this" SPFVertex.
 
uint32_t GetNRootExitDirections () const
 Get the number of exit directions from root for reaching 'this' vertex.
 
SPFVertexGetParent (uint32_t i=0) const
 Get a pointer to the SPFVector that is the parent of "this" SPFVertex.
 
NodeExit_t GetRootExitDirection () const
 Obtain a pair indicating the exit direction from the root.
 
NodeExit_t GetRootExitDirection (uint32_t i) const
 Obtain a pair indicating the exit direction from the root.
 
Ipv4Address GetVertexId () const
 Get the Vertex ID field of a SPFVertex object.
 
VertexType GetVertexType () const
 Get the Vertex Type field of a SPFVertex object.
 
void InheritAllRootExitDirections (const SPFVertex *vertex)
 Inherit all root exit directions from a given vertex to 'this' vertex.
 
bool IsVertexProcessed () const
 Check the value of the VertexProcessed flag.
 
void MergeParent (const SPFVertex *v)
 Merge the Parent list from the v into this vertex.
 
void MergeRootExitDirections (const SPFVertex *vertex)
 Merge into 'this' vertex the list of exit directions from another vertex.
 
SPFVertexoperator= (const SPFVertex &)=delete
 
void SetDistanceFromRoot (uint32_t distance)
 Set the distance from the root vertex to "this" SPFVertex object.
 
void SetLSA (GlobalRoutingLSA *lsa)
 Set the Global Router Link State Advertisement returned by the Global Router represented by this SPFVertex during the route discovery process.
 
void SetParent (SPFVertex *parent)
 Set the pointer to the SPFVector that is the parent of "this" SPFVertex.
 
void SetRootExitDirection (Ipv4Address nextHop, int32_t id=SPF_INFINITY)
 Set the IP address and outgoing interface index that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
 
void SetRootExitDirection (SPFVertex::NodeExit_t exit)
 Set the IP address and outgoing interface index that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
 
void SetVertexId (Ipv4Address id)
 Set the Vertex ID field of a SPFVertex object.
 
void SetVertexProcessed (bool value)
 Set the value of the VertexProcessed flag.
 
void SetVertexType (VertexType type)
 Set the Vertex Type field of a SPFVertex object.
 

Private Types

typedef std::list< NodeExit_tListOfNodeExit_t
 container of Exit nodes
 
typedef std::list< SPFVertex * > ListOfSPFVertex_t
 container of SPFVertexes
 

Private Attributes

ListOfSPFVertex_t m_children
 Children list.
 
uint32_t m_distanceFromRoot
 Distance from root node.
 
ListOfNodeExit_t m_ecmpRootExits
 store the multiple root's exits for supporting ECMP
 
GlobalRoutingLSAm_lsa
 Link State Advertisement.
 
Ipv4Address m_nextHop
 next hop
 
ListOfSPFVertex_t m_parents
 parent list
 
int32_t m_rootOif
 root Output Interface
 
Ipv4Address m_vertexId
 Vertex ID.
 
bool m_vertexProcessed
 Flag to note whether vertex has been processed in stage two of SPF computation.
 
VertexType m_vertexType
 Vertex type.
 

Friends

std::ostream & operator<< (std::ostream &os, const SPFVertex::ListOfSPFVertex_t &vs)
 Stream insertion operator.
 

Detailed Description

Vertex used in shortest path first (SPF) computations.

See RFC 2328, Section 16.

Each router in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes. Each of these routers in the calculation has an associated SPFVertex.

The "Root" vertex is the SPFVertex representing the router that is having its routing tables set. The SPFVertex objects representing other routers or networks in the simulation are arranged in the SPF tree. It is this tree that represents the Shortest Paths to the other networks.

Each SPFVertex has a pointer to the Global Router Link State Advertisement (LSA) that its underlying router has exported. Within these LSAs are Global Router Link Records that describe the point to point links from the underlying router to other nodes (represented by other SPFVertex objects) in the simulation topology. The combination of the arrangement of the SPFVertex objects in the SPF tree, along with the details of the link records that connect them provide the information required to construct the required routes.

Definition at line 70 of file global-route-manager-impl.h.

Member Typedef Documentation

◆ ListOfNodeExit_t

typedef std::list<NodeExit_t> ns3::SPFVertex::ListOfNodeExit_t
private

container of Exit nodes

Definition at line 543 of file global-route-manager-impl.h.

◆ ListOfSPFVertex_t

typedef std::list<SPFVertex*> ns3::SPFVertex::ListOfSPFVertex_t
private

container of SPFVertexes

Definition at line 545 of file global-route-manager-impl.h.

◆ NodeExit_t

IPv4 / interface container for exit nodes.

Definition at line 299 of file global-route-manager-impl.h.

Member Enumeration Documentation

◆ VertexType

Enumeration of the possible types of SPFVertex objects.

Currently we use VertexRouter to identify objects that represent a router in the simulation topology, and VertexNetwork to identify objects that represent a network.

Enumerator
VertexUnknown 

Uninitialized Link Record.

VertexRouter 

Vertex representing a router in the topology.

VertexNetwork 

Vertex representing a network in the topology.

Definition at line 80 of file global-route-manager-impl.h.

Constructor & Destructor Documentation

◆ SPFVertex() [1/3]

ns3::SPFVertex::SPFVertex ( )

Construct an empty ("uninitialized") SPFVertex (Shortest Path First Vertex).

The Vertex Type is set to VertexUnknown, the Vertex ID is set to 255.255.255.255, and the distance from root is set to infinity (UINT32_MAX). The referenced Link State Advertisement (LSA) is set to null as is the parent SPFVertex. The outgoing interface index is set to infinity, the next hop address is set to 0.0.0.0 and the list of children of the SPFVertex is initialized to empty.

See also
VertexType

Definition at line 88 of file global-route-manager-impl.cc.

References NS_LOG_FUNCTION.

◆ SPFVertex() [2/3]

ns3::SPFVertex::SPFVertex ( GlobalRoutingLSA lsa)

Construct an initialized SPFVertex (Shortest Path First Vertex).

The Vertex Type is initialized to VertexRouter and the Vertex ID is found from the Link State ID of the Link State Advertisement (LSA) passed as a parameter. The Link State ID is set to the Router ID of the advertising router. The referenced LSA (m_lsa) is set to the given LSA. Other than these members, initialization is as in the default constructor. of the SPFVertex is initialized to empty.

See also
SPFVertex::SPFVertex ()
VertexType
GlobalRoutingLSA
Parameters
lsaThe Link State Advertisement used for finding initial values.

Definition at line 102 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLSA::GetLSType(), m_vertexType, ns3::GlobalRoutingLSA::NetworkLSA, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::GlobalRoutingLSA::RouterLSA, VertexNetwork, and VertexRouter.

+ Here is the call graph for this function:

◆ ~SPFVertex()

ns3::SPFVertex::~SPFVertex ( )

Destroy an SPFVertex (Shortest Path First Vertex).

The children vertices of the SPFVertex are recursively deleted.

See also
SPFVertex::SPFVertex ()

Definition at line 126 of file global-route-manager-impl.cc.

References GetVertexId(), m_children, m_ecmpRootExits, m_parents, m_vertexId, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ SPFVertex() [3/3]

ns3::SPFVertex::SPFVertex ( const SPFVertex )
delete

Member Function Documentation

◆ AddChild()

uint32_t ns3::SPFVertex::AddChild ( SPFVertex child)

Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex.

Each router node in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set and is the root of the SPF tree. Each vertex in the SPF tree can have a number of children that represent host or network routes available via that vertex.

This method the number of children of "this" SPFVertex (which reside in the SPF tree.

See also
SPFVertex::GetNChildren
Warning
Ownership of the pointer added to the children of "this" SPFVertex is transferred to the "this" SPFVertex. You must not delete the (now) child SPFVertex after calling this method.
Parameters
childA pointer to the SPFVertex (which resides in the SPF tree) to be added to the list of children of "this" SPFVertex.
Returns
The number of children of "this" SPFVertex after the addition of the new child.

Definition at line 389 of file global-route-manager-impl.cc.

References m_children, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::SPFVertexAddParent().

+ Here is the caller graph for this function:

◆ ClearVertexProcessed()

void ns3::SPFVertex::ClearVertexProcessed ( )

Clear the value of the VertexProcessed flag.

Flag to note whether vertex has been processed in stage two of SPF computation

Definition at line 411 of file global-route-manager-impl.cc.

References ClearVertexProcessed(), GetChild(), GetNChildren(), NS_LOG_FUNCTION, and SetVertexProcessed().

Referenced by ClearVertexProcessed(), and ns3::GlobalRouteManagerImpl::SPFCalculate().

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

◆ GetChild()

SPFVertex * ns3::SPFVertex::GetChild ( uint32_t  n) const

Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex.

Each router node in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set and is the root of the SPF tree. Each vertex in the SPF tree can have a number of children that represent host or network routes available via that vertex.

This method the number of children of "this" SPFVertex (which reside in the SPF tree.

See also
SPFVertex::GetNChildren
Parameters
nThe index (from 0 to the number of children minus 1) of the child SPFVertex to return.
Warning
The pointer returned by GetChild () is a borrowed pointer. You do not have any ownership of the underlying object and must not delete that object.
Returns
A pointer to the specified child SPFVertex (which resides in the SPF tree).

Definition at line 372 of file global-route-manager-impl.cc.

References m_children, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ClearVertexProcessed(), ns3::GlobalRouteManagerImpl::ProcessASExternals(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().

+ Here is the caller graph for this function:

◆ GetDistanceFromRoot()

uint32_t ns3::SPFVertex::GetDistanceFromRoot ( ) const

Get the distance from the root vertex to "this" SPFVertex object.

Each router in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes. Each of these routers in the calculation has an associated SPFVertex.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set. The "this" SPFVertex is the vertex to which a route is being calculated from the root. The distance from the root that we're asking for is the number of hops from the root vertex to the vertex in question.

The distance is calculated during route discovery and is stored in a member variable. This method simply fetches that value.

Returns
The distance, in hops, from the root SPFVertex to "this" SPFVertex.

Definition at line 230 of file global-route-manager-impl.cc.

References m_distanceFromRoot, and NS_LOG_FUNCTION.

Referenced by ns3::CandidateQueue::CompareSPFVertex(), and ns3::GlobalRouteManagerImpl::SPFNext().

+ Here is the caller graph for this function:

◆ GetLSA()

GlobalRoutingLSA * ns3::SPFVertex::GetLSA ( ) const

Get the Global Router Link State Advertisement returned by the Global Router represented by this SPFVertex during the route discovery process.

See also
GlobalRouter
GlobalRoutingLSA
GlobalRouter::DiscoverLSAs ()
Returns
A pointer to the GlobalRoutingLSA found by the router represented by this SPFVertex object.

Definition at line 216 of file global-route-manager-impl.cc.

References m_lsa, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::ProcessASExternals(), ns3::GlobalRouteManagerImpl::SPFAddASExternal(), ns3::GlobalRouteManagerImpl::SPFCalculate(), ns3::GlobalRouteManagerImpl::SPFGetNextLink(), ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), ns3::GlobalRouteManagerImpl::SPFIntraAddTransit(), ns3::GlobalRouteManagerImpl::SPFNext(), ns3::GlobalRouteManagerImpl::SPFNexthopCalculation(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().

+ Here is the caller graph for this function:

◆ GetNChildren()

uint32_t ns3::SPFVertex::GetNChildren ( ) const

Get the number of children of "this" SPFVertex.

Each router node in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set and is the root of the SPF tree. Each vertex in the SPF tree can have a number of children that represent host or network routes available via that vertex.

This method returns the number of children of "this" SPFVertex (which reside in the SPF tree).

Returns
The number of children of "this" SPFVertex (which reside in the SPF tree).

Definition at line 365 of file global-route-manager-impl.cc.

References m_children, and NS_LOG_FUNCTION.

Referenced by ClearVertexProcessed(), ns3::GlobalRouteManagerImpl::ProcessASExternals(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().

+ Here is the caller graph for this function:

◆ GetNRootExitDirections()

uint32_t ns3::SPFVertex::GetNRootExitDirections ( ) const

Get the number of exit directions from root for reaching 'this' vertex.

Returns
The number of exit directions from root

Definition at line 358 of file global-route-manager-impl.cc.

References m_ecmpRootExits, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::SPFAddASExternal(), ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), and ns3::GlobalRouteManagerImpl::SPFIntraAddTransit().

+ Here is the caller graph for this function:

◆ GetParent()

SPFVertex * ns3::SPFVertex::GetParent ( uint32_t  i = 0) const

Get a pointer to the SPFVector that is the parent of "this" SPFVertex.

Each router node in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set and is the root of the SPF tree.

This method returns a pointer to the parent node of "this" SPFVertex (both of which reside in that SPF tree).

Parameters
iThe index to one of the parents
Returns
A pointer to the SPFVertex that is the parent of "this" SPFVertex in the SPF tree.

Definition at line 247 of file global-route-manager-impl.cc.

References m_parents, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation(), and ns3::GlobalRouteManagerImpl::SPFVertexAddParent().

+ Here is the caller graph for this function:

◆ GetRootExitDirection() [1/2]

SPFVertex::NodeExit_t ns3::SPFVertex::GetRootExitDirection ( ) const

Obtain a pair indicating the exit direction from the root.

This method assumes there is only a single exit direction from the root. Error occur if this assumption is invalid.

Returns
The pair of next-hop-IP and outgoing-interface-index for reaching 'this' vertex from the root

Definition at line 317 of file global-route-manager-impl.cc.

References GetRootExitDirection(), m_ecmpRootExits, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by GetRootExitDirection().

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

◆ GetRootExitDirection() [2/2]

SPFVertex::NodeExit_t ns3::SPFVertex::GetRootExitDirection ( uint32_t  i) const

Obtain a pair indicating the exit direction from the root.

Parameters
iAn index to a pair
Returns
A pair of next-hop-IP and outgoing-interface-index for indicating an exit direction from the root. It is 0 if the index 'i' is out-of-range

Definition at line 301 of file global-route-manager-impl.cc.

References m_ecmpRootExits, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::SPFAddASExternal(), ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), ns3::GlobalRouteManagerImpl::SPFIntraAddTransit(), and ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().

+ Here is the caller graph for this function:

◆ GetVertexId()

Ipv4Address ns3::SPFVertex::GetVertexId ( ) const

Get the Vertex ID field of a SPFVertex object.

The Vertex ID uniquely identifies the simulation object a given SPFVertex represents. Typically, this is the Router ID for SPFVertex objects representing routers, and comes from the Link State Advertisement of a router aggregated to a node in the simulation. These IDs are allocated automatically by the routing environment and look like IP addresses beginning at 0.0.0.0 and monotonically increasing as new routers are instantiated.

Returns
The Ipv4Address Vertex ID of the current SPFVertex object.

Definition at line 202 of file global-route-manager-impl.cc.

References m_vertexId, and NS_LOG_FUNCTION.

Referenced by ~SPFVertex(), ns3::CandidateQueue::Find(), ns3::GlobalRouteManagerImpl::FindOutgoingInterfaceId(), ns3::GlobalRouteManagerImpl::ProcessASExternals(), ns3::GlobalRouteManagerImpl::SPFAddASExternal(), ns3::GlobalRouteManagerImpl::SPFCalculate(), ns3::GlobalRouteManagerImpl::SPFGetNextLink(), ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), ns3::GlobalRouteManagerImpl::SPFIntraAddTransit(), ns3::GlobalRouteManagerImpl::SPFNext(), ns3::GlobalRouteManagerImpl::SPFNexthopCalculation(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().

+ Here is the caller graph for this function:

◆ GetVertexType()

SPFVertex::VertexType ns3::SPFVertex::GetVertexType ( ) const

Get the Vertex Type field of a SPFVertex object.

The Vertex Type describes the kind of simulation object a given SPFVertex represents.

See also
VertexType
Returns
The VertexType of the current SPFVertex object.

Definition at line 188 of file global-route-manager-impl.cc.

References m_vertexType, and NS_LOG_FUNCTION.

Referenced by ns3::CandidateQueue::CompareSPFVertex(), ns3::GlobalRouteManagerImpl::ProcessASExternals(), ns3::GlobalRouteManagerImpl::SPFCalculate(), ns3::GlobalRouteManagerImpl::SPFNext(), ns3::GlobalRouteManagerImpl::SPFNexthopCalculation(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().

+ Here is the caller graph for this function:

◆ InheritAllRootExitDirections()

void ns3::SPFVertex::InheritAllRootExitDirections ( const SPFVertex vertex)

Inherit all root exit directions from a given vertex to 'this' vertex.

Parameters
vertexThe vertex from which all root exit directions are to be inherited

After the call of this method, the original root exit directions in 'this' vertex are all lost.

Definition at line 341 of file global-route-manager-impl.cc.

References m_ecmpRootExits, NS_LOG_FUNCTION, and NS_LOG_WARN.

Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().

+ Here is the caller graph for this function:

◆ IsVertexProcessed()

bool ns3::SPFVertex::IsVertexProcessed ( ) const

Check the value of the VertexProcessed flag.

Flag to note whether vertex has been processed in stage two of SPF computation

Returns
value of underlying flag

Definition at line 404 of file global-route-manager-impl.cc.

References m_vertexProcessed, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::ProcessASExternals(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().

+ Here is the caller graph for this function:

◆ MergeParent()

void ns3::SPFVertex::MergeParent ( const SPFVertex v)

Merge the Parent list from the v into this vertex.

Parameters
vThe vertex from which its list of Parent is read and then merged into the list of Parent of this vertex. Note that the list in v remains intact

Definition at line 266 of file global-route-manager-impl.cc.

References m_parents, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::GlobalRouteManagerImpl::SPFNext().

+ Here is the caller graph for this function:

◆ MergeRootExitDirections()

void ns3::SPFVertex::MergeRootExitDirections ( const SPFVertex vertex)

Merge into 'this' vertex the list of exit directions from another vertex.

This merge is necessary when ECMP are found.

Parameters
vertexFrom which the list of exit directions are obtain and are merged into 'this' vertex

Definition at line 327 of file global-route-manager-impl.cc.

References m_ecmpRootExits, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::SPFNext().

+ Here is the caller graph for this function:

◆ operator=()

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

◆ SetDistanceFromRoot()

void ns3::SPFVertex::SetDistanceFromRoot ( uint32_t  distance)

Set the distance from the root vertex to "this" SPFVertex object.

Each router in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes. Each of these routers in the calculation has an associated SPFVertex.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set. The "this" SPFVertex is the vertex to which a route is being calculated from the root. The distance from the root that we're asking for is the number of hops from the root vertex to the vertex in question.

Parameters
distanceThe distance, in hops, from the root SPFVertex to "this" SPFVertex.

Definition at line 223 of file global-route-manager-impl.cc.

References m_distanceFromRoot, and NS_LOG_FUNCTION.

Referenced by GlobalRouteManagerImplTestCase::DoRun(), ns3::GlobalRouteManagerImpl::SPFCalculate(), and ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().

+ Here is the caller graph for this function:

◆ SetLSA()

void ns3::SPFVertex::SetLSA ( GlobalRoutingLSA lsa)

Set the Global Router Link State Advertisement returned by the Global Router represented by this SPFVertex during the route discovery process.

See also
SPFVertex::GetLSA ()
GlobalRouter
GlobalRoutingLSA
GlobalRouter::DiscoverLSAs ()
Warning
Ownership of the LSA is transferred to the "this" SPFVertex. You must not delete the LSA after calling this method.
Parameters
lsaA pointer to the GlobalRoutingLSA.

Definition at line 209 of file global-route-manager-impl.cc.

References m_lsa, and NS_LOG_FUNCTION.

◆ SetParent()

void ns3::SPFVertex::SetParent ( SPFVertex parent)

Set the pointer to the SPFVector that is the parent of "this" SPFVertex.

Each router node in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set and is the root of the SPF tree.

This method sets the parent pointer of "this" SPFVertex (both of which reside in that SPF tree).

Parameters
parentA pointer to the SPFVertex that is the parent of "this" SPFVertex* in the SPF tree.

Definition at line 237 of file global-route-manager-impl.cc.

References m_parents, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().

+ Here is the caller graph for this function:

◆ SetRootExitDirection() [1/2]

void ns3::SPFVertex::SetRootExitDirection ( Ipv4Address  nextHop,
int32_t  id = SPF_INFINITY 
)

Set the IP address and outgoing interface index that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex.

Each router node in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set. The "this" SPFVertex is the vertex that represents the host or network to which a route is being calculated from the root. The IP address that we're asking for is the address on the remote side of a link off of the root node that should be used as the destination for packets along the path to "this" vertex.

When initializing the root SPFVertex, the IP address used when forwarding packets is determined by examining the Global Router Link Records of the Link State Advertisement generated by the root node's GlobalRouter. This address is used to forward packets off of the root's network down those links. As other vertices / nodes are discovered which are further away from the root, they will be accessible down one of the paths via a link described by one of these Global Router Link Records.

To forward packets to these hosts or networks, the root node must begin the forwarding process by sending the packets to a first hop router down an interface. This means that the first hop address and interface ID must be the same for all downstream SPFVertices. We call this "inheriting" the interface and next hop.

In this method we are telling the root node which exit direction it should send should I send a packet to the network or host represented by 'this' SPFVertex.

See also
GlobalRouter
GlobalRoutingLSA
GlobalRoutingLinkRecord
Parameters
nextHopThe IP address to use when forwarding packets to the host or network represented by "this" SPFVertex.
idThe interface index to use when forwarding packets to the host or network represented by "this" SPFVertex.

Definition at line 280 of file global-route-manager-impl.cc.

References m_ecmpRootExits, m_nextHop, m_rootOif, and NS_LOG_FUNCTION.

Referenced by SetRootExitDirection(), and ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().

+ Here is the caller graph for this function:

◆ SetRootExitDirection() [2/2]

void ns3::SPFVertex::SetRootExitDirection ( SPFVertex::NodeExit_t  exit)

Set the IP address and outgoing interface index that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex.

Each router node in the simulation is associated with an SPFVertex object. When calculating routes, each of these routers is, in turn, chosen as the "root" of the calculation and routes to all of the other routers are eventually saved in the routing tables of each of the chosen nodes.

The "Root" vertex is then the SPFVertex representing the router that is having its routing tables set. The "this" SPFVertex is the vertex that represents the host or network to which a route is being calculated from the root. The IP address that we're asking for is the address on the remote side of a link off of the root node that should be used as the destination for packets along the path to "this" vertex.

When initializing the root SPFVertex, the IP address used when forwarding packets is determined by examining the Global Router Link Records of the Link State Advertisement generated by the root node's GlobalRouter. This address is used to forward packets off of the root's network down those links. As other vertices / nodes are discovered which are further away from the root, they will be accessible down one of the paths via a link described by one of these Global Router Link Records.

To forward packets to these hosts or networks, the root node must begin the forwarding process by sending the packets to a first hop router down an interface. This means that the first hop address and interface ID must be the same for all downstream SPFVertices. We call this "inheriting" the interface and next hop.

In this method we are telling the root node which exit direction it should send should I send a packet to the network or host represented by 'this' SPFVertex.

See also
GlobalRouter
GlobalRoutingLSA
GlobalRoutingLinkRecord
Parameters
exitThe pair of next-hop-IP and outgoing-interface-index to use when forwarding packets to the host or network represented by "this" SPFVertex.

Definition at line 294 of file global-route-manager-impl.cc.

References NS_LOG_FUNCTION, and SetRootExitDirection().

+ Here is the call graph for this function:

◆ SetVertexId()

void ns3::SPFVertex::SetVertexId ( Ipv4Address  id)

Set the Vertex ID field of a SPFVertex object.

The Vertex ID uniquely identifies the simulation object a given SPFVertex represents. Typically, this is the Router ID for SPFVertex objects representing routers, and comes from the Link State Advertisement of a router aggregated to a node in the simulation. These IDs are allocated automatically by the routing environment and look like IP addresses beginning at 0.0.0.0 and monotonically increase as new routers are instantiated. This method is an explicit override of the automatically generated value.

Parameters
idThe new Ipv4Address Vertex ID for the current SPFVertex object.

Definition at line 195 of file global-route-manager-impl.cc.

References m_vertexId, and NS_LOG_FUNCTION.

◆ SetVertexProcessed()

void ns3::SPFVertex::SetVertexProcessed ( bool  value)

Set the value of the VertexProcessed flag.

Flag to note whether vertex has been processed in stage two of SPF computation

Parameters
valueboolean value to set the flag

Definition at line 397 of file global-route-manager-impl.cc.

References m_vertexProcessed, and NS_LOG_FUNCTION.

Referenced by ClearVertexProcessed(), ns3::GlobalRouteManagerImpl::ProcessASExternals(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().

+ Here is the caller graph for this function:

◆ SetVertexType()

void ns3::SPFVertex::SetVertexType ( SPFVertex::VertexType  type)

Set the Vertex Type field of a SPFVertex object.

The Vertex Type describes the kind of simulation object a given SPFVertex represents.

See also
VertexType
Parameters
typeThe new VertexType for the current SPFVertex object.

Definition at line 181 of file global-route-manager-impl.cc.

References m_vertexType, and NS_LOG_FUNCTION.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const SPFVertex::ListOfSPFVertex_t vs 
)
friend

Stream insertion operator.

Parameters
osthe reference to the output stream
vsa list of SPFVertexes
Returns
the reference to the output stream

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

Member Data Documentation

◆ m_children

ListOfSPFVertex_t ns3::SPFVertex::m_children
private

Children list.

Definition at line 547 of file global-route-manager-impl.h.

Referenced by ~SPFVertex(), AddChild(), GetChild(), and GetNChildren().

◆ m_distanceFromRoot

uint32_t ns3::SPFVertex::m_distanceFromRoot
private

Distance from root node.

Definition at line 540 of file global-route-manager-impl.h.

Referenced by GetDistanceFromRoot(), and SetDistanceFromRoot().

◆ m_ecmpRootExits

ListOfNodeExit_t ns3::SPFVertex::m_ecmpRootExits
private

store the multiple root's exits for supporting ECMP

Definition at line 544 of file global-route-manager-impl.h.

Referenced by ~SPFVertex(), GetNRootExitDirections(), GetRootExitDirection(), InheritAllRootExitDirections(), MergeRootExitDirections(), and SetRootExitDirection().

◆ m_lsa

GlobalRoutingLSA* ns3::SPFVertex::m_lsa
private

Link State Advertisement.

Definition at line 539 of file global-route-manager-impl.h.

Referenced by GetLSA(), and SetLSA().

◆ m_nextHop

Ipv4Address ns3::SPFVertex::m_nextHop
private

next hop

Definition at line 542 of file global-route-manager-impl.h.

Referenced by SetRootExitDirection().

◆ m_parents

ListOfSPFVertex_t ns3::SPFVertex::m_parents
private

parent list

Definition at line 546 of file global-route-manager-impl.h.

Referenced by ~SPFVertex(), GetParent(), MergeParent(), and SetParent().

◆ m_rootOif

int32_t ns3::SPFVertex::m_rootOif
private

root Output Interface

Definition at line 541 of file global-route-manager-impl.h.

Referenced by SetRootExitDirection().

◆ m_vertexId

Ipv4Address ns3::SPFVertex::m_vertexId
private

Vertex ID.

Definition at line 538 of file global-route-manager-impl.h.

Referenced by ~SPFVertex(), GetVertexId(), and SetVertexId().

◆ m_vertexProcessed

bool ns3::SPFVertex::m_vertexProcessed
private

Flag to note whether vertex has been processed in stage two of SPF computation.

Definition at line 548 of file global-route-manager-impl.h.

Referenced by IsVertexProcessed(), and SetVertexProcessed().

◆ m_vertexType

VertexType ns3::SPFVertex::m_vertexType
private

Vertex type.

Definition at line 537 of file global-route-manager-impl.h.

Referenced by SPFVertex(), GetVertexType(), and SetVertexType().


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