Where are type 4 LSAs generated?

Posted by stretch in Networking on Monday, 21 Apr 2008 at 1:34 a.m. GMT

An interesting question was recently brought up by sirsamon over at networking-forum.com: where are OSPF type 4 LSAs generated? Recall that type 4 LSAs serve to advertise the presence of an autonomous system boundary router (ASBR). It would seem natural to assume type 4 LSAs are generated by a border router (ABR) for the area in which the ASBR is located, but that's not the case. Assume the following scenario:

Routers A through D connected in a line

Area 1 (a stub area) and area 2 (a standard area) are separated by area 0 (the backbone). Router A has a link to the 10.0.0.0/8 network, which is not participating in OSPF. Examining the OSPF database from router D yields expected results; we can see type 1, 2, and 3 LSAs for our network:

RouterD# show ip ospf database

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

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
172.16.0.3      172.16.0.3      187         0x80000002 0x00507E 1
172.16.0.4      172.16.0.4      186         0x80000002 0x004B81 1

                Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.2.2     172.16.0.4      186         0x80000001 0x00D0BA

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.0     172.16.0.3      203         0x80000003 0x009374
192.168.1.0     172.16.0.3      42          0x80000005 0x00E812

Now assume we want to redistribute the 10.0.0.0/8 network from router A into OSPF. First, let's convert area 1 to a not-so-stubby area (NSSA), which will allow it to contain an ASBR but still retain its stubbiness.

RouterA(config)# router ospf 1
RouterA(config-router)# no area 1 stub
RouterA(config-router)# area 1 nssa

RouterB(config)# router ospf 1
RouterB(config-router)# no area 1 stub
RouterB(config-router)# area 1 nssa

Even though we haven't configured router A for redistribution yet, a type 4 LSA has just been advertised by router C into area 2. Why? When we configured area 1 to be an NSSA, this change was communicated to router C, which now assumes an ASBR is present in area 1. After all, why else would it be an NSSA?

Router C advertises a type 4 LSA into area 2

We can verify this by again examining the OSPF database on router D:

RouterD# show ip ospf database

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

[-- Type 1, 2, and 3 LSAs omitted --]

                Summary ASB Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
172.16.0.2      172.16.0.3      59          0x80000001 0x00A112

Router C (172.16.0.3) is advertising a Summary ASB (type 4) LSA to router D, indicating it expects an ASBR to reside in area 1. Well, we don't want to be accused of false advertising (pun!), so let's turn router A into an ASBR. Below a static route is defined for 10.0.0.0/8, which is then redistributed into OSPF.

RouterA(config)# ip route 10.0.0.0 255.0.0.0 FastEthernet0/0
RouterA(config)# router ospf 1
RouterA(config-router)# redistribute static
% Only classful networks will be redistributed

The notification concerning classful redistribution can be ignored in this instance, since it is our intention to redistribute at the classful boundary (to redistribute classless subnets, use redistribute static subnets). Remember, any sort of redistribution will designate router A as an ASBR; I chose to redistribute a static route because it's the simplest example for our lab.

At this point, our configuration is complete. We can verify that router A is advertising the 10.0.0.0/8 network with a type 7 LSA to area 1, and router B (the ABR) is dutifully converting that LSA to type 5 before propagating it to the rest of the OSPF domain:

Router A's type 7 LSA is converted to type 5 by router B

RouterB# show ip ospf database 

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

[-- Type 1, 2, and 3 LSAs omitted --]

                Type-7 AS External Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.0.0.0        172.16.0.1      8           0x80000001 0x0091D0 0

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.0.0.0        172.16.0.2      2           0x80000001 0x00204B 0

Leave a comment

(optional, will not be published)
(optional)

Comment Tips

  • You can use Markdown syntax for decoration. (Cheat sheet)
  • Links: [Google](http://google.com) or <http://google.com>
  • Use backticks around commands: `ip address 127.0.0.1`
  • Use indentations (tabs) for preformatted text (code blocks)