Distance Vector Routing
Distance Vector Routing
DISTANCE VECTOR
ROUTING
(DVR)
~ HARSHINI R
INTRODUCTION
In an internet, the goal of the network layer is to
deliver a datagram from its source to its
destination or destinations.
A datagram is a self-contained unit of data
that is sent over a network to transmit data
between nodes such as computers or servers. It
is also known as a packet.
If a datagram is destined for only one
destination (one-to-one delivery), we have
unicast routing.
If the datagram is destined for several
destinations (one-to-many delivery), we have
multicast routing.
UNICAST VS MULTICAST VS BROADCAST
UNICAST ROUTING- GENERAL IDEA
In unicast routing, a packet is routed, hop by hop, from its
source to its destination by the help of forwarding tables.
The source host needs no forwarding table because it
delivers its packet to the default router in its local
network.
The destination host needs no forwarding table either
because it receives the packet from its default router in
its local network.
Routing
This means that only the routers that glue together the
networks in the internet need forwarding tables.
Routing determines the best path for these packets to travel
across networks.
Forwarding ensures that packets move from one network to
another until they reach their destination. Forwarding
DISTANCE VECTOR ROUTING
In DVR, the first thing each node
creates is its own least-cost tree
with the rudimentary information it
has about its immediate neighbors.
The incomplete trees are
exchanged between immediate
neighbors to make the trees more
and more complete and to
represent the whole internet.
We can say that in DVR, a router
continuously tells all of its neighbors
what it knows about the whole
internet (although the knowledge Distance Vector Routing
can be incomplete).
BELLMAN-FORD EQUATION
The heart of distance-vector routing is the famous Bellman-Ford equation.
This equation is used to find the least cost (shortest distance) between a source node, x,
and a destination node, y, through some intermediary nodes (a, b, c, . . .) when the costs
between the source and the intermediary nodes and the least costs between the
intermediary nodes and the destination are given.
The following shows the general case in which Dij is the shortest distance and cij is the
cost between nodes i and j.
In distance-vector routing, normally we want to update an existing least cost with a least
cost through an intermediary node, such as z, if the latter is shorter. In this case, the
equation becomes simpler, as shown below:
BELLMAN-FORD EQUATION
We can say that the Bellman-Ford equation enables us to build a new least-cost path
from previously established least-cost paths.
In the figure, we can think of (a→y), (b→y), and (c→y) as previously established least-cost
paths and (x→y) as the new least-cost path.
We can even think of this equation as the builder of a new least-cost tree from previously
established least-cost trees if we use the equation repeatedly.
In other words, the use of this equation in distance-vector routing is a witness that this
method also uses least-cost trees, but this use may be in the background.
An internet and its graphical representation Least-cost trees for nodes in the internet
DISTANCE VECTORS
The name of the distance vector defines the
root, the indexes define the destinations,
and the value of each cell defines the least
cost from the root to the destination.
A distance vector does not give the path to
the destinations as the least-cost tree does;
it gives only the least costs to the
destinations.
We know that a distance vector can
represent least-cost paths in a least-cost
tree, but the question is how each node in
an internet originally creates the
corresponding vector.
The first distance vector tree for an internet
DISTANCE VECTORS
Each node in an internet, when it is booted, creates a very rudimentary distance vector
with the minimum information the node can obtain from its neighborhood.
The node sends some greeting messages out of its interfaces and discovers the identity
of the immediate neighbors and the distance between itself and each neighbor.
It then makes a simple distance vector by inserting the discovered distances in the
corresponding cells and leaves the value of other cells as infinity.
Do these distance vectors represent least-cost paths? They do, considering the limited
information a node has. When we know only one distance between two nodes, it is the
least cost.
These rudimentary vectors cannot help the internet to effectively forward a packet.
For example, node A thinks that it is not connected to node G because the corresponding
cell shows the least cost of infinity.
To improve these vectors, the nodes in the internet need to help each other by
exchanging information.
DISTANCE VECTORS
After a node receives a distance vector from a neighbor, it updates its distance vector
using the Bellman-Ford equation.
However, we need to understand that we need to update, not only one least cost, but N
of them in which N is the number of the nodes in the internet.
If we are using a program, we can do this using a loop; if we are showing the concept on
paper, we can show the whole vector instead of the N separate equations.
In the first event, node A has sent its vector to node B. Node B updates its vector using
the cost cBA = 2. In the second event, node E has sent its vector to node B. Node B
updates its vector using the cost cEA = 4.
After the first event, node B has one improvement in its vector: its least cost to node D
has changed from infinity to 5 (via node A). After the second event, node B has one
more improvement in its vector; its least cost to node F has changed from infinity to 6
(via node E).
DISTANCE VECTORS
~ HARSHINI R