Network Management (required): principles and features of Dynamic Routing Protocol OSPF (1)

Source: Internet
Author: User

Editor's note: In recent years, with the rapid development of computer network applications, new network products and network technologies have been further developed, which makes it possible to expand the computer network scale. OSPFOpen Shortest Path First) is a widely used routing protocol. It adopts an OSPF autonomous system. After reasonable planning, it can effectively expand the computer network scale. This section describes the principles and features of OSPF.

Introduction to Dynamic Routing Protocol

Routing and routing protocols

As the name suggests, dynamic routing is a protocol that dynamically generates (or learns) Route information. In the field of computer network interconnection technology, we can define routes as follows. routes are some path information that guides IP packet transmission. Dynamic Routing is one of the ways for network devices, such as routers, to learn route information in networks, these protocols enable the router to dynamically update the saved route table as the network topology changes (such as the failure of some paths or the generation of new routes, in a short period of time, the network administrator is not required to automatically maintain consistent routing information, so that the entire network can converge to maintain fast convergence and high availability of the network.

Routers learn route information and generate and maintain route tables by using Direct, Static, and Dynamic routes ). Direct Connection routing is discovered by the link layer protocol. It generally refers to the path of the network segment where the interface address to the router is located. The path information does not need to be maintained by the network administrator or calculated by the router through an algorithm, as long as this interface is Active, the router will fill in the routing information to this CIDR Block in the routing table. Direct Connection routing cannot allow the router to obtain the routing information that is not directly connected to it. Static Routing is the routing information configured on the router by the network planner using commands based on the network topology. The static routing information guides the packet transmission, and the static routing method does not need to be calculated by the router, however, it relies entirely on network planners. When the network scale is large or the network topology changes frequently, the work that the network administrator needs to do will be very complicated and prone to errors. The dynamic routing method enables the router to automatically calculate new route information according to specific algorithms to adapt to changes in the network topology.

Classification of Dynamic Routing Protocols

According to the region (Autonomous System), the dynamic routing Protocol can be divided into the Internal Gateway Protocol IGP (Interior Gateway Protocol) and the external Gateway Protocol EGP (Exterior Gateway Protocol). According to the algorithm, dynamic Routing Protocols include Distance Vector, Link State, and hybrid routing protocols developed by Cisco, as shown in figure 1.

This article focuses on the principles of OSPF in the autonomous system, and makes some simple comparisons based on distance vector protocol.


OSPF features

OSPF is called Open Shortest Path First. "Openness" indicates that it is a public agreement, which is formulated by a standard agreement organization. Each vendor can obtain the details of the agreement. "Shortest Path First" is the algorithm executed by the Protocol during route computing. OSPF is one of the most widely used and optimal performance protocols in the internal gateway protocol. It has the following features:

◆ Suitable for large-scale networks;

◆ Fast convergence of route changes;

◆ No route self-loop;

◆ Variable-length Subnet Mask (VLSM) is supported );

◆ Support equivalent routing;

◆ Supports region division;

◆ Provides Hierarchical Route management;

◆ Verification is supported;

◆ Supports sending protocol packets with multicast addresses.

An autonomous system using OSPF can support more than 1000 routers after reasonable planning. This performance is unmatched by distance vector protocols such as RIP. The distance vector routing protocol uses periodic transmission of the entire route table to ensure that the route information of routers in the network is consistent. This mechanism wastes network bandwidth and causes a series of problems, next we will give a brief introduction to this.

The speed of Route variation convergence is a key factor to measure the quality of a routing protocol. When the network topology changes, it is an important aspect of network availability that the routers in the network can notify each other of the changes in a short period of time and re-calculate the routes.

OSPF uses some technical means (such as SPF algorithm and neighbor relationship) to avoid the generation of self-ring routing. In the network, the generation of the routing self-loop will lead to a great cost of network bandwidth resources, and even make the network unavailable. The OSPF protocol avoids the generation of self-loops from the fundamental (algorithm itself. Using distance vector protocol (RIP) and other protocols, self-loop routing is inevitable. To improve these protocols, we can only take a number of measures to reduce the probability of Self-ring occurrence and the impact scope and time after self-ring occurrence.

In today's increasingly scarce IP (IPV4) addresses, it is very important for a routing protocol to support variable-length Subnet Mask (VLSM) to save IP Address resources, OSPF can meet this requirement.

In a network using the OSPF protocol, if OSPF is used to calculate two routes with equal cost (Metric) to the same destination, the protocol can add these equivalent routes to the routing table at the same time. In this way, load balancing or load balancing can be achieved during forwarding.

In terms of region division and route Classification Management, OSPF can be used in large-scale networks.

In terms of Protocol Security, OSPF uses verification. You can specify a password when you advertise route information between adjacent routers to determine the legitimacy of the adjacent routers.

Compared with broadcast methods, using multicast addresses to send protocol packets can save network bandwidth resources.

From the perspective of measuring the performance of the routing protocol, we can see that OSPF is indeed a relatively advanced dynamic routing protocol, which is also the main reason for its widespread adoption.

How OSPF works

Network Topology

As mentioned above, OSPF is a link status protocol. How does OSPF describe the link connection status?

Abstract Model 1 indicates that an Ethernet interface of a router is connected to only one Ethernet segment instead of other routers. In this case, router R1 running OSPF can only identify itself and cannot identify the devices (hosts, etc.) on this network segment ); abstract Model 2 indicates that router R1 is connected to a router R2 through a point-to-point link (such as PPP and HDLC); abstract Model 3 indicates that router R1 is connected to multiple points through a point-to-point (such as Frame Relay and X.25) links are connected to multiple routers such as R3 and R4. At this time, routers R5 and R6 are not interconnected. The abstract Model 4 indicates that routers R1 Use point-to-point (such as Frame Relay and X.25) links are connected to multiple routers R5 and R6. At this time, routers R5 and R6 are interconnected. The above abstract model focuses on the characteristics of various link layer protocols, without the specific details of link layer protocols. This model basically represents the connection type of the current network link.

