< Home

OSPF Packet Format

This section describes the format of OSPF packets.

Open Shortest Path First (OSPF) packets are encapsulated into IP packets. The OSPF protocol number is 89. OSPF packets are classified into the following types:

Packet Header Format

The five types of OSPF packets have the same packet header format. The length of an OSPF packet header is 24 bytes. Figure 1 shows an OSPF packet header.

Figure 1 OSPF packet header
Table 1 describes packet header fields.
Table 1 Packet header fields

Field

Length

Description

Version

8 bits

OSPF version number. For OSPFv2, the value is 2.

Type

8 bits

OSPF packet type. The values are as follows:

  • 1: Hello packet

  • 2: DD packet

  • 3: LSR packet

  • 4: LSU packet

  • 5: LSAck packet

Packet length

16 bits

Length of the OSPF packet containing the packet header, in bytes.

Router ID

32 bits

ID of the router that sends the OSPF packet.

Area ID

32 bits

ID of the area to which the router that sends the OSPF packet belongs.

Checksum

16 bits

Checksum of the OSPF packet that does not contain the Authentication field.

AuType

16 bits

Authentication type. The values are as follows:

  • 0: non-authentication

  • 1: simple authentication

  • 2: message digest algorithm 5 (MD5) authentication

Authentication

64 bits

This field has different meanings for different AuType values:

  • 0: This field is not defined.

  • 1: This field defines password information.

  • 2: This field contains the key ID, MD5 authentication data length, and sequence number.

MD5 authentication data is added to an OSPF packet and is not included in the Authentication field.

Hello Packet

Hello packets are commonly used packets, which are periodically sent on OSPF interfaces to establish and maintain neighbor relationships. A Hello packet includes information about the designated router (DR), backup designated router (BDR), timers, and known neighbors. Figure 2 shows the format of a Hello packet.

Figure 2 Format of a Hello packet
Table 2 describes Hello packet fields.
Table 2 Hello packet fields

Field

Length

Description

Network Mask

32 bits

Mask of the network on which the interface that sends the Hello packet resides.

HelloInterval

16 bits

Interval at which Hello packets are sent.

Options

8 bits

The values are as follows:

  • E: Type 5 link state advertisements (LSAs) are flooded.

  • MC: IP multicast packets are forwarded.

  • N/P: Type 7 LSAs are processed.

  • DC: On-demand links are processed.

Rtr Pri

8 bits

DR priority. The default value is 1.

NOTE:
If the DR priority of a router interface is set to 0, the interface cannot participate in a DR or BDR election.

RouterDeadInterval

32 bits

Dead interval. If a router does not receive any Hello packets from its neighbors within a specified dead interval, the neighbors are considered Down.

Designated Router

32 bits

Interface address of the DR.

Backup Designated Router

32 bits

Interface address of the BDR.

Neighbor

32 bits

Router ID of the neighbor.

Table 3 lists the address types, interval types, and default intervals used when Hello packets are transmitted on different networks.

Table 3 Hello packet characteristics for various network types

Network Type

Address Type

Interval Type

Default Interval

Broadcast

Multicast address

HelloInterval

10 seconds

Non-broadcast multiple access (NBMA)

Unicast address

  • HelloInterval for the DR, BDR, and router that can become a DR

  • PollInterval for the case when neighbors become Down and HelloInterval for other cases

30 seconds for HelloInterval

120 seconds for PollInterval

Point-to-point (P2P)

Multicast address

HelloInterval

10 seconds

Point-to-multipoint (P2MP)

Unicast address

HelloInterval

30 seconds

To establish neighbor relationships between routers on the same network segment, you must set the same HelloInterval, PollInterval, and RouterDeadInterval values for the routers. PollInterval applies only to NBMA networks.

DD Packet

During an adjacency initialization, two routers use DD packets to describe their own link state databases (LSDBs) for LSDB synchronization. A DD packet contains the header of each LSA in an LSDB. An LSA header uniquely identifies an LSA. The LSA header occupies only a small portion of the LSA, which reduces the amount of traffic transmitted between routers. A neighbor can use the LSA header to check whether it already has the LSA. When two routers exchange DD packets, one functions as the master and the other functions as the slave. The master defines a start sequence number. The master increases the sequence number by one each time it sends a DD packet. After the slave receives a DD packet, it uses the sequence number carried in the DD packet for acknowledgement.

Figure 3 shows the format of a DD packet.

Figure 3 Format of a DD packet
Table 4 describes DD packet fields.
Table 4 DD packet fields

Field

Length

Description

Interface MTU

16 bits

Maximum length of the DD packet sent by the interface with packet fragmentation disabled.

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.

I

1 bit

If the DD packet is the first packet among multiple consecutive DD packets sent by a router, this field is set to 1. In other cases, this field is set to 0.

M (More)

1 bit

If the DD packet is the last packet among multiple consecutive DD packets sent by a router, this field is set to 0. In other cases, this field is set to 1.

M/S (Master/Slave)

1 bit

When two routers exchange DD packets, they negotiate a master/slave relationship. The router with a larger router ID becomes the master. If this field is set to 1, the DD packet is sent by the master.

DD sequence number

32 bits

Sequence number of the DD packet. The master and slave use the sequence number to ensure that DD packets are correctly transmitted.

LSA Headers

-

LSA header information included in the DD packet.

LSR Packet

After two routers exchange DD packets, they send LSR packets to request each other's LSAs. The LSR packets contain the summaries of the requested LSAs. Figure 4 shows the format of an LSR packet.

Figure 4 Format of an LSR packet
Table 5 describes LSR packet fields.
Table 5 LSR packet fields

Field

Length

Description

LS type

32 bits

Type of the 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.

The LS type, Link State ID, and Advertising Router fields can uniquely identify an LSA. If two LSAs have the same LS type, Link State ID, and Advertising Router fields, a router uses the LS sequence number, LS checksum, and LS age fields to obtain a required LSA.

LSU Packet

A router uses an LSU packet to transmit LSAs requested by its neighbors or to flood its own updated LSAs. The LSU packet contains a set of LSAs. For multicast and broadcast networks, LSU packets are multicast to flood LSAs. To ensure reliable LSA flooding, a router uses an LSAck packet to acknowledge the LSAs contained in an LSU packet that is received from a neighbor. If an LSA fails to be acknowledged, the router retransmits the LSA to the neighbor. Figure 5 shows the format of an LSU packet.

Figure 5 Format of an LSU packet
Table 6 describes the LSU packet field.
Table 6 LSU packet field

Field

Length

Description

Number of LSAs

32 bits

Number of LSAs contained in the LSU packet

LSAck Packet

A router uses an LSAck packet to acknowledge the LSAs contained in a received LSU packet. The LSAs can be acknowledged using LSA headers. LSAck packets can be transmitted over different links in unicast or multicast mode. Figure 6 shows the format of an LSAck packet.

Figure 6 Format of an LSAck packet
Table 7 describes the LSAck packet field.
Table 7 LSAck packet field

Field

Length

Description

LSAs Headers

Determined by the header length of the LSA to be acknowledged.

This field is used to acknowledge an LSA.

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