In this article, I will take a look into OSPF database on Junos and see what kind of information I can dig out for External and ASBR Summary LSAs, which are crucial for the propagation of external (exported) routes in OSPF.
This article is a part of an article series “OSPF Database on Junos”. Here are the links to other articles. Please note that not all may be available right now.
The following diagram shows the network we’re working on. Please note that the original introduction was created using a home-made emulator, while for the remainder of the series, I used Junosphere.

policy-statement INJECT {
from protocol static;
then {
metric 10;
accept;
}
}
We’ll start on R4 this time. Let’s see how this external route is being injected into the OSPF.
R4:
markom@R4> show ospf database external detail
OSPF AS SCOPE link state database
Type ID Adv Rtr Seq Age Opt Cksum Len
Extern *10.0.0.0 4.4.4.4 0x80000009 193 0x22 0x5a2c 36
mask 255.255.255.0
Topology default (ID 0)
Type: 2, Metric: 10, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
We can see all the important information is there. The route is Type 2, with the metric of 10. Another thing to observe is all-zero forwarding address. This will become more important later when we examine NSSA external routes.
Let’s take a look at the same LSA on R1.
R1:
markom@R1>show route 10.0.0.4 terseinet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both A Destination P Prf Metric 1 Metric 2 Next hop AS path * 10.0.0.0/24 O 150 10 >192.168.14.4 markom@R1>show ospf database external detailOSPF AS SCOPE link state database Type ID Adv Rtr Seq Age Opt Cksum Len Extern 10.0.0.0 4.4.4.4 0x80000009 452 0x22 0x5a2c 36 mask 255.255.255.0 Topology default (ID 0) Type: 2, Metric: 10, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
The external LSA is clearly identical, as expected to the one on R4, since External LSAs have a flooding scope of the entire AS. The routing table also shows that the metric remains 10. This is an expected behavior for Type 2 external routers, where only external cost is taken into account. This part also illustrates a minor difference in behavior when compared to Cisco IOS, which will actually only consider external metric, but it will also display the cost to reach ASBR. As far as I can tell, we can’t easily find this information in Junos, but that’s not of much importance. Of course, if we want to take external and internal cost into consideration, we should change the route to Type 1.
R4:
[edit]
markom@R4# set policy-options policy-statement INJECT then external type 1
Let’s take a look at our external LSA on R1 now.
R1:
markom@R1>show route 10/24 terseinet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both A Destination P Prf Metric 1 Metric 2 Next hop AS path * 10.0.0.0/24 O 150 11 >192.168.14.4 markom@R1>show ospf database external detailOSPF AS SCOPE link state database Type ID Adv Rtr Seq Age Opt Cksum Len Extern 10.0.0.0 4.4.4.4 0x8000000a 443 0x22 0xd431 36 mask 255.255.255.0 Topology default (ID 0) Type: 1, Metric: 10, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
We can see that the type of route has changed in the LSA, but more importantly, we can now see that the metric has changed to 11. R1 has added its own cost to reach R4 to the cost of the external route. So far so good, but how do this LSA and the route look like on R3, which happens to be in area 0, unlike R4? Let’s take a look.
R3:
markom@R3>show ospf database external detailOSPF AS SCOPE link state database Type ID Adv Rtr Seq Age Opt Cksum Len Extern 10.0.0.0 4.4.4.4 0x8000000a 579 0x22 0xd431 36 mask 255.255.255.0 Topology default (ID 0) Type: 1, Metric: 10, Fwd addr: 0.0.0.0, Tag: 0.0.0.0 markom@R3>show route terse 10/24inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both A Destination P Prf Metric 1 Metric 2 Next hop AS path * 10.0.0.0/24 O 150 12 >192.168.13.1
We can see the LSA is unchanged and the route is in the routing table. But how, when the original LSA has been originated by R4, which is clearly seen in the database? R3 is not supposed to know about the RID of R4. That’s where Type 4 LSA comes into play. The purpose of this LSA, generated by the ABRs is to provide the ASBR information to routers in adjacent areas. Let’s take a look at the contents of this LSA.
R3:
markom@R3> show ospf database asbrsummary detail
OSPF database, Area 0.0.0.0
Type ID Adv Rtr Seq Age Opt Cksum Len
ASBRSum 4.4.4.4 1.1.1.1 0x80000005 1887 0x22 0xa67c 28
mask 0.0.0.0
Topology default (ID 0) -> Metric: 1
OSPF database, Area 0.0.0.23
Type ID Adv Rtr Seq Age Opt Cksum Len
ASBRSum *4.4.4.4 3.3.3.3 0x80000005 614 0x22 0x74a5 28
mask 0.0.0.0
Topology default (ID 0) -> Metric: 2
R3 is ABR for area 23 and this is why it has two Type 4 LSAs in the database. First one, generated by R1 and injected into area 0 helps R3 reach R4. Take a look at the metric advertised there – it’s 1. If you remember the cost for the external route, it was 10+1=11. On R3, the cost is 12. Take a look at the LSA generated by R3 – it specifies the cost 2 to reach 4.4.4.4, which is exactly right! R2 will have this identical Type 4 in its database, as well as AS-scope Type 5. Using the combined information, it will determine the total cost to 10.0.0.0/24 to be 13. Let’s take a look.
R2:
markom@R2>show route 10/24 terseinet.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both A Destination P Prf Metric 1 Metric 2 Next hop AS path * 10.0.0.0/24 O 150 13 >192.168.23.3 markom@R2>show ospf database external detailOSPF AS SCOPE link state database Type ID Adv Rtr Seq Age Opt Cksum Len Extern 10.0.0.0 4.4.4.4 0x8000000a 886 0x22 0xd431 36 mask 255.255.255.0 Topology default (ID 0) Type: 1, Metric: 10, Fwd addr: 0.0.0.0, Tag: 0.0.0.0 markom@R2>show ospf database asbr detailOSPF database, Area 0.0.0.23 Type ID Adv Rtr Seq Age Opt Cksum Len ASBRSum 4.4.4.4 3.3.3.3 0x80000005 798 0x22 0x74a5 28 mask 0.0.0.0 Topology default (ID 0) -> Metric: 2
She’s still supportive of my studying and blog writing in my spare time!

Recent Comments