Vertex used in shortest path first (SPF) computations. See RFC 2328, Section 16. More...
#include <global-route-manager-impl.h>
Public Types | |
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 (GlobalRoutingLSA *lsa) | |
Construct an initialized SPFVertex (Shortest Path First Vertex). | |
~SPFVertex () | |
Destroy an SPFVertex (Shortest Path First Vertex). | |
VertexType | GetVertexType (void) const |
Get the Vertex Type field of a SPFVertex object. | |
void | SetVertexType (VertexType type) |
Set the Vertex Type field of a SPFVertex object. | |
Ipv4Address | GetVertexId (void) const |
Get the Vertex ID field of a SPFVertex object. | |
void | SetVertexId (Ipv4Address id) |
Set the Vertex ID field of a SPFVertex object. | |
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. | |
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. | |
uint32_t | GetDistanceFromRoot (void) const |
Get the distance from the root vertex to "this" SPFVertex object. | |
void | SetDistanceFromRoot (uint32_t distance) |
Set the distance from the root vertex to "this" SPFVertex object. | |
uint32_t | GetOutgoingTypeId (void) const |
Get the interface ID that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex. | |
void | SetOutgoingTypeId (uint32_t id) |
Set the interface ID that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex. | |
Ipv4Address | GetNextHop (void) const |
Get the IP address that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex. | |
void | SetNextHop (Ipv4Address nextHop) |
Set the IP address that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex. | |
SPFVertex * | GetParent (void) const |
Get a pointer to the SPFVector that is the parent of "this" SPFVertex. | |
void | SetParent (SPFVertex *parent) |
Set the pointer to the SPFVector that is the parent of "this" SPFVertex. | |
uint32_t | GetNChildren (void) const |
Get the number of children of "this" SPFVertex. | |
SPFVertex * | GetChild (uint32_t n) const |
Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex. | |
uint32_t | AddChild (SPFVertex *child) |
Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex. | |
void | SetVertexProcessed (bool value) |
Set the value of the VertexProcessed flag. | |
bool | IsVertexProcessed (void) const |
Check the value of the VertexProcessed flag. | |
Private Types | |
typedef std::list< SPFVertex * > | ListOfSPFVertex_t |
Private Member Functions | |
SPFVertex (SPFVertex &v) | |
The SPFVertex copy construction is disallowed. There's no need for it and a compiler provided shallow copy would be wrong. | |
SPFVertex & | operator= (SPFVertex &v) |
The SPFVertex copy assignment operator is disallowed. There's no need for it and a compiler provided shallow copy would be wrong. | |
Private Attributes | |
VertexType | m_vertexType |
Ipv4Address | m_vertexId |
GlobalRoutingLSA * | m_lsa |
uint32_t | m_distanceFromRoot |
uint32_t | m_rootOif |
Ipv4Address | m_nextHop |
SPFVertex * | m_parent |
ListOfSPFVertex_t | m_children |
bool | m_vertexProcessed |
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 66 of file global-route-manager-impl.h.
typedef std::list<SPFVertex*> ns3::SPFVertex::ListOfSPFVertex_t [private] |
Definition at line 575 of file global-route-manager-impl.h.
Enumeration of the possible types of SPFVertex objects.
VertexUnknown |
Uninitialized Link Record |
VertexRouter |
Vertex representing a router in the topology |
VertexNetwork |
Vertex representing a network in the topology |
Definition at line 77 of file global-route-manager-impl.h.
ns3::SPFVertex::SPFVertex | ( | ) |
Construct an empty ("uninitialized") SPFVertex (Shortest Path First Vertex).
Definition at line 48 of file global-route-manager-impl.cc.
References NS_LOG_FUNCTION_NOARGS.
ns3::SPFVertex::SPFVertex | ( | GlobalRoutingLSA * | lsa | ) |
Construct an initialized SPFVertex (Shortest Path First Vertex).
Definition at line 62 of file global-route-manager-impl.cc.
References ns3::GlobalRoutingLSA::GetLSType(), m_vertexType, ns3::GlobalRoutingLSA::NetworkLSA, NS_LOG_FUNCTION_NOARGS, NS_LOG_LOGIC, ns3::GlobalRoutingLSA::RouterLSA, VertexNetwork, and VertexRouter.
ns3::SPFVertex::~SPFVertex | ( | ) |
Destroy an SPFVertex (Shortest Path First Vertex).
Definition at line 85 of file global-route-manager-impl.cc.
References m_children, and NS_LOG_FUNCTION_NOARGS.
ns3::SPFVertex::SPFVertex | ( | SPFVertex & | v | ) | [private] |
The SPFVertex copy construction is disallowed. There's no need for it and a compiler provided shallow copy would be wrong.
uint32_t ns3::SPFVertex::AddChild | ( | SPFVertex * | child | ) |
Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex.
Definition at line 225 of file global-route-manager-impl.cc.
References m_children, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFVertexAddParent().
SPFVertex * ns3::SPFVertex::GetChild | ( | uint32_t | n | ) | const |
Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex.
Definition at line 206 of file global-route-manager-impl.cc.
References m_children, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFProcessStubs().
uint32_t ns3::SPFVertex::GetDistanceFromRoot | ( | void | ) | const |
Get the distance from the root vertex to "this" SPFVertex object.
Definition at line 150 of file global-route-manager-impl.cc.
References m_distanceFromRoot, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::CandidateQueue::Push(), ns3::GlobalRouteManagerImplTest::RunTests(), 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 136 of file global-route-manager-impl.cc.
References m_lsa, and NS_LOG_FUNCTION_NOARGS.
Referenced by 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.
Definition at line 199 of file global-route-manager-impl.cc.
References m_children, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRouteManagerImpl::SPFProcessStubs().
Ipv4Address ns3::SPFVertex::GetNextHop | ( | void | ) | const |
Get the IP address that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
Definition at line 178 of file global-route-manager-impl.cc.
References m_nextHop, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), ns3::GlobalRouteManagerImpl::SPFIntraAddTransit(), and ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().
uint32_t ns3::SPFVertex::GetOutgoingTypeId | ( | void | ) | const |
Get the interface ID that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
Definition at line 164 of file global-route-manager-impl.cc.
References m_rootOif, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), ns3::GlobalRouteManagerImpl::SPFIntraAddTransit(), and ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().
SPFVertex * ns3::SPFVertex::GetParent | ( | void | ) | const |
Get a pointer to the SPFVector that is the parent of "this" SPFVertex.
Definition at line 192 of file global-route-manager-impl.cc.
References m_parent, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation(), and ns3::GlobalRouteManagerImpl::SPFVertexAddParent().
Ipv4Address ns3::SPFVertex::GetVertexId | ( | void | ) | const |
Get the Vertex ID field of a SPFVertex object.
Definition at line 122 of file global-route-manager-impl.cc.
References m_vertexId, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::CandidateQueue::Find(), ns3::GlobalRouteManagerImpl::FindOutgoingTypeId(), 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.
Definition at line 108 of file global-route-manager-impl.cc.
References m_vertexType, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRouteManagerImpl::SPFNext(), ns3::GlobalRouteManagerImpl::SPFNexthopCalculation(), and ns3::GlobalRouteManagerImpl::SPFProcessStubs().
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 239 of file global-route-manager-impl.cc.
References m_vertexProcessed.
Referenced by ns3::GlobalRouteManagerImpl::SPFProcessStubs().
The SPFVertex copy assignment operator is disallowed. There's no need for it and a compiler provided shallow copy would be wrong.
void ns3::SPFVertex::SetDistanceFromRoot | ( | uint32_t | distance | ) |
Set the distance from the root vertex to "this" SPFVertex object.
Definition at line 143 of file global-route-manager-impl.cc.
References m_distanceFromRoot, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImplTest::RunTests(), 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.
Definition at line 129 of file global-route-manager-impl.cc.
References m_lsa, and NS_LOG_FUNCTION.
void ns3::SPFVertex::SetNextHop | ( | Ipv4Address | nextHop | ) |
Set the IP address that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
Definition at line 171 of file global-route-manager-impl.cc.
References m_nextHop, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().
void ns3::SPFVertex::SetOutgoingTypeId | ( | uint32_t | id | ) |
Set the interface ID that should be used to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
Definition at line 157 of file global-route-manager-impl.cc.
References m_rootOif, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().
void ns3::SPFVertex::SetParent | ( | SPFVertex * | parent | ) |
Set the pointer to the SPFVector that is the parent of "this" SPFVertex.
Definition at line 185 of file global-route-manager-impl.cc.
References m_parent, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFNexthopCalculation().
void ns3::SPFVertex::SetVertexId | ( | Ipv4Address | id | ) |
Set the Vertex ID field of a SPFVertex object.
Definition at line 115 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 233 of file global-route-manager-impl.cc.
References m_vertexProcessed.
Referenced by ns3::GlobalRouteManagerImpl::SPFProcessStubs().
void ns3::SPFVertex::SetVertexType | ( | SPFVertex::VertexType | type | ) |
Set the Vertex Type field of a SPFVertex object.
Definition at line 101 of file global-route-manager-impl.cc.
References m_vertexType, and NS_LOG_FUNCTION.
ListOfSPFVertex_t ns3::SPFVertex::m_children [private] |
Definition at line 576 of file global-route-manager-impl.h.
Referenced by AddChild(), GetChild(), GetNChildren(), and ~SPFVertex().
uint32_t ns3::SPFVertex::m_distanceFromRoot [private] |
Definition at line 571 of file global-route-manager-impl.h.
Referenced by GetDistanceFromRoot(), and SetDistanceFromRoot().
GlobalRoutingLSA* ns3::SPFVertex::m_lsa [private] |
Definition at line 570 of file global-route-manager-impl.h.
Ipv4Address ns3::SPFVertex::m_nextHop [private] |
Definition at line 573 of file global-route-manager-impl.h.
Referenced by GetNextHop(), and SetNextHop().
SPFVertex* ns3::SPFVertex::m_parent [private] |
Definition at line 574 of file global-route-manager-impl.h.
Referenced by GetParent(), and SetParent().
uint32_t ns3::SPFVertex::m_rootOif [private] |
Definition at line 572 of file global-route-manager-impl.h.
Referenced by GetOutgoingTypeId(), and SetOutgoingTypeId().
Ipv4Address ns3::SPFVertex::m_vertexId [private] |
Definition at line 569 of file global-route-manager-impl.h.
Referenced by GetVertexId(), and SetVertexId().
bool ns3::SPFVertex::m_vertexProcessed [private] |
Definition at line 577 of file global-route-manager-impl.h.
Referenced by IsVertexProcessed(), and SetVertexProcessed().
VertexType ns3::SPFVertex::m_vertexType [private] |
Definition at line 568 of file global-route-manager-impl.h.
Referenced by GetVertexType(), SetVertexType(), and SPFVertex().