Routing Algorithm
Among all the dynamic routing protocols, the simplest is the distance vector routing protocol D-V ). It uses the simplest Distance Vector Distance-Vector (D-V) routing algorithm. Algorithm Model 1 is shown in.
Figure 1 Distance Vector Routing Protocol Algorithm Model
Set the overhead between any two points x and y as M (x, y). The overhead between F and A in Figure 1 is
MF, A) = minM (F, C) + M (C, A), M (F, E) + M (E, A), M (F, G) + M (G, ))
Note: C, E, and G are all adjacent routers of F. The realization idea of the D-V algorithm is as follows. To calculate the route from any router to a specific destination network, the overhead from the router to the adjacent router and the overhead from the adjacent router to the specific destination network and the optimal value are obtained.
The Distance Vector Algorithm accumulates the network distance through the above method and maintains the network topology information database. From the vector protocol, all information of the route table is sent directly to the neighbor RIP Protocol. The default value is 30 seconds ). The router in the network obtains the route information from its neighbor router, and sends the route information together with its local route information to other neighbors, so that it can be transmitted at the first level to achieve full network synchronization. Each router does not understand the entire network topology. They only know the network conditions that are directly connected to themselves, and update their route tables based on the route information obtained from the neighbors. All its information relies on hearsay. It believes that all the information that all its neighbors tell it is used only by the best among these neighbors, similar to the game of "messaging.
Route discovery
In Figure 2, the upper left is the initial route table of R1, the upper right is the initial route table of R2, and R1 and R2 are adjacent. After the routing information is exchanged, it is found that R1 has another route: the route to the N4 network, the next hop is learned from R2 ); r2 learns three routes from R1, And the next hop is R1. Because all routes are learned from R1, the next hop is R1.
Figure 2 routing discovery of Distance Vector Routing Protocol