A general routing algorithm for route selection

Source: Internet
Author: User

The purpose of this article is to help readers understand routing choices and to help readers.
Traffic packets from a starting point through the router to reach the destination often have more than one route to choose, there are static routes, there are dynamic routing protocol, a variety of routes, so how the router from a number of routes to choose the best route? How did it do that? This is because the router calculates the optimal route based on the routing algorithm, and the router typically chooses some of the appropriate routes based on the longest matching principle, then removes some routes from those routes again based on their administrative distance, and then selects them again from the two selected routes based on their measurements. If the last remaining route is the same as the longest matching principle, the same as the management distance, the measure is the same, the router will load balance these routes;
In fact, the route selection algorithm chooses the route to want to match the knockout, will pass through the first round "the longest matching principle" knockout, the second round "the Management Distance" knockout, the third round "The measure" knockout, finally obtains "the optimal route"
what is the "longest matching principle"?
When the router receives an IP packet destined for the destination, the destination IP address of the packet and the route in the routing table are looked up by bit, until the longest matching entry is found, which is called the longest matching principle. In layman's terms, for example, when the router receives an IP packet to 2.2.2.2, and the router has 3 routes to 2.2.2.2 in the table entry, respectively, 2.0.0.0/8,2.2.0.0/16,2.2.2.0/ 24, the router in the destination IP and its own routing table in the route to a bit a bit match, it is obvious that the final match is the highest 2.2.2.0/24 this route, this is the longest matching principle.
What is the "Managed Distance" (AD)?
If a route is declared in many ways, such as static routing, RIP,OSPF and other dynamic routing protocols, the routing table chooses the route according to the confidence of the different routing protocols, and is represented by the administrative distance.
The smaller the administrative distance, the higher the confidence of the route, and the managed distance of 1 for the static route, indicating that the manually entered route priority is higher than the other routes.

What is the last "measure"?
When a routing protocol has multiple paths to a destination network, the routing protocol must determine which one is the best and put it in the routing table, and the routing protocol calculates a number for each path, which is the measure, which is usually not a unit of value. The smaller the measure, the better the path. However, different routing protocols define metrics differently, so the best distances chosen by different routing protocols may not be the same.
So how do each routing protocol calculate a metric?

A general routing algorithm for route selection

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.