RIP Distance Vector Algorithm

Source: Internet
Author: User

The concept of distance vector algorithm is very simple: All routers that participate in the RIP Protocol periodically refresh the route refresh packets. The main content is a route refresh packet consisting of many route entry entries. For routing, the main content is the destination address and next hop address ).
For dynamic routing protocols, you must pay attention to the overhead metric of routes in order to find the optimal route in this Protocol concept ). Therefore, the route entry mainly includes the destination address, Next Hop address, and route overhead. Other content, such as the route tag, will be detailed in the packet format.

During the design, another RIP of Each router manages a routing database. This routing database contains a route entry for all possible sinks in the system and retains the following information for each sink:

· Destination Address: In algorithm IP implementation, this refers to the IP address of the host or network.
· Next hop address: the first router in the destination route.
· Interface: used to connect to the next hop physical network.
· Metric value: a number that specifies the overhead from the router to the sink.
· Timer: The last time the route entry was modified.
· Route Tag: Indicates whether a route is an internal route protocol or an external route protocol route.

The database is initialized by the description of the entity directly connected to the system, and is modified and maintained by the packet received from the adjacent router.

The most important information exchanged between routers is to modify packets. The routers participating in the route maintenance plan send the route modification packets that currently exist in the physical description of the routing database. The Optimal Route of the entire system can be maintained only by exchanging route information between adjacent routers. This will be gradually proved in the following discussions.

Distance vector algorithms are always based on the fact that routes in the routing database are currently the best routes obtained through Packet Exchange. At the same time, Packet Exchange is limited to adjacent entities, that is, entities share the same network. Of course, to define a route is the best, there must be a measurement method, which uses the aforementioned "metric ". In a simple network, a simple metric value is calculated based on the number of vrouters that use feasible routes. In a complex network, metric generally indicates the delay or other sending overhead of the route data transmission.

Make D (I, j) represent the metric value of the optimal route from entity I to entity j. di, j) represents the overhead from I to j, because the overhead can be added, the best route in the algorithm is obtained as follows:

Di, I) = 0, for all I
Di, j) = MIN [di, j) + Dk, j), when I is not equal to k

Entity I receives an estimate of the overhead from k to j from the neighboring router k D (I, j), I will Di, j) plus the overhead estimation of I to k di, j ), I compares the values obtained from all adjacent routers and obtains the minimum number to obtain the optimal route from it to j.

Specifically, the distance vector algorithm is described as follows:

First, when the router is started, the Distance Vector Route table V-D route table) initialization, the initialization route table contains all the paths to the network directly connected to the router. Since the directly connected network does not pass through the intermediate router, the distance between each route in the initialized V-D route table is 0.

Figure 2.1 example of an initial V-D route table.

Figure 2.1 IP addresses of the "chinanetcenter" Domain

Then, Each router periodically broadcasts the contents of its V-D route table. A vro that is directly connected to a vro in the same physical network receives the route table packet and refreshes the local route table based on the packet. When refreshing, the router checks the V-D packets from the neighboring router one by one. When encountering one of the following table, the local route table must be modified assuming that the router Gi receives the V-D packet from the router Gj ):

1) No. The Gi route table must contain the corresponding table. The "sink" is the sink in the Gj table, and its "path" is "Gj", that is, the next vro is Gj ).

2) The distance from Gj to a destination is smaller than the distance from Gi to the destination.
This indicates that the distance between Gi and a destination is shorter if it passes through Gj. Then, Gi modifies the current table, where the "sink" field remains the same, "distance" is the distance plus 1 in the Gj table, and "path" is "Gj ".

3) The Gi route goes through Gj, while the Gj route changes to the destination.
There are two situations:

A. Gj's V-D table no longer contains a route to a destination, the corresponding route in GI must be deleted.
B. the routing distance to a destination in the Gj V-D table changes, the corresponding table "distance" In Gi must be modified, and the original distance is replaced by the "distance" and 1 in Gj.

Figure 2.2 provides an intuitive description of the above description, where Gi and Gj are adjacent routers.

A) original router Gi route table

B) router Gj broadcast V-D packets

C) route table refreshed by vroggj

Here, it should be particularly emphasized that the V-D algorithm routing refresh occurs between neighboring routers, so V-D packets are not necessarily sent out in broadcast mode, A kind of optimization idea is that the router directly sends the V-D packet to the adjacent router, and does not need to adopt the broadcast method.

Related Articles]

  • RIP Protocol restrictions
  • RIP Message format
  • RIP route table

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.