When there are multiple paths to a network, the router chooses the optimal path based on what, in general, routers choose the best route based on the following metrics.
1, jump number
It can simply record the number of passes through the router. For example, the data is emitted from router A, and after Router B arrives at another network, the hop count is 1, and if it passes through C to another network, it passes through a router of 2, and its hop count is 2. In RIP, the hop number is the main criterion for the path, its maximum hop number is 16, more than 16 is not reachable.
2, bandwidth
Generally choose a high bandwidth path, but not the main criteria, if the link bandwidth in the T1 line, it may not select this link.
3. Load
The load reflects the traffic size of the link along the way. The optimal path should be the lowest load path. The load does not change as the load on the path is the same as the bandwidth or hop count, and the metric changes accordingly. Be careful here, if the metric changes too frequently, it will cause routing oscillation, routing oscillation will have a negative impact on the router's CPU, data link bandwidth and the champion's stability.
4, delay
The delay is the time that the message passes through the link, and the routing protocol using delay as the measure will use the best path of the less delay link. There are many methods to calculate the delay, not only the chain delay, but also the processing time delay and queue delay of the router are considered. On the other hand, routing delays may not be measurable at all. Therefore, the delay may be the sum of the static delay defined by each interface along the road.
5. Reliability
This single link is used to measure the likelihood of a failure of the links in some way. Reliability can be varied or fixed. High-reliability links will be preferred.
6. Cost
This metric has administrator settings to reflect the enlistment of the route. The cost of a link is defined by any policy or link attribute. At the same time, the expense can also reflect the network administrator's subjective consciousness.
Generally, the above measures are not used alone, and are generally used in a comprehensive way to compute the best path through some algorithm. We should use it flexibly in our application.