A Discrete-Event Network Simulator
API
ns3::GlobalRouteManagerLSDB Class Reference

The Link State DataBase (LSDB) of the Global Route Manager. More...

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

+ Collaboration diagram for ns3::GlobalRouteManagerLSDB:

Public Member Functions

 GlobalRouteManagerLSDB ()
 Construct an empty Global Router Manager Link State Database. More...
 
 ~GlobalRouteManagerLSDB ()
 Destroy an empty Global Router Manager Link State Database. More...
 
GlobalRoutingLSAGetExtLSA (uint32_t index) const
 Look up the External Link State Advertisement associated with the given index. More...
 
GlobalRoutingLSAGetLSA (Ipv4Address addr) const
 Look up the Link State Advertisement associated with the given link state ID (address). More...
 
GlobalRoutingLSAGetLSAByLinkData (Ipv4Address addr) const
 Look up the Link State Advertisement associated with the given link state ID (address). More...
 
uint32_t GetNumExtLSAs () const
 Get the number of External Link State Advertisements. More...
 
void Initialize ()
 Set all LSA flags to an initialized state, for SPF computation. More...
 
void Insert (Ipv4Address addr, GlobalRoutingLSA *lsa)
 Insert an IP address / Link State Advertisement pair into the Link State Database. More...
 

Private Types

typedef std::map< Ipv4Address, GlobalRoutingLSA * > LSDBMap_t
 container of IPv4 addresses / Link State Advertisements More...
 
typedef std::pair< Ipv4Address, GlobalRoutingLSA * > LSDBPair_t
 pair of IPv4 addresses / Link State Advertisements More...
 

Private Member Functions

 GlobalRouteManagerLSDB (GlobalRouteManagerLSDB &lsdb)
 GlobalRouteManagerLSDB copy construction is disallowed. More...
 
GlobalRouteManagerLSDBoperator= (GlobalRouteManagerLSDB &lsdb)
 The SPFVertex copy assignment operator is disallowed. More...
 

Private Attributes

LSDBMap_t m_database
 database of IPv4 addresses / Link State Advertisements More...
 
std::vector< GlobalRoutingLSA * > m_extdatabase
 database of External Link State Advertisements More...
 

Detailed Description

The Link State DataBase (LSDB) of the Global Route Manager.

