Network engineers must have the OSPF protocol

Mondo Technology Updated on 2024-01-30

OSPF is a link-state-based routing protocol that is developed specifically for IPRuns directly on top of the IP layer. It is designed to be route-free loops. In addition to this, IS-IS is also a very common link-state protocol.

OSPF is a link-state protocol. eachRouters are responsible for discovering and maintaining relationships with neighbors, and describing the list of known neighbors and link cost LSU packets, and reliably flooding with other routers in the ASXi the network topology of the entire autonomous systemThe routing information of other AS is injected into the router at the edge of the autonomous system to obtain the routing information of the entire Internet. At a specific time or when the link state changes, the LSA is regenerated and the router advertises the new LSA through the flood mechanism to achieve real-time route updates.

In this way, each router receives LSAs generated by all routers in the homebrew system, and the collection of these LSAs makes up the LSDB (Link State Database), so that all OSPF routers maintain a single database that describes the internal structure of the autonomous system.

1. OSPF area

In order to adapt to large networks, OSPF divides multiple zones within the AS, and each OSPF router maintains only the complete link status information of the region in which it is located. When a zone is divided, a central zone called Area 0 is created, and the other zones (Area 1, Area 2, Area 3, etc.) are always connected to Area 0, and the routers that connect Zone 0 to other zones are called Zone Border Routers.

2. Region ID

The region ID can be expressed as a decimal number or as an IP.

3. The backbone area is area 0

Responsible for the dissemination of inter-regional routing information.

4. Non-backbone area

Non-backbone areas must communicate with each other through the backbone area.

5. OSPF route type

Inter-region router: ABR, homebrew system border router: ASBR.

6. Causes of OSPF multi-region

Improve the scalability of the network and converge quickly.

7. Router ID selection rules

The router ID is the IP address that uniquely identifies the router in the OSPF areaIf there is no loopback interface and select the IP address with the highest value on the physical port, you can also run the router id command to specify the router ID, DR, and BDR election method.

8. Automatic election of DR and BDR

The router with the largest router LD on the network segment will be elected as DR, and the second largest router will be elected as BDR.

9. Manually select DR and BDR

The priority range is 0 255, the higher the number, the higher the priority, the default is 1If the priority is the same, you need to compare the router IDs, and if the priority of the router is set to 0, it will not participate in the election of DR and DBR.

10. The election process of DR and BDR

The priority of a router can affect an election process, but it cannot force the replacement of an existing DR or BDR router.

OSPF has the following characteristics:

Wide range of adaptation:Supports networks of all sizes, with up to a few hundred routers.

Fast Convergence:An update packet is sent immediately after a change in the topology of the network, so that the change is synchronized in the autonomous system.

No self-loop:Since OSPF uses the shortest path tree algorithm to calculate routes based on the collected link state, the slave algorithm itself ensures that no self-loop routes are generated.

Zoning:Allows the network of autonomous systems to be managed in zones. The reduction of the router link state database reduces memory consumption and CPU loadThe reduction of inter-regional transmission of routing information reduces the occupation of network bandwidth.

Equal-cost routing:Multiple equal-cost routes to the same destination address are supported.

Route Grading:Four different types of routes are used, in order of priority: intra-regional, inter-regional, first-class external routes, and second-class external routes.

Support for Validation:Packet verification based on region and interface is supported to ensure the security of packet interaction and route calculation.

Multicast send:Protocol packets are sent at multicast addresses on certain types of links to reduce interference with other devices.

There are three very important entries in OSPF, which must clearly understand the neighbor table, LSDB table, and OSPF routing table.

Neighbor Table:

The first step for OSPF to share link information with each other is to establish a neighbor relationship with OSPF in the same process and region, and then exchange link information by exchanging hello packets. The neighbors table displays the basic status of neighbors between OSPF routers, and you can also view the router ID and interface address of the peer device.

lsdb table:

The neighbor table is used to establish a neighbor relationship with neighboring devices and facilitate the exchange of link information between devicesAfter the neighbor relationship is established, it is necessary to start transmitting link state information LSA (Link State Advertisement), and after receiving other people's information, you have to put it in a fixed place, this place is LSDB (Link State Database, Link State Database), LSDB is also very easy to understand, and the database that stores LSA is not called a link state database.

ospf routing table:

The OSPF routing table and the router routing table are different entries, don't confuse the two, LSDB stores LSAs everywhere, so you know the path to various devices, but these paths may be more than one, but as long as it is a path, I will store it in my OSPF routing table for you, and then an algorithm will run in the OSPF routing table to calculate the optimal path to the destination device and put it in the router routing table. The ospf route table stores information such as destination, cost, and nexthop for guidance.

1. Hello message:

Periodically sent to discover and maintain OSPF neighbor relationships.

2. DD (Database Description) packet:

Describes the summary information of each LSA in the local LSDB and is used for database synchronization between the two routers.

3. LSR (Link Status Request) packets:

Request the required LSA from the other party.

4. LSU (Link State Update) packets:

Send the LSA they have requested.

5. LSACK (Link Status Acknowledgment) packets:

Used to confirm the receipt of the LSA. The content is the header of the LSA that needs to be acknowledged (a packet can acknowledge multiple LSAs).

1、down: The first hello packet is sent when the device is turned on.

2、init:After the first hello packet is sent, wait for the status of receiving the hello packet from the other party.

attempt:Similar to the INIT state, but it is only used for the NBMA interface network type.

-way:In the two-way connection, a hello packet (containing some information indicating that the device is the neighbor's route-id, etc.) is received from the neighbor, and the DR and BDR elections are completed in this state.

4、exstart:The two parties exchange empty DD packets, negotiate and elect the master and slave based on summary information such as serial numbers in DD packets.

5、exchange:The two parties exchange LD packets carrying LSA digest packets for synchronization with LSDB. (It can be said that each party stores its own LSA packet database, that is, LSDB).

6、loading:It is used to load the missing LSA packets after Exchange exchange. (LSR, LSU, and LSACK packets are sent.)

7、full:Synchronization of LSDB is complete. (In this process, Hello, DD, LSR, LSU, and LSACK packets are sent to dynamically refresh the LSDB.)

ospf creates routing tables through three mechanisms:

1. Confirm the connection with the hello package

Each router sends hello packets to its neighbors, and each router declares its presence to the other routers, which is the basis for building the routing table.

Hello packets are always sent every 10 seconds, and if the hello packets do not arrive within four times the usual time (40 seconds), it is assumed that the neighboring router somehow disappeared from the network.

Switching link declarations

After confirming the connection to the neighboring router, the connection state (link declaration) is exchanged, and the packet that sends the connection status is called LSA (Link State Advertisement). When the router receives the LSA, it updates a database called the LSDB (Link State Database) to keep it in sync with the neighboring routers. By repeating this task, all routers in the AS (Autonomous System) or area will have the same LSDB.

3. Create a routing table

On the basis of LSDB, a routing table is created using a calculation method called SPF algorithm. SPF stands for Shortest Path First, and it is an algorithm that selects the lowest-cost route, which is the name of OSPF.

This is the IT information shared this time, I hope that after reading this article, it can help you solve your confusion. Pay attention to Netbox Education***Learn more about IT information!

Related Pages