OSPF LSA
1. LSA Types
OSPF uses different LSA types (Link State Advertisements) to share routing information between routers and build its LSDB (Link State Database). Each LSA type has a specific purpose and flooding scope where it is flooded only within or between areas.
Find next more details about the LSA Types:
LSA Type 1 – “Router” – generated by every router
This LSA is flooded only within the area. Router LSA describes the links and neighbors of the local router.
root@R3> show ospf database area 0 lsa-id 17.0.0.3 router extensive
OSPF database, Area 0.0.0.0
Type ID Adv Rtr Seq Age Opt Cksum Len
Router *17.0.0.3 17.0.0.3 0x80000322 1024 0x22 0x7f16 108
bits 0x3, link count 7
id 17.0.0.6, data 17.8.4.1, Type PointToPoint (1)
Topology count: 0, Default metric: 10
id 17.8.4.0, data 255.255.255.0, Type Stub (3)
Topology count: 0, Default metric: 10
id 17.0.0.4, data 17.8.11.1, Type PointToPoint (1)
Topology count: 0, Default metric: 10
id 17.8.11.0, data 255.255.255.0, Type Stub (3)
Topology count: 0, Default metric: 10
id 128.49.247.24, data 255.255.255.255, Type Stub (3)
Topology count: 0, Default metric: 0
id 17.0.0.3, data 255.255.255.255, Type Stub (3)
Topology count: 0, Default metric: 0
id 17.0.0.1, data 17.18.1.2, Type Virtual (4)
Topology count: 0, Default metric: 10
Topology default (ID 0)
Type: Virtual, Node ID: 17.0.0.1
Metric: 10, Bidirectional
Type: PointToPoint, Node ID: 17.0.0.4
Metric: 10, Bidirectional
Type: PointToPoint, Node ID: 17.0.0.6
Metric: 10, Bidirectional
Gen timer 00:32:55
Aging timer 00:42:55
Installed 00:17:04 ago, expires in 00:42:56, sent 00:17:02 ago
Last changed 1w1d 03:06:41 ago, Change count: 27, Ours
LSA Type 2 – “Network” – generated only by the DR on the segment
Type 2 LSA is used only for broadcast media (Ethernet by default) and is originated by the Designated Router (DR) of the segment. It is used to represent the segment with all attached routers. The flooding scope is within the area only.
root@R6> show ospf database network extensive
OSPF database, Area 0.0.0.2
Type ID Adv Rtr Seq Age Opt Cksum Len
Network 17.28.14.2 17.0.0.7 0x80000001 384 0x20 0xe9cd 32
mask 255.255.255.0
attached router 17.0.0.7
attached router 17.0.0.6
Topology default (ID 0)
Type: Transit, Node ID: 17.0.0.6
Metric: 0, Bidirectional
Type: Transit, Node ID: 17.0.0.7
Metric: 0, Bidirectional
Aging timer 00:53:35
Installed 00:06:23 ago, expires in 00:53:36, sent 00:06:23 ago
Last changed 00:06:23 ago, Change count: 1
LSA Type 3 – “Summary” – generated by the ABR
Summary LSA is used from the ABR to exchange information from LSA type 1 and LSA type 2 to other attached areas. Its scope is whole OSPF domain if not limited by the area design.
root@R3> show ospf database area 0 netsummary lsa-id 17.0.0.1 extensive
OSPF database, Area 0.0.0.0
Type ID Adv Rtr Seq Age Opt Cksum Len
Summary 17.0.0.1 17.0.0.1 0x800001cd 346 0x22 0x65e5 28
mask 255.255.255.255
Topology default (ID 0) -> Metric: 0
Aging timer 00:54:14
Installed 00:05:43 ago, expires in 00:54:14, sent 00:05:41 ago
Last changed 2w1d 22:54:37 ago, Change count: 1
Summary *17.0.0.1 17.0.0.3 0x8000025f 2026 0x22 0x9715 28
mask 255.255.255.255
Topology default (ID 0) -> Metric: 10
Gen timer 00:16:13
Aging timer 00:26:13
Installed 00:33:46 ago, expires in 00:26:14, sent 00:33:44 ago
Last changed 1w1d 03:20:32 ago, Change count: 1, Ours
LSA Type 4 – “ASBRSum” – generated by ABR to advertise ASBR
Autonomous System Border Routers are routers that inject external routing information to the OSPF domain. ASBR Summary LSA describe the router ID of ASBR routers. This LSA is generated by an ABR attached to the area in which the ASBR is located to describe the reachability to this ASBR router-id. Its scope is the whole OSPF domain.
root@R3> show ospf database area 0 asbrsummary lsa-id 17.0.0.1 extensive
OSPF database, Area 0.0.0.0
Type ID Adv Rtr Seq Age Opt Cksum Len
ASBRSum *17.0.0.1 17.0.0.3 0x80000265 1626 0x22 0x7d28 28
mask 0.0.0.0
Topology default (ID 0) -> Metric: 10
Gen timer 00:22:54
Aging timer 00:32:54
Installed 00:27:06 ago, expires in 00:32:54, sent 00:27:04 ago
Last changed 1w1d 03:26:43 ago, Change count: 1, Ours
LSA Type 5 – “Extern” – external prefixes generated by ASBR
This LSA describes IP routes redistributed from other routing protocol including static routes. These LSAs are generated by ASBRs. They are flooded to all areas and OSPF routers except the areas, which by design do not need them. By default, the metric type used by Junos OS is type 2, which includes only the external cost of the route and ignoring internal cost to reach the ASBR router. Type 1 consists of external cost plus the internal cost to the ASBR, which can be configured.
root@R3> show ospf database area 0 external lsa-id 1.1.0.0 extensive
OSPF AS SCOPE link state database
Type ID Adv Rtr Seq Age Opt Cksum Len
Extern 1.1.0.0 17.0.0.1 0x80000247 587 0x22 0xb5a0 36
mask 255.255.0.0
Topology default (ID 0)
Type: 2, Metric: 0, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
Aging timer 00:50:13
Installed 00:09:44 ago, expires in 00:50:13, sent 00:09:42 ago
Last changed 2w6d 04:22:50 ago, Change count: 1
LSA Type 7 – “NSSA” – external prefixes inside NSSA Area
NSSA External LSA is similar to External LSA Type 5 as it is representing IP prefixes external to OSPF domain. The difference is that these LSAs are send by ASBRs inside a NSSA area. Type 7 LSAs are translated to an LSA Type 5 by the ABR attached to the NSSA area from where the LSA Type 7 is generated.
root@R6> show ospf database nssa lsa-id 2.2.1.0 extensive
OSPF database, Area 0.0.0.2
Type ID Adv Rtr Seq Age Opt Cksum Len
NSSA 2.2.1.0 17.0.0.7 0x80000261 645 0x28 0x5d36 36
mask 255.255.255.0
Topology default (ID 0)
Type: 1, Metric: 0, Fwd addr: 17.0.0.7, Tag: 0.0.0.0
Aging timer 00:49:14
Installed 00:10:42 ago, expires in 00:49:15, sent 00:10:40 ago
Last changed 2w5d 21:59:39 ago, Change count: 1
LSA Type 10 – “Opaque” – traffic engineering purposes
This LSA has an area wide scope and is used for exchanging additional information about the links used for traffic-engineering purposes in MPLS networks. The information from that LSA is used to populate the Traffic Engineering Database (TED), used for the Constrained Shortest Path First (CSPF) algorithm.
root@R6# run show ospf database opaque-area area 2 extensive
OSPF database, Area 0.0.0.2
Type ID Adv Rtr Seq Age Opt Cksum Len
OpaqArea*1.0.0.1 17.0.0.6 0x80000001 756 0x20 0x40c2 28
Opaque LSA
RtrAddr (1), length 4:
17.0.0.6
Gen timer 00:36:21
Aging timer 00:47:23
Installed 00:12:36 ago, expires in 00:47:24, sent 00:12:36 ago
Last changed 00:12:36 ago, Change count: 1, Ours
OpaqArea 1.0.0.1 17.0.0.7 0x80000001 571 0x20 0x44bc 28
Opaque LSA
RtrAddr (1), length 4:
17.0.0.7
Aging timer 00:50:28
Installed 00:09:30 ago, expires in 00:50:29, sent 00:09:30 ago
Last changed 00:09:30 ago, Change count: 1
OpaqArea*1.0.0.3 17.0.0.6 0x80000001 70 0x20 0xb0f3 136
Opaque LSA
Link (2), length 112:
Linktype (1), length 1:
1
LinkID (2), length 4:
17.0.0.7
LocIfAdr (3), length 4:
17.28.14.1
RemIfAdr (4), length 4:
17.28.14.2
TEMetric (5), length 4:
10
MaxBW (6), length 4:
1000Mbps
MaxRsvBW (7), length 4:
1000Mbps
UnRsvBW (8), length 32:
Priority 0, 1000Mbps
Priority 1, 1000Mbps
Priority 2, 1000Mbps
Priority 3, 1000Mbps
Priority 4, 1000Mbps
Priority 5, 1000Mbps
Priority 6, 1000Mbps
Priority 7, 1000Mbps
LinkLocalRemoteIdentifier (11), length 8:
Local 360, Remote 0
Color (9), length 4:
2
Gen timer 00:48:11
Aging timer 00:58:49
Installed 00:01:10 ago, expires in 00:58:50, sent 00:01:10 ago
Last changed 00:01:10 ago, Change count: 1, Ours, TE Link ID: 2147483649
OpaqArea 1.0.0.3 17.0.0.7 0x80000001 38 0x20 0x2895 136
Opaque LSA
Link (2), length 112:
Linktype (1), length 1:
1
LinkID (2), length 4:
17.0.0.6
LocIfAdr (3), length 4:
17.28.14.2
RemIfAdr (4), length 4:
17.28.14.1
TEMetric (5), length 4:
10
MaxBW (6), length 4:
1000Mbps
MaxRsvBW (7), length 4:
1000Mbps
UnRsvBW (8), length 32:
Priority 0, 1000Mbps
Priority 1, 1000Mbps
Priority 2, 1000Mbps
Priority 3, 1000Mbps
Priority 4, 1000Mbps
Priority 5, 1000Mbps
Priority 6, 1000Mbps
Priority 7, 1000Mbps
LinkLocalRemoteIdentifier (11), length 8:
Local 335, Remote 0
Color (9), length 4:
2
Aging timer 00:59:21
Installed 00:00:37 ago, expires in 00:59:22, sent 00:00:37 ago
Last changed 00:00:37 ago, Change count: 1
2. Wireshark
First, let’s see the encapsulation of an OSPF packet:
Frame 155: Packet, 210 bytes on wire (1680 bits), 210 bytes captured (1680 bits)
Ethernet II, Src: 56:04:0d:00:75:8b (56:04:0d:00:75:8b), Dst: IPv4mcast_05 (01:00:5e:00:00:05)
Internet Protocol Version 4, Src: 17.8.1.2, Dst: 224.0.0.5
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0xc0 (DSCP: CS6, ECN: Not-ECT)
Total Length: 196
Identification: 0xcd0e (52494)
000. .... = Flags: 0x0
...0 0000 0000 0000 = Fragment Offset: 0
Time to Live: 1
Protocol: OSPF IGP (89)
Header Checksum: 0xf903 [validation disabled]
[Header checksum status: Unverified]
Source Address: 17.8.1.2
Destination Address: 224.0.0.5
[Stream index: 2]
Open Shortest Path First
OSPF Header
Version: 2
Message Type: LS Update (4)
Packet Length: 176
Source OSPF Router: 17.0.0.3
Area ID: 0.0.0.0 (Backbone)
Checksum: 0x2e6b [correct]
Instance ID: Base IPv4 Unicast Instance (0)
Auth Type: Null (0)
Auth Data (none): 0000000000000000
LS Update Packet
Number of LSAs: 5
LSA-type 5 (AS-External-LSA (ASBR)), len 36
LSA-type 3 (Summary-LSA (IP network)), len 28
LSA-type 3 (Summary-LSA (IP network)), len 28
LSA-type 3 (Summary-LSA (IP network)), len 28
LSA-type 3 (Summary-LSA (IP network)), len 28
Next, let’s see how different LSA Types look like in Wireshark:
LSA Type 1 - Router
LSA-type 1 (Router-LSA), len 84
.000 0000 0000 0011 = LS Age (seconds): 3
0... .... .... .... = Do Not Age Flag: 0
Options: 0x20, (DC) Demand Circuits
0... .... = DN: Not set
.0.. .... = (O) Opaque: Not set
..1. .... = (DC) Demand Circuits: Supported
...0 .... = (L) LLS Data block: Not Present
.... 0... = (N) NSSA: Not supported
.... .0.. = (MC) Multicast: Not capable
.... ..0. = (E) External Routing: Not capable
.... ...0 = (MT) Multi-Topology Routing: No
LS Type: Router-LSA (1)
Link State ID: 17.0.0.7
Advertising Router: 17.0.0.7
Sequence Number: 0x80000005
Checksum: 0xd0f4
Length: 84
Flags: 0x02, (E) AS boundary router
0... .... = (H) Host: No
..0. .... = (S) Shortcut-capable ABR: No
...0 .... = (N) NSSA translation: No
.... 0... = (W) Wild-card multicast receiver: No
.... .0.. = (V) Virtual link endpoint: No
.... ..1. = (E) AS boundary router: Yes
.... ...0 = (B) Area border router: No
Number of Links: 5
Type: Stub ID: 17.8.5.0 Data: 255.255.255.0 Metric: 1000
Link ID: 17.8.5.0 - IP network/subnet number
Link Data: 255.255.255.0
Link Type: 3 - Connection to a stub network
Number of Metrics: 0 - TOS
0 Metric: 1000
Type: Stub ID: 17.8.14.0 Data: 255.255.255.0 Metric: 1000
Link ID: 17.8.14.0 - IP network/subnet number
Link Data: 255.255.255.0
Link Type: 3 - Connection to a stub network
Number of Metrics: 0 - TOS
0 Metric: 1000
Type: Stub ID: 17.11.22.7 Data: 255.255.255.255 Metric: 0
Link ID: 17.11.22.7 - IP network/subnet number
Link Data: 255.255.255.255
Link Type: 3 - Connection to a stub network
Number of Metrics: 0 - TOS
0 Metric: 0
Type: Stub ID: 17.0.0.7 Data: 255.255.255.255 Metric: 0
Link ID: 17.0.0.7 - IP network/subnet number
Link Data: 255.255.255.255
Link Type: 3 - Connection to a stub network
Number of Metrics: 0 - TOS
0 Metric: 0
Type: Stub ID: 128.49.228.243 Data: 255.255.255.255 Metric: 0
Link ID: 128.49.228.243 - IP network/subnet number
Link Data: 255.255.255.255
Link Type: 3 - Connection to a stub network
Number of Metrics: 0 - TOS
0 Metric: 0
LSA Type 2 - Network
LSA-type 2 (Network-LSA), len 28
.000 0000 0000 0001 = LS Age (seconds): 1
0... .... .... .... = Do Not Age Flag: 0
Options: 0x20, (DC) Demand Circuits
0... .... = DN: Not set
.0.. .... = (O) Opaque: Not set
..1. .... = (DC) Demand Circuits: Supported
...0 .... = (L) LLS Data block: Not Present
.... 0... = (N) NSSA: Not supported
.... .0.. = (MC) Multicast: Not capable
.... ..0. = (E) External Routing: Not capable
.... ...0 = (MT) Multi-Topology Routing: No
LS Type: Network-LSA (2)
Link State ID: 17.8.14.1
Advertising Router: 17.0.0.6
Sequence Number: 0x80000003
Checksum: 0xc423
Length: 28
Netmask: 255.255.255.0
Attached Router: 17.0.0.6
LSA Type 3 - Summary
LSA-type 3 (Summary-LSA (IP network)), len 28
.000 0000 0000 0001 = LS Age (seconds): 1
0... .... .... .... = Do Not Age Flag: 0
Options: 0x20, (DC) Demand Circuits
0... .... = DN: Not set
.0.. .... = (O) Opaque: Not set
..1. .... = (DC) Demand Circuits: Supported
...0 .... = (L) LLS Data block: Not Present
.... 0... = (N) NSSA: Not supported
.... .0.. = (MC) Multicast: Not capable
.... ..0. = (E) External Routing: Not capable
.... ...0 = (MT) Multi-Topology Routing: No
LS Type: Summary-LSA (IP network) (3)
Link State ID: 17.0.0.1
Advertising Router: 17.0.0.6
Sequence Number: 0x80000003
Checksum: 0x98b7
Length: 28
Netmask: 255.255.255.255
TOS: 0
Metric: 3000
LSA Type 4 - ASBR
LSA-type 4 (Summary-LSA (ASBR)), len 28
.000 0000 0000 0011 = LS Age (seconds): 3
0... .... .... .... = Do Not Age Flag: 0
Options: 0x22, (DC) Demand Circuits, (E) External Routing
0... .... = DN: Not set
.0.. .... = (O) Opaque: Not set
..1. .... = (DC) Demand Circuits: Supported
...0 .... = (L) LLS Data block: Not Present
.... 0... = (N) NSSA: Not supported
.... .0.. = (MC) Multicast: Not capable
.... ..1. = (E) External Routing: Capable
.... ...0 = (MT) Multi-Topology Routing: No
LS Type: Summary-LSA (ASBR) (4)
Link State ID: 17.0.0.7
Advertising Router: 17.0.0.5
Sequence Number: 0x80000001
Checksum: 0xd34e
Length: 28
Netmask: 0.0.0.0
TOS: 0
Metric: 1000
LSA Type 5 - Extern
LSA-type 5 (AS-External-LSA (ASBR)), len 36
.000 0000 0000 0100 = LS Age (seconds): 4
0... .... .... .... = Do Not Age Flag: 0
Options: 0x22, (DC) Demand Circuits, (E) External Routing
0... .... = DN: Not set
.0.. .... = (O) Opaque: Not set
..1. .... = (DC) Demand Circuits: Supported
...0 .... = (L) LLS Data block: Not Present
.... 0... = (N) NSSA: Not supported
.... .0.. = (MC) Multicast: Not capable
.... ..1. = (E) External Routing: Capable
.... ...0 = (MT) Multi-Topology Routing: No
LS Type: AS-External-LSA (ASBR) (5)
Link State ID: 2.2.2.0
Advertising Router: 17.0.0.6
Sequence Number: 0x80000002
Checksum: 0xbaa0
Length: 36
Netmask: 255.255.255.0
1... .... = External Type: Type 2 (metric is larger than any other link state path)
.000 0000 = TOS: 0
Metric: 0
Forwarding Address: 17.11.22.7
External Route Tag: 0
LSA Type 7 - NSSA
LSA-type 7 (NSSA AS-External-LSA), len 36
.000 0000 0000 0001 = LS Age (seconds): 1
0... .... .... .... = Do Not Age Flag: 0
Options: 0x28, (DC) Demand Circuits, (P) Propagate
0... .... = DN: Not set
.0.. .... = (O) Opaque: Not set
..1. .... = (DC) Demand Circuits: Supported
...0 .... = (L) LLS Data block: Not Present
.... 1... = (P) Propagate: Set
.... .0.. = (MC) Multicast: Not capable
.... ..0. = (E) External Routing: Not capable
.... ...0 = (MT) Multi-Topology Routing: No
LS Type: NSSA AS-External-LSA (7)
Link State ID: 2.2.2.0
Advertising Router: 17.0.0.7
Sequence Number: 0x80000001
Checksum: 0x4013
Length: 36
Netmask: 255.255.255.0
1... .... = External Type: Type 2 (metric is larger than any other link state path)
.000 0000 = TOS: 0
Metric: 0
Forwarding Address: 17.11.22.7
External Route Tag: 0
LSA Type 10 - Opaque
LSA-type 10 (Opaque LSA, Area-local scope), len 28
.000 0000 0000 1000 = LS Age (seconds): 8
0... .... .... .... = Do Not Age Flag: 0
Options: 0x22, (DC) Demand Circuits, (E) External Routing
0... .... = DN: Not set
.0.. .... = (O) Opaque: Not set
..1. .... = (DC) Demand Circuits: Supported
...0 .... = (L) LLS Data block: Not Present
.... 0... = (N) NSSA: Not supported
.... .0.. = (MC) Multicast: Not capable
.... ..1. = (E) External Routing: Capable
.... ...0 = (MT) Multi-Topology Routing: No
LS Type: Opaque LSA, Area-local scope (10)
Link State ID Opaque Type: Traffic Engineering LSA (1)
Link State ID TE-LSA Reserved: 0
Link State ID TE-LSA Instance: 1
Advertising Router: 17.0.0.3
Sequence Number: 0x80000001
Checksum: 0x16f0
Length: 28
3. Summary
LSA Types summary:
| Type | Name | LSA ID | Data | ||||
| 1 | Router | RID | V,E,B bits |
Link Type p2p Transig Stub Virtual Link |
Link ID Neighbor RID DR int IP Network Neighbor RID |
Link Data Local int IP Local int IP Mask Local int IP |
Metric |
| 2 | Network | DR IP | Mask | Attached Router (repeatead for all routers) |
|||
| 3 | Summary | Network | Mask | Metric | |||
| 4 | ASBR Summary | ASBR RID | Mask (0.0.0.0) | Metric | |||
| 5 | AS External | Network | Metric | E bit (Metric type) |
Metric | Forwarding Address |
Tag |
| 7 | NSSA External | Network | Metric | E bit | Metric | Forwarding Address |
Tag |
| 10 | Opaque | Locally significant ID |
Traffic engineering | ||||
4. OSPF3 (IPv6)
OSPF3 was developed for IPv6, but supports both IPv6 and IPv4.
The OSPF encapsulation and LSA types are similar (but not identical). Unsurprisingly, we see that OSPF3 exchanges LSA using Link Local IPv6 addressing, so family inet6 must be activated on all OSPF3 interfaces (even when using only realm ipv4).
Frame 361: Packet, 354 bytes on wire (2832 bits), 354 bytes captured (2832 bits)
Ethernet II, Src: 56:04:0d:00:01:c7 (56:04:0d:00:01:c7), Dst: IPv6mcast_05 (33:33:00:00:00:05)
Internet Protocol Version 6, Src: fe80::5604:dff:fe00:1c7, Dst: ff02::5
0110 .... = Version: 6
.... 1100 0000 .... .... .... .... .... = Traffic Class: 0xc0 (DSCP: CS6, ECN: Not-ECT)
.... 0000 0000 0000 0000 0000 = Flow Label: 0x00000
Payload Length: 300
Next Header: OSPF IGP (89)
Hop Limit: 1
Source Address: fe80::5604:dff:fe00:1c7
Destination Address: ff02::5
[Source SLAAC MAC: 54:04:0d:00:01:c7 (54:04:0d:00:01:c7)]
[Stream index: 1]
Open Shortest Path First
OSPF Header
Version: 3
Message Type: LS Update (4)
Packet Length: 300
Source OSPF Router: 17.0.0.7
Area ID: 0.0.0.0 (Backbone)
Checksum: 0x0ac3 [correct]
Instance ID: Base IPv4 Unicast AF (64)
Reserved: 00
LS Update Packet
Number of LSAs: 6
LSA-type 9 (Intra-Area-Prefix-LSA), len 64
LSA-type 8 (Link-LSA), len 52
LSA-type 2 (Network-LSA), len 32
LSA-type 9 (Intra-Area-Prefix-LSA), len 40
LSA-type 8 (Link-LSA), len 52
LSA-type 1 (Router-LSA), len 40
OSPF3 will be covered in a dedicated post.
External Resources: