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 (const GlobalRouteManagerLSDB &)=delete
 
 ~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...
 
GlobalRouteManagerLSDBoperator= (const GlobalRouteManagerLSDB &)=delete
 

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 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 574 of file global-route-manager-impl.h.

Member Typedef Documentation

◆ LSDBMap_t

container of IPv4 addresses / Link State Advertisements

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

◆ LSDBPair_t

pair of IPv4 addresses / Link State Advertisements

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

Constructor & Destructor Documentation

◆ GlobalRouteManagerLSDB() [1/2]

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 427 of file global-route-manager-impl.cc.

References NS_LOG_FUNCTION.

◆ ~GlobalRouteManagerLSDB()

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 434 of file global-route-manager-impl.cc.

References m_database, m_extdatabase, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ GlobalRouteManagerLSDB() [2/2]

ns3::GlobalRouteManagerLSDB::GlobalRouteManagerLSDB ( const GlobalRouteManagerLSDB )
delete

Member Function Documentation

◆ GetExtLSA()

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 479 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:

◆ GetLSA()

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 493 of file global-route-manager-impl.cc.

References m_database, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ GetLSAByLinkData()

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:

◆ GetNumExtLSAs()

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 486 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:

◆ Initialize()

void ns3::GlobalRouteManagerLSDB::Initialize ( )

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 454 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:

◆ Insert()

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 465 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().

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

◆ operator=()

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

Member Data Documentation

◆ m_database

LSDBMap_t ns3::GlobalRouteManagerLSDB::m_database
private

database of IPv4 addresses / Link State Advertisements

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

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

◆ m_extdatabase

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 ~GlobalRouteManagerLSDB(), GetExtLSA(), GetNumExtLSAs(), and Insert().


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