cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1651
Views
16
Helpful
16
Replies

OSPFv3 cost of the loopback is not added to the metric.

Salah_IT_Nerd
Level 1
Level 1

Hello everyone, I'm having some trouble understanding how OSPFv6 calculates costs in IPv6.

Attached are screenshots of some show commands on both routers.

My question is: why OSPF is not adding the cost of the interface loopback to the metric.

Thank you!

Router1.png

 

Router2.png

Topology.png

16 Replies 16

@Salah_IT_Nerd  Regarding Why Cost of Loopbacks is not added to metric, I looked at original OSPFv2 is RFC2328 and New OSPFv3 IPv6 and v4 are in RFC 2740 and updated 5340. OSPFv3 has improved database calculation by changing LSA type 1 and 2 and adding LSA 8 and 9. In OSPFv3, Address info has been removed from Types 1 and 2; but added or moved to new Type 8,9 LSA.

RFC5340#section-4.4.3.9 says "If the interface type is point- to-multipoint or the interface is in the state Loopback, the global scope IPv6 addresses associated with the interface (if any) are copied into the intra-area-prefix-LSA with the PrefixOptions LA-bit set, the PrefixLength set to 128, and the metric set to 0. Otherwise, the list of global prefixes configured in RTX for the link are copied into the intra-area-prefix-LSA by specifying the PrefixLength, PrefixOptions, and Address Prefix fields. The Metric field for each of these prefixes is set to the interface's output cost.

This "metric 0" is also listed in OSPFv2, " Router-LSAs If the state of the interface is Loopback, add a Type 3 link (stub network) as long as this is not an interface to an unnumbered point-to-point network. The Link ID should be set to the IP interface address, the Link Data set to the mask 0xffffffff (indicating a host route), and the cost set to 0. (RFC2328#page-12, 12.4.1). Note that Cisco IOS does not follow this here, which brings me to next section.

Following is not included in OSPFv3 but exists in OSPFv2 section 9 " [ Loopback ] The interface will be unavailable for regular
data traffic. However, it may still be desirable to gain information on the quality of this interface, either through sending ICMP pings to the interface or through something like a bit error test. For this reason, IP packets may still be addressed to an interface in Loopback state. To facilitate this, such interfaces are advertised in router-LSAs as single host routes, whose destination is the IP interface address.[4] 

Further OSPFv2 Section C.7 "Host route parameters" mentioned that for such Host Routes "the actual configured cost in many cases is unimportant (i.e., will have no effect on routing).  This could be why they changed Loopback metric 0 to 1.

Regards, ML
**Please Rate All Helpful Responses **

Martin L
VIP
VIP

"why does OSPFv3 behave that way which is not the case with IPv4?" not exactly true! OSPFv3 IPv4 should behave exactly the same as IPV6 but not as OSPFv2 ipv4. 

Here is my example: R7 and R9 directly connected running both IPv4 and v6 over OSPFv3; R9 loopback settings and ipv4 route on R7 - Notice: cost of loopback0 is 10 not 11;

R9#sh run int l0
!
interface Loopback0
ip address 9.9.9.9 255.255.255.255
ipv6 address 2001:99::9/128
ipv6 address 2001:FEEE:EEE:99::9/64
ipv6 enable
ospfv3 1 ipv4 area 0
ospfv3 1 ipv6 area 0

R7#sh ip route ospfv3

9.0.0.0/32 is subnetted, 1 subnets
O 9.9.9.9 [110/10] via 10.0.79.9, 00:20:40, Ethernet0/0
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 10.0.19.0/24 [110/20] via 10.0.79.9, 00:30:15, Ethernet0/0
R7#

For IPv6 route Cost of loopback is also 10, not 11 as it is in OSPFv2

R7#sh ipv6 route ospf

O 2001:10::/64 [110/20]
via FE80::A8BB:CCFF:FE00:9000, Ethernet0/0
O 2001:99::9/128 [110/10]
via FE80::A8BB:CCFF:FE00:9000, Ethernet0/0
O 2001:FEEE:EEE:99::9/128 [110/10]
via FE80::A8BB:CCFF:FE00:9000, Ethernet0/0

Note that 2001:FEEE:EEE:99::9/64 show as /128 as ospf type is loopback; only after changing type loopcack to p2p, we get /64 with cost 11 (10+1) while 2001:99::9/128 stays with cost 10

R7#sh ipv6 route ospf

O 2001:99::9/128 [110/10]
via FE80::A8BB:CCFF:FE00:9000, Ethernet0/0
O 2001:FEEE:EEE:99::/64 [110/11]
via FE80::A8BB:CCFF:FE00:9000, Ethernet0/0

 

 

 

Review Cisco Networking for a $25 gift card