【OSPF of network protocol】

OSPF (Open Shortest Path First) is an Interior Gateway Protocol (IGP) for routing decisions within a single autonomous system (AS). It is an implementation of the link state routing protocol and belongs to the Interior Gateway Protocol (IGP), so it operates within the autonomous system. The well-known Dijkstra algorithm (Dijkstra) is used to calculate the shortest path tree. OSPF is divided into two versions, OSPFv2 and OSPFv3. OSPFv2 is used in IPv4 networks and OSPFv3 is used in IPv6 networks. OSPFv2 is defined by RFC 2328 and OSPFv3 is defined by RFC 5340. Compared to RIP, OSPF is a link state protocol, while RIP is a distance vector protocol.

 

How Link State Routing Protocol (or OSPF) works:

Each router establishes adjacencies with its neighbors by using Hello packets

Each router sends a Link State Advertisement (LSA), sometimes called a Link State Packet (LSP), to each neighbor. After each neighbor receives an LSP, it forwards these LSPs to its neighbors in turn (flooding).

Each router should keep a copy of the LSAs it has received in its database, and the database of all routers should be the same

According to the topology database, each router uses the Dijkstra algorithm (SPF algorithm) to calculate the shortest path to each network, and outputs the result to the routing table

The simplified principle of OSPF: sending Hello packets - establishing adjacency relationship - forming link state database - SPF algorithm - forming routing table.

 

Features of OSPF:

1. Quickly adapt to network changes

2. Send trigger updates when the network changes

3. Send periodic updates at a lower frequency (every 30 minutes), this is known as link status refresh

4. Support discontinuous subnet and CIDR

5. Support manual route summary

6. Short convergence time

7. Use Cost as a metric

8. Use the zone concept, which can effectively reduce the CPU and memory usage of the protocol on the router.

9. It has the function of routing verification and supports equal-cost load balancing

A router running OSPF needs a Router ID that can uniquely identify itself

 

 

OSPF is divided into five areas, namely common area (backbone area, standard area), STUB area, Totally STUB area, NSSA area, Totally NSSA area. While dividing the area, some router types are added: Internal Router (Internal Router), Area Border Router (ABR), Backbone Router (Backbone Router), Autonomous System Border Router ASBR (AS Boundary Router). By dividing the area and router type, a large AS is divided into multiple small areas, which is more convenient for flexible operation and management.

 

 

 

Disadvantages of RIP:

1. RIP is based on the UDP protocol, and the port number used is 520. No confirmation mechanism, no neighbor concept.

2. Slow convergence: RIP has three major timers: update timer 30s, aging timer 180s, and garbage collection timer 120s. The routing table is updated every 30s, and the time from failure to disappearance of a route is 300s in total.

3. Routing loop: the number of hops is small, the convergence is slow (the non-direct link failure waiting period is long), and it is easy to get out of the loop. RIP's anti-loop mechanism: 1. Split horizon; 2. Toxic reversal; 3. Trigger update.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326198782&siteId=291194637