OSPF packet and the process of establishing a neighbor

OSPF packet header:
1.version: version OSPFv2 is currently used, a value of 2
2.type: packet type, there are five OSPF packet types
3.Packet Length: length of the entire packet of the OSPF packet in bytes
4.Router-ID: message sending router the RID of
5.Area-ID: ID area, indicating that the message needs to be advertised to the region 6.checksum: check field, the check range OSPF entire packet, including the packet header OSPF
7.auth type: 0 indicates no authentication, 1 represents a simple plain text authentication, 2 denotes encrypted authentication (MD5)
8.Authentication: authentication information

5 kinds of message types:
1.Hello packet Role:
Neighbor Discovery: Automatically discover neighbors router
neighbor establish: parameter negotiation hello packets to establish neighbor relationship
neighbor Hold: by keeplive mechanism, a neighbor running state detection
2 .DD: database description packets
3.LSU: link state update packet
4.LSR: link state request packet
5.LSACK: link status reply message

OSPF neighbor relationship forming conditions:
same region 1. ID
2.Hello Dead time coincides with the time, the default Hello Dead time is four times the time
3. consistent password authentication type and
4. special tag region consistent
5.MTU values agree
6. RID conflict will lead to the establishment of the neighbors fail

OSPF neighbor state changes:
1.Down: the initial state of a neighbor, has not received any information from a neighbor in the NBMA network, this state can still send Hello packets to the neighbor statically configured
2.Attempt: only in this state exists on the NBMA network, has not received
any information of a neighbor, but has been periodically sends a message to a neighbor, transmission interval is Hellointerval.
3.init: the state, the router has received Hello packets from a neighbor, the neighbor list but they're not received Hello packets, the neighbors said it had not and establish two-way communication relationship.
4. 2-Way: This status indicates that the router neighbor discovery and open two-way channel (with its own RID received from the neighbor list field over the neighbor's Hello packet), 2-Way show that the establishment of a neighbor relationship with the neighbor.
5.exstart: The state is the first step in forming a relationship of the street, after the neighbor state to this state, the router starts sending DD packets to the neighbor, the primary election from the state from the relationship.
6.exchange: this state, each router sends link state DD packet contains summary information describing the contents of the LSDB.
7.Loading: The state of each router transmits a request packet LSR LSA, LSU to send advertisement LSA.
8.Full: two routers represent the LSDB (link state database) has completed synchronization.

DD (= X-Seq, the I, M, the MS)
the I: the init: initial bit
M: more: more bits (set to indicate that there are more packets to be sent DD)
the MS: Master / Slave: master-slave bit ( set declared himself Master)
the X-: serial number

Establish adjacencies:
1. When the RTA neighbor state becomes Exstart, RTA will send the first DD packets.
2.RTB receives the first DD packet sent from the other side, we see the other side of the RID smaller than themselves, ignore.
3.RTA receives the first DD packet sent from the other side, we see the other side of the RID greater than themselves, from Exstart over to the state exchange.
After the state becomes 4.RTA exchange, RTA DD sends a new packet, this packet contains the LSDB summary information, serial numbers to the serial number DD packet transmitted before the RTB Y. I set to 0, indicating that this is not the first DD packet, M is set to 0, indicating that this is the DD packet summary information of the last LSDB, MS is set to 0, declared himself slave.
After 5.RTB received state transition from Exstart to exchange.
6.RTB become neighbors after the exchange, will send a new DD packets times the packet contains a summary LSDB information. DD packet sequence number is set to Y + 1, MS is set to 1, declaring that he is Master.
7.RTA after receipt of DD packets, synchronize the database, after synchronization is complete, although no new LSDB DD packet summary information, but each DD packets RTA as slave, the need for Master sent for confirmation Reply. Therefore, the RTA RTB sends a new DD packet, sequence number Y + 1, the packet is empty, Master to acknowledge receipt of packets sent from the DD, the transition from a state to exchange loading.
8.RTB After receiving the packet, the state will transition directly from the exchange to the Full.
9.RTA start sending packets to RTB-LSR, requesting that the link state information exchange state by the DD packet is found, and is not in the LSDB.
After 10.RTB LSR receives a request, the LSU transmit to the RTA, LSU packet contains details of those link state is requested.
After 11.RTA received LSU, the state transition from loading to FULL.
12.RTA send LSACK to RTB, as an acknowledgment of LSU, followed by RTB receive LSACK, the two sides will establish a full adjacency.

Neighbor: After OSPF router starts, it sends OSPF interface Hello packets are used to discover neighbors. Reaching the 2-Way state can become established neighbors.

Published 13 original articles · won praise 13 · views 315

Guess you like

Origin blog.csdn.net/qq_43320728/article/details/104576451