OSPF Type 5 LSA

OSPF uses the Type5 external link LSAs to advertise external routes originated from an ASBR. They are flooded through the whole OSPF domain (at least into the parts where they are accepted) and point packets for those external addresses to the ASBR. There is a field called Forward Address within that Type5 LSA, which is usually set to 0.0.0.0 which means that the packets should be sent directly to the ASBR.

Have a look at the following drawing:

R2 is the ASBR for the OSPF Domain and advertises the Type5 LSAs for 99.99.1.0 and 116.1.124.0 to all routers. As you can see on R5, the field Forward Address is set to 0.0.0.0. The whole configuration for OSPF and EIGRP is plain default configuration and R2 is just redistributing EIGRP into OSPF. For testing purposes, R1 has set a default route to R2 so the OSPF domain is able to ping and traceroute to R1s interfaces.

R5#sh ip ospf data exter

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

 Type-5 AS External Link States

 Routing Bit Set on this LSA
 LS age: 1400
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 99.99.1.0 (External Network Number )
 Advertising Router: 99.99.2.2
 LS Seq Number: 80000002
 Checksum: 0x729A
 Length: 36
 Network Mask: /24
           Metric Type: 2 (Larger than any link state path)
           TOS: 0
           Metric: 20
           Forward Address: 0.0.0.0
           External Route Tag: 0

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

Given this is the normal case and you probably will not see something different often, but there is that special case where the Forward Address is set to something different than 0.0.0.0.

This is going to happen if OSPF includes the Interface on which the EIGRP neighborship connection is bound to:

R2#sh run | sec router ospf
router ospf 1
 log-adjacency-changes
 redistribute eigrp 100 subnets
 network 99.99.2.2 0.0.0.0 area 0
 network 116.1.23.2 0.0.0.0 area 0
 network 116.1.124.2 0.0.0.0 area 0

R2 is going to set 116.1.124.1 as Forward Address which means that every packet should be sent directly to R1, even though it does not change anything in that environment the packets will still go through R2. The Type 5 LSA for 116.1.124.0 disappeared and only R1s Loopback is now found as Type-5 LSA in R5s OSFP database:

R5#sh ip ospf data ext

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

 Type-5 AS External Link States

 Routing Bit Set on this LSA
 LS age: 9
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 99.99.1.0 (External Network Number )
 Advertising Router: 99.99.2.2
 LS Seq Number: 80000004
 Checksum: 0xDB3C
 Length: 36
 Network Mask: /24
           Metric Type: 2 (Larger than any link state path)
           TOS: 0
           Metric: 20
           Forward Address: 116.1.124.1
           External Route Tag: 0

R5#traceroute 99.99.1.1 numeric

Type escape sequence to abort.
Tracing the route to 99.99.1.1

 1 116.1.45.4 48 msec 12 msec 28 msec
 2 116.1.34.3 20 msec 52 msec 28 msec
 3 116.1.23.2 52 msec 52 msec 48 msec
 4 116.1.124.1 80 msec *  104 msec

That special case is mentioned in RFC2328 (OSPFv2) chapter 2.3 at page 25.

In short, this behavior was introduced to reduze the hop count to a specific external route. As already mentioned, in the above case, this will not change anything since R2 is the only connection to R1. But R5 will use R4 directly to reach R1,  if R4 gets a connection to the network 116.1.124.0/24 and OSPF is enabled on that interface. It doesnt matter in this case if R4 does have a Adjacency to R2 or not, which means its either a normal (adjacency to R2) or a passive-interface for OSPF.

OSPF has to be active on that interface (fa0/0 on R4) otherwise, R4 wont install the route to 99.99.1.0/24 in its routing table, even though it would advertise it to R5. The explanation to that behavior can be found in RFC2328 (OSPFv2) Chapter 16.4 Calculating AS external routes on page 174:

If the forwarding address is non-zero, look up the forwarding address in the routing table.The matching routing table entry must specify an intra-area or inter-area path; if no such path exists, do nothing with the LSA and consider the next in the list.

Even though, R4 does not have any adjacencies to R1, the packets from R5 to 99.99.1.1 will be sent from R4 directly to R1:

R5#traceroute 99.99.1.1 numeric

Type escape sequence to abort.
Tracing the route to 99.99.1.1

 1 116.1.45.4 36 msec 16 msec 36 msec
 2 116.1.124.1 52 msec *  36 msec
Advertisements

5 comments

  1. Mat

    Hi there,

    I was wondering if there is a need for OSPF to also run on R4 f0/0 int (and therefore have an OSPF adjacency with R2 over that link) ? Or will it work even without the adjacency?

    Cheers,
    Mat

  2. pashtuk

    Hi Mat
    Sorry for the real late answer to your question.
    R4 does not have to have an adjacency to R2, passive-interface on R4 would work to, but the interface has to be included into OSPF otherwise R4 wont install 99.99.1.0/24 in its routing table.

    I’ve updated the article to reflect that and also corrected a mistake in both drawings

  3. Tom

    In case of point-to-point links the FA will always be 0.0.0.0 regardless of the inclusion. Can anyone explain why in point to point links the FA will always be 0.0.0.0?

    Thanks, Tom…

    • pashtuk

      Hi Tom, there is no use for a FA adress on a PtP Link, there is only one other router on the link per definition. So something like the mentioned case above can not happen on a PtP Link

  4. meddane

    ,in point-to-point, the FA non-zero is not necessary because there’s only one router on the other side so one next hop and thus setting the FA to 0.0.0.0 is enough to tell to the others routers that to reach the external subnets ,you need just reach the ASBR (FA 0.0.0.0), in a broadcast type we can have more than 2 routers therefore we must specify what is the next hop that will be used to reach the external network and FA.

    You can see the following lab in my website:
    http://www.meddane.com/labs/ospf-protocol-routing/the-forwarding-address-and-path-selection.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s