Detailed analysis of the principles and features of Dynamic Routing Protocol

Source: Internet
Author: User

With the development of routes, there are many types of routing protocols. So I have studied the practical application and detailed introduction of dynamic routing protocols. I will share with you here, I hope it will be useful to you. 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 dynamic routing 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 ). A direct connection route is found by the link layer dynamic routing 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, the router does not need to calculate the IP address through a certain algorithm. As long as the interface is Active, the router will enter the route information to the CIDR Block in the routing table, direct Connection routing cannot allow the router to obtain route 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 (InteriorGatewayProtocol) and the external gateway protocol EGP (ExteriorGatewayProtocol). According to the algorithm, dynamic Routing Protocols include DistanceVector, LinkState, and hybrid dynamic routing protocols developed by Cisco.

Characteristics of OSPF Dynamic Routing Protocol

OSPF is called Open Shortest Path First. "Openness" indicates that it is a public protocol, which is organized by a standard protocol. Each vendor can obtain details about the dynamic routing protocol. "Shortest Path First" is the algorithm executed by the dynamic routing protocol during route computing. OSPF is a dynamic route that is most widely used and has the best performance in the internal gateway protocol.

An autonomous system using OSPF dynamic routing protocol can support more than 1000 routers after reasonable planning. This performance is unmatched by distance vector dynamic routing, such as RIP. The Distance Vector dynamic routing protocol uses periodic transmission of the entire route table to ensure that the route information of the 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 performance of a dynamic 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. In order to improve these dynamic routing protocols, we can only take a number of measures to reduce the probability of occurrence during the lifetime of the Self-loop, and reduce the impact scope and time after the occurrence of the Self-loop. 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 OSPF dynamic routing protocol, if OSPF is used to calculate two routes with equal cost (Metric) to the same destination, this 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, the OSPF dynamic routing protocol can be used in large-scale networks. In terms of Protocol Security, the OSPF verification is used, when you advertise route information between adjacent routers, you can specify a password to determine the legitimacy of the adjacent router. Compared with the broadcast method, 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.

Working principle of OSPF Dynamic Routing Protocol

As mentioned above, the OSPF dynamic routing protocol is a link-state dynamic routing protocol. How does OSPF describe the link connection status? The abstract model Model1 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 Model2 indicates that router R1 is connected to a router R2 through a point-to-point link (such as PPP and HDLC); abstract model Model3 indicates that router R1 is connected to multiple points through a point-to-point (such as FrameRelay 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 Model4 indicates that routers R1 Use point-to-point (such as FrameRelay 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 dynamic routing protocols, without the specific details of link layer dynamic routing protocols. This model basically represents the connection type of the current network link.

The above four link status types are described in OSPF dynamic routing protocol.

For the abstract model Model1 (Ethernet link), use LinkID (connected CIDR Block), Data (mask), Type (Type), and Metric (cost) to describe. At this time, the LinkID 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 Model2 (point-to-point link), first use LinkID (connected network segment), Data (mask), Type (Type), and Metric (cost) to describe interface routing, the preceding parameters are similar to Model1. Next we will describe the peer router R2. The four parameter names remain the same, but their meanings are different. At this time, the LinkID is the RouterID 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 Model3 (point-to-point link, not fully connected), use the LinkID (connected network segment), Data (mask), Type (Type), and Metric (cost) the preceding parameters are similar to Model1. Next we will describe the method of the Peer router R3 and R4 respectively, which is similar to the description of R2 in Model2.

For the abstract model Model4 (point-to-point link, full connectivity), use the LinkID (the DR interface address in the network segment), Data (the address of this interface), and 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 (LinkStateAdvertisementHead) before reporting the link status (the parameter described above) to generate 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

As we can see from the above, as the OSPF working mechanism of the link status dynamic routing protocol, it is different from the dynamic routing protocol of the RIP distance vector. The Distance Vector dynamic 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 dynamic routing protocol separates the parts that contain route information from those that only contain the neighbor relationship between routers. It uses a packet called Hello to confirm the neighbor relationship, this packet is very small and 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, connectionless dynamic routing 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 packet transmission in OSPF dynamic routing protocol, thus laying the foundation for OSPF to become an accurate dynamic 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.