Vertex used in shortest path first (SPF) computations. More...
#include "global-route-manager-impl.h"
Public Types | |
typedef std::pair< Ipv4Address, int32_t > | NodeExit_t |
IPv4 / interface container for exit nodes. More... | |
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). More... | |
SPFVertex (GlobalRoutingLSA *lsa) | |
Construct an initialized SPFVertex (Shortest Path First Vertex). More... | |
~SPFVertex () | |
Destroy an SPFVertex (Shortest Path First Vertex). More... | |
uint32_t | AddChild (SPFVertex *child) |
Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex. More... | |
void | ClearVertexProcessed (void) |
Clear the value of the VertexProcessed flag. More... | |
SPFVertex * | GetChild (uint32_t n) const |
Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex. More... | |
uint32_t | GetDistanceFromRoot (void) const |
Get the distance from the root vertex to "this" SPFVertex object. More... | |
GlobalRoutingLSA * | GetLSA (void) const |
Get the Global Router Link State Advertisement returned by the Global Router represented by this SPFVertex during the route discovery process. More... | |
uint32_t | GetNChildren (void) const |
Get the number of children of "this" SPFVertex. More... | |
uint32_t | GetNRootExitDirections () const |
Get the number of exit directions from root for reaching 'this' vertex. More... | |
SPFVertex * | GetParent (uint32_t i=0) const |
Get a pointer to the SPFVector that is the parent of "this" SPFVertex. More... | |
NodeExit_t | GetRootExitDirection () const |
Obtain a pair indicating the exit direction from the root. More... | |
NodeExit_t | GetRootExitDirection (uint32_t i) const |
Obtain a pair indicating the exit direction from the root. More... | |
Ipv4Address | GetVertexId (void) const |
Get the Vertex ID field of a SPFVertex object. More... | |
VertexType | GetVertexType (void) const |
Get the Vertex Type field of a SPFVertex object. More... | |
void | InheritAllRootExitDirections (const SPFVertex *vertex) |
Inherit all root exit directions from a given vertex to 'this' vertex. More... | |
bool | IsVertexProcessed (void) const |
Check the value of the VertexProcessed flag. More... | |
void | MergeParent (const SPFVertex *v) |
Merge the Parent list from the v into this vertex. More... | |
void | MergeRootExitDirections (const SPFVertex *vertex) |
Merge into 'this' vertex the list of exit directions from another vertex. More... | |
void | SetDistanceFromRoot (uint32_t distance) |
Set the distance from the root vertex to "this" SPFVertex object. More... | |
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. More... | |
void | SetParent (SPFVertex *parent) |
Set the pointer to the SPFVector that is the parent of "this" SPFVertex. More... | |
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. More... | |
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. More... | |
void | SetVertexId (Ipv4Address id) |
Set the Vertex ID field of a SPFVertex object. More... | |
void | SetVertexProcessed (bool value) |
Set the value of the VertexProcessed flag. More... | |
void | SetVertexType (VertexType type) |
Set the Vertex Type field of a SPFVertex object. More... | |
Private Types | |
typedef std::list< NodeExit_t > | ListOfNodeExit_t |
container of Exit nodes More... | |
typedef std::list< SPFVertex * > | ListOfSPFVertex_t |
container of SPFVertexes More... | |
Private Member Functions | |
SPFVertex (SPFVertex &v) | |
The SPFVertex copy construction is disallowed. More... | |
SPFVertex & | operator= (SPFVertex &v) |
The SPFVertex copy assignment operator is disallowed. More... | |
Private Attributes | |
ListOfSPFVertex_t | m_children |
Children list. More... | |
uint32_t | m_distanceFromRoot |
Distance from root node. More... | |
ListOfNodeExit_t | m_ecmpRootExits |
store the multiple root's exits for supporting ECMP More... | |
GlobalRoutingLSA * | m_lsa |
Link State Advertisement. More... | |
Ipv4Address | m_nextHop |
next hop More... | |
ListOfSPFVertex_t | m_parents |
parent list More... | |
int32_t | m_rootOif |
root Output Interface More... | |
Ipv4Address | m_vertexId |
Vertex ID. More... | |
bool | m_vertexProcessed |
Flag to note whether vertex has been processed in stage two of SPF computation. More... | |
VertexType | m_vertexType |
Vertex type. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SPFVertex::ListOfSPFVertex_t &vs) |
Stream insertion operator. More... | |
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 68 of file global-route-manager-impl.h.
|
private |
container of Exit nodes
Definition at line 535 of file global-route-manager-impl.h.
|
private |
container of SPFVertexes
Definition at line 537 of file global-route-manager-impl.h.
typedef std::pair<Ipv4Address, int32_t> ns3::SPFVertex::NodeExit_t |
IPv4 / interface container for exit nodes.
Definition at line 291 of file global-route-manager-impl.h.
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 78 of file global-route-manager-impl.h.
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.
Definition at line 87 of file global-route-manager-impl.cc.
References NS_LOG_FUNCTION.
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.
lsa | The Link State Advertisement used for finding initial values. |
Definition at line 101 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.
ns3::SPFVertex::~SPFVertex | ( | ) |
Destroy an SPFVertex (Shortest Path First Vertex).
The children vertices of the SPFVertex are recursively deleted.
Definition at line 125 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.
|
private |
The SPFVertex copy construction is disallowed.
There's no need for it and a compiler provided shallow copy would be wrong.
v | object to copy from |
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.
child | A pointer to the SPFVertex (which resides in the SPF tree) to be added to the list of children of "this" SPFVertex. |
Definition at line 384 of file global-route-manager-impl.cc.
References m_children, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFVertexAddParent().
void ns3::SPFVertex::ClearVertexProcessed | ( | void | ) |
Clear the value of the VertexProcessed flag.
Flag to note whether vertex has been processed in stage two of SPF computation
Definition at line 406 of file global-route-manager-impl.cc.
References ClearVertexProcessed(), GetChild(), GetNChildren(), NS_LOG_FUNCTION, and SetVertexProcessed().
Referenced by ClearVertexProcessed(), and ns3::GlobalRouteManagerImpl::SPFCalculate().
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.
n | The index (from 0 to the number of children minus 1) of the child SPFVertex to return. |
Definition at line 365 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().
uint32_t ns3::SPFVertex::GetDistanceFromRoot | ( | void | ) | 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.
Definition at line 226 of file global-route-manager-impl.cc.
References m_distanceFromRoot, and NS_LOG_FUNCTION.
Referenced by ns3::CandidateQueue::CompareSPFVertex(), and ns3::GlobalRouteManagerImpl::SPFNext().
GlobalRoutingLSA * ns3::SPFVertex::GetLSA | ( | void | ) | const |
Get the Global Router Link State Advertisement returned by the Global Router represented by this SPFVertex during the route discovery process.
Definition at line 212 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().
uint32_t ns3::SPFVertex::GetNChildren | ( | void | ) | 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).
Definition at line 358 of file global-route-manager-impl.cc.
References m_children, and NS_LOG_FUNCTION.
Referenced by ClearVertexProcessed(), ns3::GlobalRouteManagerImpl::ProcessASExternals(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().
uint32_t ns3::SPFVertex::GetNRootExitDirections | ( | ) | const |
Get the number of exit directions from root for reaching 'this' vertex.
Definition at line 351 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().
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).
i | The index to one of the parents |
Definition at line 243 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().
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.
Definition at line 311 of file global-route-manager-impl.cc.
References m_ecmpRootExits, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
SPFVertex::NodeExit_t ns3::SPFVertex::GetRootExitDirection | ( | uint32_t | i | ) | const |
Obtain a pair indicating the exit direction from the root.
i | An index to a pair |
Definition at line 298 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().
Ipv4Address ns3::SPFVertex::GetVertexId | ( | void | ) | 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.
Definition at line 198 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().
SPFVertex::VertexType ns3::SPFVertex::GetVertexType | ( | void | ) | const |
Get the Vertex Type field of a SPFVertex object.
The Vertex Type describes the kind of simulation object a given SPFVertex represents.
Definition at line 184 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().
void ns3::SPFVertex::InheritAllRootExitDirections | ( | const SPFVertex * | vertex | ) |
Inherit all root exit directions from a given vertex to 'this' vertex.
vertex | The 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 335 of file global-route-manager-impl.cc.
References m_ecmpRootExits, NS_LOG_FUNCTION, and NS_LOG_WARN.
Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().
bool ns3::SPFVertex::IsVertexProcessed | ( | void | ) | const |
Check the value of the VertexProcessed flag.
Flag to note whether vertex has been processed in stage two of SPF computation
Definition at line 399 of file global-route-manager-impl.cc.
References m_vertexProcessed, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::ProcessASExternals(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().
void ns3::SPFVertex::MergeParent | ( | const SPFVertex * | v | ) |
Merge the Parent list from the v into this vertex.
v | The 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 262 of file global-route-manager-impl.cc.
References m_parents, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by ns3::GlobalRouteManagerImpl::SPFNext().
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.
vertex | From which the list of exit directions are obtain and are merged into 'this' vertex |
Definition at line 320 of file global-route-manager-impl.cc.
References m_ecmpRootExits, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFNext().
The SPFVertex copy assignment operator is disallowed.
There's no need for it and a compiler provided shallow copy would be wrong.
v | object to copy from |
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.
Definition at line 219 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().
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.
lsa | A pointer to the GlobalRoutingLSA. |
Definition at line 205 of file global-route-manager-impl.cc.
References m_lsa, and NS_LOG_FUNCTION.
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).
parent | A pointer to the SPFVertex that is the parent of "this" SPFVertex* in the SPF tree. |
Definition at line 233 of file global-route-manager-impl.cc.
References m_parents, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().
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.
nextHop | The IP address to use when forwarding packets to the host or network represented by "this" SPFVertex. |
id | The interface index to use when forwarding packets to the host or network represented by "this" SPFVertex. |
Definition at line 277 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().
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.
exit | The 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 291 of file global-route-manager-impl.cc.
References NS_LOG_FUNCTION, and SetRootExitDirection().
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.
id | The new Ipv4Address Vertex ID for the current SPFVertex object. |
Definition at line 191 of file global-route-manager-impl.cc.
References m_vertexId, and NS_LOG_FUNCTION.
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
value | boolean value to set the flag |
Definition at line 392 of file global-route-manager-impl.cc.
References m_vertexProcessed, and NS_LOG_FUNCTION.
Referenced by ClearVertexProcessed(), ns3::GlobalRouteManagerImpl::ProcessASExternals(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().
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.
type | The new VertexType for the current SPFVertex object. |
Definition at line 177 of file global-route-manager-impl.cc.
References m_vertexType, and NS_LOG_FUNCTION.
|
friend |
Stream insertion operator.
os | the reference to the output stream |
vs | a list of SPFVertexes |
Definition at line 60 of file global-route-manager-impl.cc.
|
private |
Children list.
Definition at line 539 of file global-route-manager-impl.h.
Referenced by ~SPFVertex(), AddChild(), GetChild(), and GetNChildren().
|
private |
Distance from root node.
Definition at line 532 of file global-route-manager-impl.h.
Referenced by GetDistanceFromRoot(), and SetDistanceFromRoot().
|
private |
store the multiple root's exits for supporting ECMP
Definition at line 536 of file global-route-manager-impl.h.
Referenced by ~SPFVertex(), GetNRootExitDirections(), GetRootExitDirection(), InheritAllRootExitDirections(), MergeRootExitDirections(), and SetRootExitDirection().
|
private |
Link State Advertisement.
Definition at line 531 of file global-route-manager-impl.h.
|
private |
next hop
Definition at line 534 of file global-route-manager-impl.h.
Referenced by SetRootExitDirection().
|
private |
parent list
Definition at line 538 of file global-route-manager-impl.h.
Referenced by ~SPFVertex(), GetParent(), MergeParent(), and SetParent().
|
private |
root Output Interface
Definition at line 533 of file global-route-manager-impl.h.
Referenced by SetRootExitDirection().
|
private |
Vertex ID.
Definition at line 530 of file global-route-manager-impl.h.
Referenced by ~SPFVertex(), GetVertexId(), and SetVertexId().
|
private |
Flag to note whether vertex has been processed in stage two of SPF computation.
Definition at line 540 of file global-route-manager-impl.h.
Referenced by IsVertexProcessed(), and SetVertexProcessed().
|
private |
Vertex type.
Definition at line 529 of file global-route-manager-impl.h.
Referenced by SPFVertex(), GetVertexType(), and SetVertexType().