06.OSPF packet

OSPF packet protocol

  • OSPF protocol is a four-layer encapsulation protocol
  • The protocol number in the IP protocol is 89

OSPF header content

No matter what type of OSPF packet needs to add encapsulated content

insert image description here

details

Version — OSPF version — 2

Type — Type of OSPF packet

Hell0 1
DBD 2
LSR 3
LSU 4
LSACK 5

Packet length—the total length of OSPF packets, in bytes

RID — Represents the identity of the router that sent the packet

Area ID — the area ID of all areas on the interface from which the packet is sent

authentication type

null Not certified 0
simple clear text authentication 1
MD5 Compare Digest Value Authentication 2

When OSPF re-authenticates, it needs to compare the authentication data, if one fails, the authentication will fail

five packets

serial number Package names
1 hello bag
2 DBD package
3 LSR package
4 LSU package
5 LSACK packets

hello bag

Role : Periodic discovery, establishment and keeping alive neighbor relationship (DR/BDR election also uses hello packet)

7

details

  • Netmask—the mask information corresponding to the IP address assigned to the interface sending the data packet

    Huawei equipment requires that the netmasks of the interfaces between neighbors must be the same, otherwise the neighbor relationship cannot be established. (This restriction is invalid for point-to-point networks)

  • Hello time and dead time — If the neighbors are not the same, the neighbor relationship will not be established normally.

  • 8 is optional – each position will represent a router that satisfies certain OSPF characteristics

    ​ Contains the flag bit of the OSPF special area. — The flag bits of the special area between neighbors must be the same, otherwise the neighbor relationship cannot be established normally

  • Router Priority — The priority of the DR/BDR election corresponding to the interface that sent this packet

  • Designated Router/Backup Designated Router—carries the IP addresses corresponding to DR and BDR. When DR and BDR are not elected, it will be filled with 0.0.0.0

  • Neighbors—locally known neighbor RDs

Limiting Factors for Neighborhood Establishment

1. Netmask - only for Ethernet

2. hello time

3. Time of death

4. Marking of special areas

5. Authentication information

DBD packet - link state description message

effect

1. The master-slave relationship election can be carried out (1. The master can first enter the data forwarding; 2. The master can dominate the invisible confirmation)

2. Carry LSA information summary

insert image description here

Interface Maximum Transmission Unit

A person

​ By default, Huawei devices do not enable the detection of the MTU value, so it will carry 0. If the MTU detection function is enabled on the interface, it will carry the real MTU

​ If the MTU values ​​of the two neighbors are different, they will stay in the exstart state.

[r1-GigabitEthernet0/0/1]ospf mtu-enable  在于邻居间直连的接口上开启MTU,检测;若一端开启,另一端也必须开启;

optional

​ I - INIT - If the I position is 1, it means that this DBD packet is a data packet for master-slave election. It will not carry the header information of LSA

​ M — More — If the position is 1, it means that there are still DBD packets to be sent later. If the position is 0, it means that this DBD packet is the last DBD packet.

​ Ms — Master — If the position is 1, it means the sender is the master, if the position is changed to 0, it means the sender is the slave.

serial number

​ In the interaction of DBD messages, 1 will be added successively to ensure the order and reliability of the messages - to ensure the invisible confirmation of DBD packets.

After exchanging the database summary information, the slave will send an additional DBD packet. This DBD packet uses the serial number sent by the master last, but does not carry the summary information. Its main purpose is to confirm

​ Invisible confirmation - After the master-slave relationship is confirmed, there is a master-led serial number, and the slave can only use the serial number sent by the master to reply, which has the effect of confirmation.

LSR packet - link state request message

Request local unknown LSA information based on DBD packets

insert image description here

LSA triplet (can uniquely identify a piece of LSA information)

​ Link state type

​ Link state ID

​ Advertise the router

LSU packet - link state update message

The data packet that actually carries the LSA information

insert image description here

LSACK Packet - Link State Packet (OK Packet)

insert image description here

Guess you like

Origin blog.csdn.net/bo1029/article/details/131545236