< Home

OSPF LSA Format

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:

LSA Header Format

All LSAs have the same header. Figure 1 shows an LSA header.

Figure 1 LSA header

Table 1 describes LSA header fields.

Table 1 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:

  • E: Type 5 LSAs are flooded.

  • MC: IP multicast packets are forwarded.

  • N/P: Type 7 LSAs are processed.

  • DC: On-demand links are processed.

LS type

8 bits

Type of the LSA. The values are as follows:

  • Type1: Router-LSA

  • Type2: Network-LSA

  • Type3: Network-summary-LSA

  • Type4: ASBR-summary-LSA

  • Type5: AS-external-LSA

  • Type7: NSSA-LSA

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.

Router-LSA

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.

Figure 2 Format of a router-LSA

Table 2 describes router-LSA fields.

Table 2 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:

  • 1: router ID

  • 2: interface IP address of the designated router (DR)

  • 3: network segment or subnet number

  • 4: router ID of the neighbor on a virtual link

Link Data

32 bits

Link data. This field has different meanings for different link types:

  • 1: interface index

  • 3: subnet mask

  • 2 and 4: interface address of the router

Type

8 bits

Type of the router link. The values are as follows:

  • 1: The router is connected to another router in point-to-point (P2P) mode.

  • 2: The router is connected to a transport network.

  • 3: The router is connected to a stub network.

  • 4: The router is connected to another router over a virtual link.

# 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.

Network-LSA

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.

Figure 3 Format of a network-LSA

Table 3 describes network-LSA fields.

Table 3 Network-LSA fields

Field

Length

Description

Link State ID

32 bits

Interface IP address of the DR

Network Mask

32 bits

Mask of the broadcast or NBMA network

Attached Router

32 bits

Router IDs of all routers on the broadcast or NBMA network, including the router ID of the DR

Summary-LSA

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.

Figure 4 Format of a summary-LSA

Table 4 describes network-summary-LSA fields.

Table 4 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.

Table 5 ASBR-summary-LSA fields

Field

Length

Description

Link State ID

32 bits

Router ID of the ASBR

Network Mask

32 bits

Set to 0.0.0.0

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

AS-External-LSA

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.

Figure 5 Format of an AS-external-LSA

Table 6 describes AS-external-LSA fields.

Table 6 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:

  • 0: Type 1 external route

  • 1: Type 2 external route

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.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >