What is OSPF? Necessary for net workers! OSPF in detail

Today I will tell you about the OSPF protocol .

OSPF is a link state routing protocol based on the SPF algorithm.

What is OSPF?  Necessary for net workers!  OSPF in detail


The above picture shows the working process of the OSPF protocol when a new router is added to an OSPF area. If you can describe this picture in great detail, you can basically master the working process of the OSPF protocol.
First of all, everyone must be clear that a router running the OSPF protocol will eventually store three tables: neighbor table, topology table, and routing table. The following uses the process of generating these three tables as a clue to analyze what changes have taken place in the router during this process, thereby explaining the working process of the OSPF protocol.


(1) Establishment of neighbor table

A router newly added to an OSPF area must first establish an adjacency with its neighbor routers. The process is as follows:

What is OSPF?  Necessary for net workers!  OSPF in detail


What is OSPF?  Necessary for net workers!  OSPF in detail

The new router waits for a response after sending the first hello packet. The waiting time interval is four times that of the hello packet. The state of the waiting period is called the initial state of the router. During the waiting period, the new router receives the hello packet from another router, and Know DE and BDR, if not, start to choose. After receiving the hello0 packet from the new router, other routers on the network add the router Tn of the router to the topology database and send a response hello packet, which contains a list of all neighbors of its router ID.

What is OSPF?  Necessary for net workers!  OSPF in detail

The new router sees that its ID appears in the neighbor list answered by other routers and establishes an adjacency, and the new router changes its status to bidirectional.

Through the above 3 steps, the newly added router and its neighbor router have established an adjacency relationship.



(2) The establishment of topology table

When establishing the topology table, the newly added router has to go through the pre-start state, switching state, loading state, and complete adjacency state. The following will show you this process in the form of a diagram:

What is OSPF?  Necessary for net workers!  OSPF in detail


(2) Exchange status: Both routers send DBD, DR sends a series of DBD, including the network stored in its database. The DBD does not contain detailed necessary information, just for comparison with its own database after receiving DBD messages from other neighbor routers.

What is OSPF?  Necessary for net workers!  OSPF in detail

(3) Loading status: The new router needs more detailed information, it will use LSR (link state request packet) to request the detailed information of a specific LSA, and the requested end will respond and send LSU (link status) Update package), this package contains the information LSA information.

What is OSPF?  Necessary for net workers!  OSPF in detail


After the above four steps, the data topology diagrams of all routers in this OSPF area are synchronized.

(3) Then each router runs the SPF algorithm according to the generated data topology map of the whole area to generate routing entries to the target network .


After the above three steps, the operating process of the OSPF protocol is basically over.

What is OSPF?  Necessary for net workers!  OSPF in detail

In the above process, there are several very important issues that need attention:

1 "The administrative distance of this protocol is 110. The OSPF routing process ID must be in the range of 1-65535, and only has local meaning. The routing process ID of different routers can be different, and the area ID is between 0 and 4294967295. When the area value is taken This area is called the backbone area at 0 hours;

2" Make sure the router ID follows the following sequence:

The router ID specified by the router ID command has the highest priority.
If it is not specified, then the IP address of the loopback interface with the largest IP address is selected as the route ID.
If there is no change back interface, the router ID with the largest IP value in the UP port is selected
but It is recommended to use commands to specify, so that the controllability is better;

3" Principles of DR election

The most important factor is time. The router that starts first is elected as the DR.
If it starts at the same time or is re-elected, it depends on the interface priority (0-255). The highest priority is elected as the DR. By default, multiple access The interface priority of the network is 1, and the interface priority of the point-to-point network is 0. The command to modify the interface priority is "ip ospf priority". If the priority of the interface is set to 0, the interface does not participate in the DR election.

What is OSPF?  Necessary for net workers!  OSPF in detail

For more learning materials for net workers, to obtain certification-related learning content, you can follow my private message and reply: "Learning"

If the first two are the same, look at the router ID last, and the one with the highest router ID is elected as the DR.

Non-preemption during DR elections, unless artificially re-election. There are two ways to re-elect DR, one is to restart the router; the other is to execute the "clear ip ospf process" command.

Hope to bring you help, peace!


Guess you like

Origin blog.51cto.com/15039035/2562121