The above four link state types are described in OSPF:

For the abstract Model 1 (Ethernet Link), use the Link ID (connected CIDR Block), Data (mask), Type (Type), and Metric (cost) to describe. At this time, the Link ID is the network segment of the router R1 interface, Data is the mask used, Type is 3 (Stubnet), and Metric is the value of generation.

For the abstract Model 2 (point-to-point Link), first use the Link ID (connected network segment), Data (mask), Type (Type), and Metric (cost) to describe interface routing, the preceding parameters are similar to Model 1. Next we will describe the peer router R2. The four parameter names remain the same, but their meanings are different. At this time, the Link ID is the Router ID of vror2, the Data is the interface address of vror2, the Type is 1 (Router), and Metric is still the value of substitution.

For the abstract Model 3 (point-to-point Link, not fully connected), first use the Link ID (connected network segment), Data (mask), Type (Type), and Metric (cost) the preceding parameters are similar to Model 1. Next we will describe the method of the Peer router R3 and R4 respectively, which is similar to the description of R2 in Model 2.

For the abstract Model 4 (point-to-point Link, full connectivity), first use the Link ID (the DR interface address in the network segment), Data (the address of this interface), Type (Type) and Metric (cost) to describe interface routing. At this time, the value of Type is 2 (Transnet), and then the connection announcement described in DR (specified router) in this section.

The router adds the LSA header (Link State Advertisement Head) before reporting the Link status (that is, the parameters described above) to generate an LSA (Link status broadcast ). At this point, the router completes the topology description of the surrounding network through LSA and sends it to other routers in the network.

Computing route

After the router completes the description of the topology of the surrounding network (generating LSA), it is sent to other routers in the network, and each router generates a link status database (LSDB ). The router begins to execute the SPF (Shortest Path First) algorithm to calculate the route. The router uses itself as the root node and compares the entries in LSDB with LSA. After several recursion and backtracking, until the router finds the path for all the CIDR blocks in the LSA (fill in the route table), it means that the type of the link to be reached is 3 (Stubnet ).

Ensure the reliability of LSA transmission between Routers

We can see from the above that the OSPF Working Mechanism of The Link Status Protocol is different from the routing protocol of the RIP equal distance vector. The Distance Vector Routing Protocol periodically sends the entire route table to ensure that the route information of the router in the network is consistent. This mechanism has some disadvantages mentioned above. The OSPF protocol separates the parts that contain route information from those that only contain the adjacent relationship between routers. It uses a packet called Hello to confirm the adjacent relationship. This packet is very small, it is only used to discover and maintain the adjacent relationship.

After router R1 Initialization is complete, it will send a Hello packet to router R2. At this time, R1 does not know the existence of R2. therefore, the data packet does not contain information about R2. (seen = 0 ). R2 sends a Hello packet to R1. In this case, the Hello packet indicates that it already knows that the neighbor R1 exists. When R1 receives this response packet, it will know the existence of the neighbor R2. Moreover, the neighbor R2. (seen = R1 ). In this case, the relationship between router R1 and R2 is established, and they can send the LSA to the other party. Of course, when sending OSPF, we will briefly introduce this content in the next section, considering the need to minimize the occupied bandwidth.

As we all know, the IP protocol is an unreliable and connectionless protocol, which has no validation or error retransmission mechanism. Therefore, based on this Protocol, to re-transmit data packets after data packet loss or errors, the upper-layer protocol must have such a reliable mechanism. OSPF adopts a mechanism similar to TCP validation and timeout retransmission. In the mechanism, R1 and R2 will exchange data packets called the Link State database description (DD. First, negotiate to determine the Master-slave relationship between the two (based on the vroidid, the Master with a large ID number will be used ). The link status database description (DD) data package contains some parameters, serial number (seq), message number (I), End mark (M), and Master/Slave sign (MS ). The secondary router uses the serial number (seq) in the DD package issued by the primary router as the serial number of its first DD package. When the primary router receives the DD packet from the secondary router, it can be confirmed that the adjacent router has received its own data packet (if the serial number of the DD packet that has not been received or received is not the serial number of its own DD packet, the primary router will re-transmit the previous DD packet), the primary router will add 1 to the serial number (only the primary router has the right to change the serial number, but not the secondary router), and send the next DD packet, this process ensures the accuracy of data packet transmission in the OSPF protocol, thus laying the foundation for the OSPF protocol to become an accurate routing protocol.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.