The Link State DataBase (LSDB) of the Global Route Manager. More...
#include "global-route-manager-impl.h"
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... | |
GlobalRoutingLSA * | GetExtLSA (uint32_t index) const |
Look up the External Link State Advertisement associated with the given index. More... | |
GlobalRoutingLSA * | GetLSA (Ipv4Address addr) const |
Look up the Link State Advertisement associated with the given link state ID (address). More... | |
GlobalRoutingLSA * | GetLSAByLinkData (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... | |
GlobalRouteManagerLSDB & | operator= (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... | |
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.
|
private |
container of IPv4 addresses / Link State Advertisements
Definition at line 677 of file global-route-manager-impl.h.
|
private |
pair of IPv4 addresses / Link State Advertisements
Definition at line 679 of file global-route-manager-impl.h.
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.
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.
|
delete |
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.
index | the index associated with the LSA. |
Definition at line 479 of file global-route-manager-impl.cc.
References m_extdatabase, and NS_LOG_FUNCTION.
Referenced by ns3::GlobalRouteManagerImpl::SPFCalculate().
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.
addr | The IP address associated with the LSA. Typically the Router ID. |
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().
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.
addr | The IP address associated with the LSA. Typically the Router |
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().
uint32_t ns3::GlobalRouteManagerLSDB::GetNumExtLSAs | ( | ) | const |
Get 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().
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.
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().
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.
addr | The IP address associated with the LSA. Typically the Router ID. |
lsa | A 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().
|
delete |
|
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().
|
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().