This section describes the format of OSPF LSA.
Each router in an autonomous system (AS) generates one or more types of link state advertisements (LSAs), depending on the router's type. Multiple LSAs form a link state database (LSDB). Open Shortest Path First (OSPF) encapsulates routing information into LSAs for transmission. Commonly used LSAs include:
Summary-LSAs, including network-summary-LSAs (Type 3) and ASBR-summary-LSAs (Type 4)
All LSAs have the same header. Figure 1 shows an LSA header.
Table 1 describes LSA header fields.
Field |
Length |
Description |
|---|---|---|
LS age |
16 bits |
Time that elapses after the LSA is generated, in seconds. The value of this field continually increases regardless of whether the LSA is transmitted over a link or saved in an LSDB. |
Options |
8 bits |
The values are as follows:
|
LS type |
8 bits |
Type of the LSA. The values are as follows:
|
Link State ID |
32 bits |
This field together with the LS type field describes an LSA in an AS. |
Advertising Router |
32 bits |
Router ID of the router that generates the LSA. |
LS sequence number |
32 bits |
Sequence number of the LSA. Neighbors can use this field to identify the latest LSA. |
LS checksum |
16 bits |
Checksum of all fields except the LS age field. |
length |
16 bits |
Length of the LSA including the LSA header, in bytes. |
A router-LSA describes the link status and cost of a router. Router-LSAs are generated by a router and advertised within the area to which the router belongs. Figure 2 shows the format of a router-LSA.
Table 2 describes router-LSA fields.
Field |
Length |
Description |
|---|---|---|
Link State ID |
32 bits |
Router ID of the router that generates the LSA. |
V (Virtual Link) |
1 bit |
If the router that generates the LSA is located at one end of a virtual link, this field is set to 1. In other cases, this field is set to 0. |
E (External) |
1 bit |
If the router that generates the LSA is an autonomous system boundary router (ASBR), this field is set to 1. In other cases, this field is set to 0. |
B (Border) |
1 bit |
If the router that generates the LSA is an area border router (ABR), this field is set to 1. In other cases, this field is set to 0. |
# links |
16 bits |
Number of links and interfaces described in the LSA, including all links and interfaces in the area to which the router belongs. |
Link ID |
32 bits |
Object to which the router is connected. This field has different meanings for different link types:
|
Link Data |
32 bits |
Link data. This field has different meanings for different link types:
|
Type |
8 bits |
Type of the router link. The values are as follows:
|
# TOS |
8 bits |
Number of types of service (ToSs). |
metric |
16 bits |
Cost of the link. |
TOS |
8 bits |
Type of service. |
TOS metric |
16 bits |
Metric for the specified ToS. |
A network-LSA describes the link status of all routers on the local network segment. Network-LSAs are generated by a DR on a broadcast or non-broadcast multiple access (NBMA) network and advertised within the area to which the DR belongs. Figure 3 shows the format of a network-LSA.
Table 3 describes network-LSA fields.
A network-summary-LSA describes routes on a network segment in an area. The routes are advertised to other areas.
An ASBR-summary-LSA describes routes to the ASBR in an area. The routes are advertised to all areas except the area to which the ASBR belongs.
The two types of summary-LSAs have the same format and are generated by an ABR. Figure 4 shows the format of a summary-LSA.
Table 4 describes network-summary-LSA fields.
Field |
Length |
Description |
|---|---|---|
Link State ID |
32 bits |
Advertised network address |
Network Mask |
32 bits |
Mask of the broadcast or NBMA network |
metric |
24 bits |
Cost of the route to the destination address |
TOS |
8 bits |
Type of service |
TOS metric |
24 bits |
Metric for the specified ToS |
When a default route is advertised, both the Link State ID and Network Mask fields are set to 0.0.0.0.
Table 5 describes ASBR-summary-LSA fields.
An AS-external-LSA describes AS external routes. AS-external-LSAs are generated by an ASBR. Among the five types of LSAs, only AS-external-LSAs can be advertised to all areas except stub areas and not-so-stubby areas (NSSAs). Figure 5 shows the format of an AS-external-LSA.
Table 6 describes AS-external-LSA fields.
Field |
Length |
Description |
|---|---|---|
Link State ID |
32 bits |
Advertised network address. |
Network Mask |
32 bits |
Mask of the advertised destination address. |
E |
1 bit |
Type of the external route. The values are as follows:
|
metric |
24 bit |
Cost of the route to the destination address. |
Forwarding Address |
32 bits |
Packets destined for the advertised destination address are forwarded to the address specified by this field. |
External Route Tag |
32 bits |
Tag added to the external route. This field can be used to manage external routes. OSPF itself does not use this field. |
TOS |
8 bits |
Type of service. |
TOS metric |
24 bits |
Metric for the specified ToS. |
When AS-external-LSAs are used to advertise default routes, both the Link State ID and Network Mask fields are set to 0.0.0.0.