Each node in the simulation participating in global routing has a GlobalRouter interface. The primary job of this interface is to export Global Router Link State Advertisements (LSAs). These advertisements in turn contain a number of Global Router Link Records that describe the point to point links from the underlying node to other nodes (that will also export their own LSAs.

This class implements a searchable database of LSAs gathered from every router in the simulation.

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

Member Typedef Documentation

container of IPv4 addresses / Link State Advertisements

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

pair of IPv4 addresses / Link State Advertisements

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

Constructor & Destructor Documentation

ns3::GlobalRouteManagerLSDB::GlobalRouteManagerLSDB ( )

Construct an empty Global Router Manager Link State Database.

The database map composing the Link State Database is initialized in this constructor.

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

References NS_LOG_FUNCTION.

ns3::GlobalRouteManagerLSDB::~GlobalRouteManagerLSDB ( )

Destroy an empty Global Router Manager Link State Database.

The database map is walked and all of the Link State Advertisements stored in the database are freed; then the database map itself is clear ()ed to release any remaining resources.

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

References m_database, m_extdatabase, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

ns3::GlobalRouteManagerLSDB::GlobalRouteManagerLSDB ( GlobalRouteManagerLSDB lsdb)
private

GlobalRouteManagerLSDB copy construction is disallowed.

There's no need for it and a compiler provided shallow copy would be wrong.

Parameters
lsdbobject to copy from

Member Function Documentation

GlobalRoutingLSA * ns3::GlobalRouteManagerLSDB::GetExtLSA ( uint32_t  index) const

Look up the External Link State Advertisement associated with the given index.

The external database map is searched for the given index and corresponding GlobalRoutingLSA is returned.

See also
GlobalRoutingLSA
Parameters
indexthe index associated with the LSA.
Returns
A pointer to the Link State Advertisement.

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

References m_extdatabase, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

GlobalRoutingLSA * ns3::GlobalRouteManagerLSDB::GetLSA ( Ipv4Address  addr) const

Look up the Link State Advertisement associated with the given link state ID (address).

The database map is searched for the given IPV4 address and corresponding GlobalRoutingLSA is returned.

See also
GlobalRoutingLSA
Ipv4Address
Parameters
addrThe IP address associated with the LSA. Typically the Router ID.
Returns
A pointer to the Link State Advertisement for the router specified by the IP address addr.

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

References m_database, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

GlobalRoutingLSA * ns3::GlobalRouteManagerLSDB::GetLSAByLinkData ( Ipv4Address  addr) const

Look up the Link State Advertisement associated with the given link state ID (address).

This is a variation of the GetLSA call to allow the LSA to be found by matching addr with the LinkData field of the TransitNetwork link record.

See also
GetLSA
Parameters
addrThe IP address associated with the LSA. Typically the Router
Returns
A pointer to the Link State Advertisement for the router specified by the IP address addr. ID.

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

References ns3::GlobalRoutingLinkRecord::GetLinkData(), ns3::GlobalRoutingLSA::GetLinkRecord(), ns3::GlobalRoutingLinkRecord::GetLinkType(), ns3::GlobalRoutingLSA::GetNLinkRecords(), m_database, NS_LOG_FUNCTION, and ns3::GlobalRoutingLinkRecord::TransitNetwork.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::GlobalRouteManagerLSDB::GetNumExtLSAs ( ) const

Get the number of External Link State Advertisements.

See also
GlobalRoutingLSA
Returns
the number of External Link State Advertisements.

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

References m_extdatabase, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

void ns3::GlobalRouteManagerLSDB::Initialize ( void  )

Set all LSA flags to an initialized state, for SPF computation.

This function walks the database and resets the status flags of all of the contained Link State Advertisements to LSA_SPF_NOT_EXPLORED. This is done prior to each SPF calculation to reset the state of the SPFVertex structures that will reference the LSAs during the calculation.

See also
GlobalRoutingLSA
SPFVertex

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

References ns3::GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED, m_database, NS_LOG_FUNCTION, and ns3::GlobalRoutingLSA::SetStatus().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::GlobalRouteManagerLSDB::Insert ( Ipv4Address  addr,
GlobalRoutingLSA lsa 
)

Insert an IP address / Link State Advertisement pair into the Link State Database.

The IPV4 address and the GlobalRoutingLSA given as parameters are converted to an STL pair and are inserted into the database map.

See also
GlobalRoutingLSA
Ipv4Address
Parameters
addrThe IP address associated with the LSA. Typically the Router ID.
lsaA pointer to the Link State Advertisement for the router.

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

References ns3::GlobalRoutingLSA::ASExternalLSAs, ns3::GlobalRoutingLSA::GetLSType(), m_database, m_extdatabase, and NS_LOG_FUNCTION.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GlobalRouteManagerLSDB& ns3::GlobalRouteManagerLSDB::operator= ( GlobalRouteManagerLSDB lsdb)
private

The SPFVertex copy assignment operator is disallowed.

There's no need for it and a compiler provided shallow copy would be wrong.

Parameters
lsdbobject to copy from
Returns
the copied object

Member Data Documentation

LSDBMap_t ns3::GlobalRouteManagerLSDB::m_database
private

database of IPv4 addresses / Link State Advertisements

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

Referenced by GetLSA(), GetLSAByLinkData(), Initialize(), Insert(), and ~GlobalRouteManagerLSDB().

std::vector<GlobalRoutingLSA*> ns3::GlobalRouteManagerLSDB::m_extdatabase
private

database of External Link State Advertisements

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

Referenced by GetExtLSA(), GetNumExtLSAs(), Insert(), and ~GlobalRouteManagerLSDB().


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