cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4336
Views
15
Helpful
17
Replies

OSPF Forward Metric question

Good day.

Please review topology used:

R1 and R3 - both ASBRs and redistributes information about connected networks 11.11.11.0/24 and 33.33.33.0/24. AREA1 is NSSA Area.

Both interfaces on R2 in directions to R1 and R3 have cost of 10. But take a look at R2 output:

R2#sh ip route 11.11.11.0
Routing entry for 11.11.11.0/24
  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
  Last update from 192.168.12.1 on FastEthernet0/0, 00:00:06 ago
  Routing Descriptor Blocks:
  * 192.168.12.1, from 1.1.1.1, 00:00:06 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1

R2#sh ip route 33.33.33.0
Routing entry for 33.33.33.0/24
  Known via "ospf 1", distance 110, metric 20, type NSSA extern 2, forward metric 11
  Last update from 192.168.23.3 on FastEthernet0/1, 00:00:58 ago
  Routing Descriptor Blocks:
  * 192.168.23.3, from 3.3.3.3, 00:00:58 ago, via FastEthernet0/1
      Route metric is 20, traffic share count is 1

Forward metric to route from NSSA area is 11!

Lets check boundary routers output

R2#sh ip ospf border-routers

OSPF Process 1 internal Routing Table

Codes: i - Intra-area route, I - Inter-area route

i 1.1.1.1 [10] via 192.168.12.1, FastEthernet0/0, ASBR, Area 0, SPF 8
i 3.3.3.3 [10] via 192.168.23.3, FastEthernet0/1, ASBR, Area 1, SPF 6

Cost to both ASBRs same.  But why is forward metric different? Obviously this is somehow connected to NSSA but i cant find place where this is described. Can somebody point me where I can find description of this behaviour? At RFC 3101 I found nothing about this.

1 Accepted Solution

Accepted Solutions

Hm, I guess 3.3.3.3 is R3's Loopback interface?

And the next-hop of the static route on R3 is the loopback interface?

R3#show ip route static
     33.0.0.0/24 is subnetted, 1 subnets
S       33.33.33.0 is directly connected, Loopback0

R3#show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0          1     1               3.3.3.3/32         1     LOOP  0/0
(...)

That's  how R2 calculates the forward metric: R2's outgoing interface cost (10) + R3's next-hop interface cost (1) = 11

A 'show ip route 3.3.3.3' should show the same metric.

You can change R3's loopback cost and/or R2's Fa0/1 - the forward metric should always be the sum of both.

View solution in original post

17 Replies 17

Hello,

On which router did you set IP ospf cost?

On none indeed =)

Rolf Fischer
Level 9
Level 9

Hi Alexey,

the (internal) cost of an OSPF external route is evaluated first by the examination of the Forwarding Address (FA) field of the Type-5 LSA or, in the case of a NSSA, the Type-7 LSA.

Only if the FA is set to 0.0.0.0 the router will evaluate the path to the ASBR for the internal cost calculation.

For Type-5 LSAs, certain conditions must be met in order to set the FA to an non-zero value: Common Routing Problem with OSPF Forwarding Address

So normally we don't see very often Type-5 LSAs with the FA set to non-zero values.

This is different inside a NSSA; here, Type-7 LSAs with non-zero FAs are not the exeption, but the rule (see RFC 3101 2.3ff).

You can see the content of the FA fields with 'show ip ospf database {external | nssa-external}', with the (non-zero) FA IP-address you'll need to do a routing-table lookup.

Feel free to ask further!

HTH

Rolf

I'm not so sure, what you wrote abiut FA is correct but R3 use it's wond address as FA, so R2 make a lookup and find it is directly connected and use interf cost as metric. I made a little lab in GNS and in my lab and the to route has extaly the same forward metric. See attachment.

Alexey could you post a sh ip ospf interf ?

Enrico

Enrico,

thanks for your comment.

I simplified some things in my first post, you know  it can be painful to dive into the details of OSPF ;-)

so R2 make a lookup and find it is directly connected and use interf cost as metric

I guess you applied the static route to the null interface on R3 or the exit-interface isn't OSPF enabled?

When an OSPF internal route for the next-hop address of the static route exists, the FA should be set to that next-hop address, and the forward-metric (internal part of OSPF cost) should be equal to the metric of the OSPF route to the FA network.

Rolf

Hi Rolf,

ou're right. I forgot this OSPF trick. In any case we have to suppose that Alexey's config has some difference  between R1 and R3 otherwise thay should have the same matric, inst'it ?

In the draft,  both routers have inteface to external network outside OSPF domain but he may accidently put R3 interface in OSPF.

E

we have to suppose that Alexey's config has some difference

