ns-3
|
A single link record for a link state advertisement. More...
#include <global-router-interface.h>
Public Types | |
enum | LinkType { Unknown = 0, PointToPoint, TransitNetwork, StubNetwork, VirtualLink } |
Enumeration of the possible types of Global Routing Link Records. More... | |
Public Member Functions | |
GlobalRoutingLinkRecord () | |
Construct an empty ("uninitialized") Global Routing Link Record. | |
GlobalRoutingLinkRecord (LinkType linkType, Ipv4Address linkId, Ipv4Address linkData, uint16_t metric) | |
~GlobalRoutingLinkRecord () | |
Destroy a Global Routing Link Record. | |
Ipv4Address | GetLinkId (void) const |
void | SetLinkId (Ipv4Address addr) |
Set the Link ID field of the Global Routing Link Record. | |
Ipv4Address | GetLinkData (void) const |
Get the Link Data field of the Global Routing Link Record. | |
void | SetLinkData (Ipv4Address addr) |
Set the Link Data field of the Global Routing Link Record. | |
LinkType | GetLinkType (void) const |
Get the Link Type field of the Global Routing Link Record. | |
void | SetLinkType (LinkType linkType) |
Set the Link Type field of the Global Routing Link Record. | |
uint16_t | GetMetric (void) const |
Get the Metric Data field of the Global Routing Link Record. | |
void | SetMetric (uint16_t metric) |
Set the Metric Data field of the Global Routing Link Record. | |
Friends | |
class | GlobalRoutingLSA |
A single link record for a link state advertisement.
The GlobalRoutingLinkRecord is modeled after the OSPF link record field of a Link State Advertisement. Right now we will only see two types of link records corresponding to a stub network and a point-to-point link (channel).
Enumeration of the possible types of Global Routing Link Records.
These values are defined in the OSPF spec. We currently only use PointToPoint and StubNetwork types.
Construct an empty ("uninitialized") Global Routing Link Record.
The Link ID and Link Data Ipv4 addresses are set to "0.0.0.0"; The Link Type is set to Unknown; The metric is set to 0.
References NS_LOG_FUNCTION_NOARGS.
ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord | ( | LinkType | linkType, |
Ipv4Address | linkId, | ||
Ipv4Address | linkData, | ||
uint16_t | metric | ||
) |
Construct an initialized Global Routing Link Record.
linkType | The type of link record to construct. |
linkId | The link ID for the record. |
linkData | The link data field for the record. |
metric | The metric field for the record. |
References NS_LOG_FUNCTION.
Destroy a Global Routing Link Record.
Currently does nothing. Here as a placeholder only.
References NS_LOG_FUNCTION_NOARGS.
Ipv4Address ns3::GlobalRoutingLinkRecord::GetLinkData | ( | void | ) | const |
Get the Link Data field of the Global Routing Link Record.
For an OSPF type 1 link (PointToPoint) the Link Data will be the IP address of the node of the local side of the link.
For an OSPF type 3 link (StubNetwork), the Link Data will be the network mask
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRoutingLSA::CopyLinkRecords(), and ns3::GlobalRouteManagerLSDB::GetLSAByLinkData().
Ipv4Address ns3::GlobalRoutingLinkRecord::GetLinkId | ( | void | ) | const |
Get the Link ID field of the Global Routing Link Record.
For an OSPF type 1 link (PointToPoint) the Link ID will be the Router ID of the neighboring router.
For an OSPF type 3 link (StubNetwork), the Link ID will be the adjacent neighbor's IP address
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRoutingLSA::CopyLinkRecords().
Get the Link Type field of the Global Routing Link Record.
The Link Type describes the kind of link a given record represents. The values are defined by OSPF.
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRoutingLSA::CopyLinkRecords(), and ns3::GlobalRouteManagerLSDB::GetLSAByLinkData().
uint16_t ns3::GlobalRoutingLinkRecord::GetMetric | ( | void | ) | const |
Get the Metric Data field of the Global Routing Link Record.
The metric is an abstract cost associated with forwarding a packet across a link. A sum of metrics must have a well-defined meaning. That is, you shouldn't use bandwidth as a metric (how does the sum of the bandwidth of two hops relate to the cost of sending a packet); rather you should use something like delay.
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRoutingLSA::CopyLinkRecords().
void ns3::GlobalRoutingLinkRecord::SetLinkData | ( | Ipv4Address | addr | ) |
Set the Link Data field of the Global Routing Link Record.
For an OSPF type 1 link (PointToPoint) the Link Data must be the IP address of the node of the local side of the link.
For an OSPF type 3 link (StubNetwork), the Link Data must be set to the network mask
addr | An Ipv4Address to store in the Link Data field of the record. |
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRoutingLSA::CopyLinkRecords().
void ns3::GlobalRoutingLinkRecord::SetLinkId | ( | Ipv4Address | addr | ) |
Set the Link ID field of the Global Routing Link Record.
For an OSPF type 1 link (PointToPoint) the Link ID must be the Router ID of the neighboring router.
For an OSPF type 3 link (StubNetwork), the Link ID must be the adjacent neighbor's IP address
addr | An Ipv4Address to store in the Link ID field of the record. |
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRoutingLSA::CopyLinkRecords().
Set the Link Type field of the Global Routing Link Record.
The Link Type describes the kind of link a given record represents. The values are defined by OSPF.
linkType | The new LinkType for the current Global Routing Link Record. |
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRoutingLSA::CopyLinkRecords().
void ns3::GlobalRoutingLinkRecord::SetMetric | ( | uint16_t | metric | ) |
Set the Metric Data field of the Global Routing Link Record.
The metric is an abstract cost associated with forwarding a packet across a link. A sum of metrics must have a well-defined meaning. That is, you shouldn't use bandwidth as a metric (how does the sum of the bandwidth of two hops relate to the cost of sending a packet); rather you should use something like delay.
metric | The new metric for the current Global Routing Link Record. |
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::GlobalRoutingLSA::CopyLinkRecords().