OSPF network LSAs (or type 2 LSA) are generated for NBMA (non broadcast multiaccess) and transit broadcast networks that resides in an area. As a transit broadcast network could serve an Ethernet network where two or more routers are connected via ethernet links and share the same broadcast domain like in the picture below.
In the picture you see an OSPF network, where there is a broadcast domain, which consists of R2 with R1 and ABR connected through a ethernet switch. Unlike router LSAs, which are generated by every router, network LSAs (type 2 LSAs) are generated only by DR (Designated Router) for the multiaccess network. In current topology, ABR router, is at the same time Designated Router (because of highest router id – 220.127.116.11) for ethernet segment between R1-R2-ABR, so, ABR is in charge for generating type 2 LSA to represent this multiaccess network in area 0. Let’s have a look at some output from “
show ip ospf database“:
R1#sh ip ospf database OSPF Router with ID (18.104.22.168) (Process ID 1) Router Link States (Area 0) ... ouptut omitted ... Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 10.0.0.1 22.214.171.124 1420 0x80000001 0x00E11D
R3#sh ip ospf database OSPF Router with ID (126.96.36.199) (Process ID 1) Router Link States (Area 0) ... output omitted ... Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 10.0.0.1 188.8.131.52 1463 0x80000001 0x00E11D
R5#sh ip ospf database OSPF Router with ID (184.108.40.206) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 220.127.116.11 18.104.22.168 1527 0x80000001 0x00F365 2 22.214.171.124 126.96.36.199 1521 0x80000002 0x008EC5 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 10.0.0.0 188.8.131.52 1512 0x80000002 0x00F027 10.0.1.0 184.108.40.206 1522 0x80000001 0x00F3F0 10.0.3.0 220.127.116.11 1512 0x80000002 0x004097 R5#
In the outputs above, highlighted in orange you see network LSAs on R1 and R3. Advertising router is ABR in this case, which has router id 18.104.22.168. The Link-State ID used by network LSA is the IP address of the DR which you can see in the excerpts above.
Type 2 LSAs are flooded within area, but they don’t leave the area in which they are generated which you might have noticed in the output from router R5. For a detailed view of network LSAs use “
sh ip ospf database network” or one of its variations by providing link-state id or advertising router-id.
R3#sh ip ospf database network OSPF Router with ID (22.214.171.124) (Process ID 1) Net Link States (Area 0) Routing Bit Set on this LSA LS age: 207 Options: (No TOS-capability, DC) LS Type: Network Links Link State ID: 10.0.0.1 (address of Designated Router) Advertising Router: 126.96.36.199 LS Seq Number: 80000003 Checksum: 0xDD1F Length: 36 Network Mask: /24 Attached Router: 188.8.131.52 Attached Router: 184.108.40.206 Attached Router: 220.127.116.11 R3#
From this view you can get precious information like attached routers and subnet mask. One more variation of this command that I would pay attention to, is “
show ip ospf database network self-originate“. When you issue this command on a router, you will get network LSA generated by the router itself.