The only difference is  area 1 nssa command, and  if i delete this command the output becomes more predictible

R2#sh ip route 11.11.11.0
Routing entry for 11.11.11.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
Last update from 192.168.12.1 on FastEthernet0/0, 00:01:09 ago
Routing Descriptor Blocks:
* 192.168.12.1, from 11.11.11.11, 00:01:09 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1

R2#sh ip route 33.33.33.0
Routing entry for 33.33.33.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
Last update from 192.168.23.3 on FastEthernet0/1, 00:01:11 ago
Routing Descriptor Blocks:
* 192.168.23.3, from 3.3.3.3, 00:01:11 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1


You would see the same behaviour in a regular area when the FA of the Type-5 LSA was set to a non-zero value.

But to achieve that, you'd have to redistribute a static route with a next-hop reachable through an multi-access interface which is (non-passive) OSPF enabled.

With a Loopback interface as next-hop this is not possible.

To demonstrate this, I've added an FastEth interface on R1 and changed the static route like this:

R1#show ip ospf int br
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Fa1/0        1     0               192.168.1.1/24     1     DR    0/0
Fa0/0        1     0               192.168.12.1/24    1     DR    1/1

R1#show ip route static
     11.0.0.0/24 is subnetted, 1 subnets
S       11.11.11.0 [1/0] via 192.168.1.2

R2#show ip ospf database external

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 122
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 11.11.11.0 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000003
  Checksum: 0x2DE9
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 10
        Forward Address: 192.168.1.2
        External Route Tag: 0


R2#show ip route 192.168.1.2
Routing entry for 192.168.1.0/24
  Known via "ospf 1", distance 110, metric 11, type intra area
  Last update from 192.168.12.1 on FastEthernet0/0, 00:00:11 ago
  Routing Descriptor Blocks:
  * 192.168.12.1, from 1.1.1.1, 00:00:11 ago, via FastEthernet0/0
      Route metric is 11, traffic share count is 1

R2#show ip route 11.11.11.11
Routing entry for 11.11.11.0/24
  Known via "ospf 1", distance 110, metric 10, type extern 2, forward metric 11
  Last update from 192.168.12.1 on FastEthernet0/0, 00:00:38 ago
  Routing Descriptor Blocks:
  * 192.168.12.1, from 1.1.1.1, 00:00:38 ago, via FastEthernet0/0
      Route metric is 10, traffic share count is 1

With Type5 it seems obvious, but with redistributed loopback as to me there are a couple of differencies. Nevertheless it seems that behaviour is the same

Here you are

R2#sh ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Lo0 1 0 2.2.2.2/32 1 LOOP 0/0
Fa0/0 1 0 192.168.12.2/29 10 P2P 1/1
Fa0/1 1 1 192.168.23.2/29 10 P2P 1/1

BTW based on your output with same Forward metric Im not sure now - maybe i hit some bag instead of feature ^^

Can you please tell your IOS version and how had you done redistribution - via redustribute connected?

Hi Rolf, 

In this particular case Forwarding address is the same with ASBR (R3) address - there is no other ABR`s between R2 and R3.

R2#sh ip ospf database nssa-external

OSPF Router with ID (2.2.2.2) (Process ID 1)

Type-7 AS External Link States (Area 1)

Routing Bit Set on this LSA
LS age: 14
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 33.33.33.0 (External Network Number )
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0xE634
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 3.3.3.3
External Route Tag: 0


Hm, I guess 3.3.3.3 is R3's Loopback interface?

And the next-hop of the static route on R3 is the loopback interface?

R3#show ip route static
     33.0.0.0/24 is subnetted, 1 subnets
S       33.33.33.0 is directly connected, Loopback0

R3#show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0          1     1               3.3.3.3/32         1     LOOP  0/0
(...)

That's  how R2 calculates the forward metric: R2's outgoing interface cost (10) + R3's next-hop interface cost (1) = 11

A 'show ip route 3.3.3.3' should show the same metric.

You can change R3's loopback cost and/or R2's Fa0/1 - the forward metric should always be the sum of both.

Hi Rolf, 

Thank you for helping! I appreciate you intent to help me figure out the cause of this behaviour. 

You are right its loopback as well as 33.33.33.0. So there is no static route - I redistributed connected. And because fact that this is Type 2 route it have nothing to do with loopbacks cost.

And because fact that this is Type 2 route it have nothing to do with loopbacks cost.

Type 2 means that only the external part of the cost is used for the metric of the route.

But he internal part (forward metric) will be compared when more than one E2 external LSA for the same prefix and with the same external metric exist. The one with the lower internal cost will be installed in the routing table in such a case.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card