Thursday, December 6, 2012

Mysterious ospf LSA Type-4

Every one who are at this position of preparing for CCIE lab must know about all ospf LSA Types. However LSA Type-4 always remains mysterious and confusing for many of us. So let's discuss on this LSA Type.

Consider a small ospf domain for better understanding of this LSA.

-----RIP Domain -----R1----AREA0------R2------AREA1--------R3

Here R1 is an ASBR since it is redistributing RIP into OSPF, R2 is an ABR because both area 0 is attached to it. R3 is an internal router in area 1.

To need to understand LSA Type-5 we have to understand how a router perform lookup in order to reach to an external prefix.

When R1 performs redistribution from rip into ospf, R1generates an LSA Type-5 which contains external prefixes with it's attributes. In this LSA, R1 attachs in this LSA, its router-I'd in the advertising router field and forwarding address ( this may be 0.0.0.0 or any ip address depends on some parameters of the external link).
Now when a router in the same area in which ASBR is present like R2 performs few steps of recursive look up
First look is for external prefix I.e
Show ip ospf database external <> output of this command will contain the advertising router ip address and forward address along with other details.
If forwarder address field is a non zero value then further look up will perform on this address otherwise look up will perform on the advertising router field ip address which is R1's router I'd.

R2 will then search for this address in its ospf database
show ip ospf database router <R1's router-id>
since this router is in the same area so it will perform SPF calculation in order to reach R1 and ultimately to external prefix.

When an ABR i.e R2 pass on the LSA Type-5 to area 1 (LSA Tpye-5 are supposed to get flooded through out the ospf domain) it also generates an LSA Type-4 for area 1 in order to inform all the routers in area 1 that the external prefixes are advertised by the router address (ASBR) contained in the LSA Type-4. Since R2 the ABR forwarding this information to the internal routers in area 1 so they can contact R2 in order to reach to ASBR and ultimately the external prefixes.

Any internal router performs the first look up on external prefix

show ip ospf database external <> (assuming forwarder address field is 0.0.0.0) then look up will perform on advertising router ( R1's router-id ) appeared in this output.
Show ip ospf database router <R1's router-id >
this will not give any output because this router does not belong to this area 1. Therefore internal router will now have to perform look up on asbr
Show ip ospf database asbr-summary <>
this contains the advertising router as R2's router-id the ABR so further look ups will perform on this ABR in order to reach it.
Show ip ospf database router <ABR's router-id>
now internal router will do SPF calculation to reach to ABR in order to reach ABBR and ultimately to external prefixes.