Necessary for net work collection, OSPF protocol foundation, you can see it at a glance!

1. Background of OSPF
Due to the slow convergence of RIP in large networks, unscientific measurement values, and poor scalability. The OPSF protocol is proposed to make up for the many shortcomings of the RIP protocol
1.1. Features of the RIP protocolInsert picture description here

1.2. How to solve
Insert picture description here

2. OSPF working process
2.1. The establishment of neighbors
2.2. Synchronize the link state database
2.3. Use the SPF algorithm to calculate the optimal route
Insert picture description here

3. OSPF working principle
3.1. Router ID
3.1.1. Router ID concept It is
used to uniquely identify an OSPF router, the format is the same as the IPv4 address format.
3.1.2 .
Router ID election rules 1. Select the manually configured Router ID
2. No manual configuration of the Router ID, select the largest IP address in the
Loopback interface 3. No Loopback interface is configured, select the largest IP address in the link interface
(Router ID election cannot be preempted)

3.2. Neighbor discovery and establishment (Hello message)
3.2.1. The role of the Hello message
Neighbor discovery: automatically discovers the neighbor’s router.
Neighbor establishment: Neighbors are negotiated through Hello messages to establish neighbor relationships.
Neighbor retention: through the Keeplive mechanism , Detect neighbor running status
3.2.2. Neighbor establishment process
Insert picture description here

1. After the router starts OSPF, it will send hello messages to search for neighbors. At this time, the Router ID in the Hello message is its own, and the neighbor is empty. At this time, both neighbors are in Down status.
2. When the RB receives a Hello packet with the router ID of the other party and the neighbor is empty, it will set itself The neighbor status changes to Init. At the same time, it sends back a Hello packet, the Router ID is itself (2.2.2.2), and the neighbor is the other's Router ID (1.1.1.1). The
same is true for R1.
3. At this time, R1 receives the Hello packet from R2 (with Router ID and neighbor) will change their neighbors to 2-Way
4. When the neighbor status of both parties is 2-Way, the neighbor relationship is established and the
Hello packet is sent using the multicast address (244.0.0.5)
224.0.0.5 Represents all OSPF routers
224.0.0.6 Represents OPSF's DR\BDR

3.3. Message types and functions
3.3.1. OPSF protocol message header
Insert picture description here

3.3.2. OSPF message types
Insert picture description here

3.3.3. Functional requirements of OPSF messages

3.4.LSDB synchronization process
Insert picture description here

1. When the neighbor is in the ExStart state, the master-slave election is carried out through the DD message (without link state information).
The message includes Seq, Init, More, Master
Init: the initial message
More: there are other messages in the future Wen
master: said he based router (begin thinks he is the master router)
for the first time to send Init, More, master all set, the two sides compare router ID, router ID-based large router, then the interaction LAS , Use the sequence number of R2
2. After completing the master-slave negotiation, you can start the database interaction. At this time, the two parties are in the Exchange state.
At this time, the slave router sends DD packets (carrying LSA information), using the Seq of the master router, and Set your Master to 0, and Init to 0 at this time. (More=0 means that the DD message has been sent)
3. After completing the database interaction, the OPSF router will send a request to the LSA it does not have.
Through the LSR (request message), the router will request the specific information of the LSA it needs
4. Receive The router to the LSR will send the LSA needed by the other party
through the LSU (update message), and the router will send the specific information about the LSA needed by the other party.
In the third and fourth steps, the neighbor status is Loading
5. After the two parties complete the LSA update, Now it becomes adjacency, the state is Full

OSPF neighbor state machine

Insert picture description here

3.5. Link state information (LSA)
3.5.1. The content of link state information (LSA)
Insert picture description here

Type of link
P2P network: only two routers are interconnected; broadcast and multicast are supported.
Broadcast network: two or more routers are connected through a shared medium; support broadcast and multicast
NBMA network: two or more The router is connected via VC (frame relay); broadcast and multicast are not supported (need to manually specify neighbors)
P2MP network: a collection of multiple P2P; support broadcast, multicast
interface IP address and mask
 connected on the link Neighbor router
 link cost
 OPSF interface cost calculation: Cost = reference bandwidth value / actual bandwidth
 How to change OSPF cost
1. Configure directly under the interface
2. Modify the reference bandwidth (all routers need to be modified to ensure selection Road consistency)
 OPSF total overhead calculation

3.5.2. Link State Information (LSA) Header
Insert picture description here

LS age: indicates the lifetime of the LSA, the larger the older, the smaller the newer
LS type: the type of LSA
Link State ID: what the LSA describes (the type of LSA is different, and the value and meaning of the Link State ID are also different)
Advertisting Router: who generated the LSA.
LS Sequnece number: also represents the old and new LSA, the larger the newer, the smaller the old
LS checksum: also represents the old and new LSA, the larger the newer
Length: when the length is
compared to the old and new LSA, LS Sequnece first The number, LS checksum, and LS age are compared in turn. If none of them are compared, it means the same LSA

3.6. The election and role of DR and BDR
3.6.1. Problems in the MA network
Insert picture description here

 In such a network, there will be n × (n-1) / 2 adjacencies management complexity
 repetitive LSA flooding, wasting resources
role 3.6.2.DR and the BDR
 reduce abutting relationship
 reduced OSPF protocol traffic
BDR is the backup of DR
3.6.3.DR and BDR election
Election rules: The election of DR and BDR is port-based The
greater the DR priority of the interface, the more preferred.
The greater the DR priority of the interface, the higher the Router ID. Big Vietnam first
(DR/BDR election cannot be preempted)
3.6.4. Neighbor and adjacency relationship
Insert picture description here
END

In order to better help you learn and understand network engineers, and other related content, I deliberately organize all the materials systematically, and share them here for free. Necessary materials for net workers, including:

Huawei certification mind map (super fine);

Huawei certification essential knowledge document (pdf);

A collection of essential knowledge documents for net workers;

Necessary toolkit for net workers;

Necessary experiment package for net workers;

Necessary video interview package for net workers.

……

I won’t list them all because there are a lot of information. If you need information or have any questions, you can leave a message and discuss private messages~

Guess you like

Origin blog.csdn.net/zhongyuanjy/article/details/112572184