A distance-vector routing protocol is a protocol concept used in routing of packet-switched networks in computer communications, as in for example the Routing Information Protocol for Internet traffic.

Examples of distance-vector routing protocols include RIPv2 and EIGRP.

Workings

The distance-vector routing protocol assumes a network connected through several routers, each of which is connected to two or more computer networks. Each network may be connected to one or more routers.

The description below describes a very simple distance-vector routing protocol:

  1. Initially, the router makes a list of which networks it can reach, and how many hops it will cost. In the outset this will be the two or more networks to which this router is connected. The number of hops for these networks will be 1. This table is called a routing table.
  2. Periodically (typically every 30th second) the routing table is shared with other routers on each of the connected networks via some specified inter-router protocol. These routers will add 1 to every hop-count in the table, as it associates a hop cost of 1 for reaching the router that sent the table. This information is just shared inbetween physically connected routers ("neighbors"), so routers on other networks are not reached by the new routing tables yet.
  3. A new routing table is constructed based on the directly configured network interfaces, as before, with the addition of the new information received from other routers. The hop-count is used as a cost measure for each path. The table also contains a column stating which router offered this hop count, so that the router knows who is next in line for reaching a certain network.
  4. Bad routing paths are then purged from the new routing table. If two identical paths to the same network exists, only the one with the smallest hop-count is kept. When the new table has been cleaned up, it may be used to replace the existing routing table used for packet forwarding.
  5. The new routing table is then communicated to all neighbors of this router. This way the routing information will spread and eventually all routers know the routing path to each network, which router it shall use to reach this network, and to which router it shall route next.

Advantages and disadvantages

Distance-vector routing protocols are simple and efficient in small networks. However, they do not scale well, and have poor convergence properties, which has led to the development of more complex but more scalable link-state routing protocols for use in large networks.