12-29-2012 10:39 AM - edited 03-07-2019 10:49 AM
Hi Experts,
Can you please tel me the difference between Lsa 4 and Lsa 5 in OSPF.. would be great if you explain with an example as it would be easy for me to understand it.
Thanks in advance
Srikanth
12-29-2012 11:29 AM
Hello Srikanth,
Assume the following topology of three routers:
R1 --- Area 0 --- R2 --- Area 1 --- R3
R1 and R2 are in Area 0, R2 and R3 are in Area 1. R2 is redistributing the route 2.0.0.0/8, R3 is redistributing the 3.0.0.0/8. We will be looking at the LSDB on R1. R1's RID is 1.1.1.1, R2's RID is 2.2.2.2, R3's RID is 3.3.3.3. The R2 is an ABR. R2 and R3 are ASBRs.
Currently, the R1's routing table looks like this:
R1(config-if)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
O E2 2.0.0.0/8 [110/20] via 10.0.12.2, 00:02:58, Serial1/0
O E2 3.0.0.0/8 [110/20] via 10.0.12.2, 00:02:34, Serial1/0
10.0.0.0/24 is subnetted, 2 subnets
C 10.0.12.0 is directly connected, Serial1/0
O IA 10.0.23.0 [110/128] via 10.0.12.2, 00:03:39, Serial1/0
R1(config-if)#
The LSA-5 is easier to explain. LSA-5 carry information about external networks themselves, i.e. the IP address and netmask of a redistributed route. In addition, the Advertising Router field of this LSA-5 tells you through which ASBR the packets need to flow to reach this external network.
Let us first look at the 2.0.0.0/8 route that is injected into OSPF on R2. R1 and R2 are both in the same Area 0. The LSDB on R1 contains the following LSA-5:
R1(config-if)#do show ip ospf database external 2.0.0.0
OSPF Router with ID (1.1.1.1) (Process ID 1)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 241
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 2.0.0.0 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x9105
Length: 36
Network Mask: /8
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
Note that this LSA-5 is originated by R2 (the RID of 2.2.2.2). This tells you that in order to reach the network described in this LSA-5, namely 2.0.0.0/8, you must route your packets through the ASBR with the RID of 2.2.2.2. Because this router is in the same area as R1, we definitely know its exact location as we know its LSA-1:
R1(config-if)#do show ip ospf database router 2.2.2.2
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
Routing Bit Set on this LSA
LS age: 377
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 80000003
Checksum: 0xB7A5
Length: 48
Area Border Router
AS Boundary Router
Number of Links: 2
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 1.1.1.1
(Link Data) Router Interface address: 10.0.12.2
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.0.12.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
Here, the LSA-5 carries the information about the external network 2.0.0.0/8, and we know what is the ASBR towards this network - it is the router with RID of 2.2.2.2 and we know who that router is.
Let us have a look at the LSA-5 describing the external network 3.0.0.0/8:
R1(config-if)#do show ip ospf database external 3.0.0.0
OSPF Router with ID (1.1.1.1) (Process ID 1)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 443
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 3.0.0.0 (External Network Number )
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x662B
Length: 36
Network Mask: /8
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
Here, the advertising router is 3.3.3.3 (R3), so in order to reach this external network, we need to route such packets towards the ASBR with the RID of 3.3.3.3. However, from the viewpoint of R1, the R3 is in a different area and we know nothing about it:
R1(config-if)#do show ip ospf database router 3.3.3.3
OSPF Router with ID (1.1.1.1) (Process ID 1)
R1(config-if)#
That would mean, however, that we do not know how to reach it!
Fortunately, things are not that bad. Because R3 is outside Area 0, the route from R1 towards the network 3.0.0.0/8 must first leave the Area 0 through a proper ABR to the area that contains the ASBR R3, and afterwards, it needs to flow through the ASBR R3. The fact that this external network is behind 3.3.3.3 is already known thanks to LSA-5. However, we still need to know through which ABR (as we may have many) we need to go in order to actually reach this ASBR. This is where LSA-4 comes into play. LSA-4 is generated by an ABR that is connected an area holding an ASBR. In this case, Area 1 contains the R3, 3.3.3.3, as an ASBR. R2 knows this and injects an LSA-4 into Area 0 that describes the ASBR 3.3.3.3 and the distance of R2 towards this ASBR of 3.3.3.3. Let's see the details:
R1(config-if)#do show ip ospf database asbr 3.3.3.3
OSPF Router with ID (1.1.1.1) (Process ID 1)
Summary ASB Link States (Area 0)
Routing Bit Set on this LSA
LS age: 994
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(AS Boundary Router)
Link State ID: 3.3.3.3 (AS Boundary Router address)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x37B0
Length: 28
Network Mask: /0
TOS: 0 Metric: 64
Watch closely the information in this LSA-4. We know that it describes the ASBR with the RID of 3.3.3.3 (the Link State ID). Furthermore, we know that this LSA-4 was generated (advertised) by 2.2.2.2 - the R2 which is already in Area 0 and we know its exact location as we know its LSA-1 just like above. So what this tells us is that if any LSA-5 refers to the ASBR 3.3.3.3, we know that in order to reach it, we first must guide our packets through 2.2.2.2.
In other words, the LSA-4 allows you to know about ASBRs that are in other areas than your own. Thanks to LSA-4, you know which ABR you can use to reach that ASBR.
So to put it together: an LSA-5 informs you about the external route itself, and about the ASBR through which this network can be reached. If the ASBR is in your own area, you immediately know the path towards it, so for ASBRs in your own areas, no more information is needed, as everything is readily available. However, if the LSA-5 is generated by an ASBR in a different area, you need to know through which ABR you need to route your packets so that they can reach the appropriate ASBR and proceed to the external network. This missing piece of puzzle is the LSA-4 by which you know which ABR can be used to reach the appropriate ASBR.
Please feel welcome to ask further!
Best regards,
Peter
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide