0% found this document useful (0 votes)
89 views24 pages

Distance Vector Routing Example

Distance vector routing is a dynamic distributed algorithm that uses the Bellman-Ford algorithm. Each node maintains a routing table with the estimated cost to reach destinations and the next hop. Nodes periodically exchange their routing tables with neighbors to update their costs. If a link or node fails, the failure is detected through missing periodic updates or probe messages, and the routing tables are updated accordingly.

Uploaded by

Abhiram Sayani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views24 pages

Distance Vector Routing Example

Distance vector routing is a dynamic distributed algorithm that uses the Bellman-Ford algorithm. Each node maintains a routing table with the estimated cost to reach destinations and the next hop. Nodes periodically exchange their routing tables with neighbors to update their costs. If a link or node fails, the failure is detected through missing periodic updates or probe messages, and the routing tables are updated accordingly.

Uploaded by

Abhiram Sayani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Distance Vector Routing

DISTANCE VECTOR ROUTING


• Dynamic Distributed Algorithm
• It is Routing Information Protocol
• It is used to find least cost path between two
nodes.
• Other name: BellmanFord Algorithm
• Firstly used in ARPANET later in Internet also.
DISTANCE VECTOR ROUTING
• Protocol Frame work
• Initial state at node: Distance(cost) to neighbors is
known.
• Final state at node: Distance(cost) to all nodes is
known, and also the next-hop.
• Nee to handle:
• - What information to exchange?
• - How to act on a message?
• - When to send a message?
DISTANCE VECTOR ROUTING
• State Maintained
• Each node maintains a routing table(Distance
Vector)
-Destination
- Estimated cost to destination
- Next hop via which
node to reach destination
Initial state: Cost to neighbors
DISTANCE VECTOR ROUTING
• Message Content
Each node exchanges with all its neighbors
“Routing Table “ information
-Destination and Estimated cost to destination
-Next hop information is not shared
DISTANCE VECTOR ROUTING
Action at a Router
-Bellman-Ford equation
-dx(y) = minv { C(x,v) + dv(y) }
- dx(y) – Least cost path from node x and y
- minv – Apply above equation for all x’s neighbors
DISTANCE VECTOR ROUTING
- On receiving a message from a neighbor V,
- Update cost(estimate) to destinations based on
above Bellman-Ford equation, Change next hop
accordingly.
- For each y (destination in routing table of the
received message)
- Dx(y) = min{current estimate, c(x,v)+Dv(y) }
- Estimate costs finally converge to optimal cost
after series of message exchanges.
DISTANCE VECTOR ROUTING
- Concept of Algorithm in brief
- A distance-vector routing (DVR) protocol requires that
a router inform its neighbors of topology changes
periodically. Historically known as the old ARPANET
routing algorithm (or known as Bellman-Ford
algorithm).
- Bellman Ford Basics – Each router maintains a
Distance Vector table containing the distance
between itself and ALL possible destination nodes.
Distances,based on a chosen metric, are computed
using information from the neighbors’ distance
vectors.
DISTANCE VECTOR ROUTING
- Information kept by DV router -
- Each router has an ID
- Associated with each link connected to a router,
- there is a link cost (static or dynamic).
- Intermediate hops

- Distance Vector Table Initialization -


- Distance to itself = 0
- Distance to ALL other routers = infinity number.
DISTANCE VECTOR ROUTING
Distance Vector Algorithm –
1. A router transmits its distance vector to each of its
neighbors in a routing packet.
2. Each router receives and saves the most recently
received distance vector from each of its neighbors.
3. A router recalculates its distance vector when:
It receives a distance vector from a neighbor
containing different information than before.
It discovers that a link to a neighbor has gone down.

The DV calculation is based on minimizing the cost to


each destination
DISTANCE VECTOR ROUTING
Distance Vector Algorithm –
- Dx(y) = Estimate of least cost from x to y
- C(x,v) = Node x knows cost to each neighbor v
- Dx = [Dx(y): y ∈ N ] = Node x maintains distance vector
- Node x also maintains its neighbors' distance vectors
- – For each neighbor v, x maintains Dv = [Dv(y): y ∈ N ]
- Note –

- From time-to-time, each node sends its own distance vector


estimate to neighbors.
- When a node x receives new DV estimate from any neighbor v, it
saves v’s distance vector and it updates its own DV using B-F
equation:
- Dx(y) = min { C(x,v) + Dv(y), Dx(y) } for each node y ∈ N
DISTANCE VECTOR ROUTING
Example – 1
- Select least cost between 2 nodes
- Bellman-Ford Algorithm is Distance Vector
Routing
- One routing table per node
- Bellman-Ford Algorithm defines at each node
DISTANCE VECTOR ROUTING
Example – 1
- If B as a Source
- Routing table per B
- B node to A node
- B-A 1
- B-C-A 8
- B-E-D-C-A 20
- Distance Vector Route table for B
DISTANCE VECTOR ROUTING
Example – 1
- If B as a Source
- Routing table per B
- B node to C node
- B-C 3
- B-A-C 6
- B-E-D-C 15
- Distance Vector Route table for B
DISTANCE VECTOR ROUTING
Example – 1
- If B as a Source
- Routing table per B
- B node to D node
- B-A-C-D 10
- B-C-D 7
- B-E-D 11
- Distance Vector Route table for B
DISTANCE VECTOR ROUTING
Example – 1
- If B as a Source
- Routing table per B
- B node to E node
- B-E 9
- B-C-D-E 9
- B-A-C-D-E 12
- Distance Vector Route table for B
DISTANCE VECTOR ROUTING
Example – 1
- If B as a Source
- Routing table per B
- While selecting take shortest
Path and less intermediate
nodes
Find DVR table for each node
Separately.
- Final updated table at B -
DISTANCE VECTOR ROUTING
Example
DISTANCE VECTOR ROUTING
Example
DISTANCE VECTOR ROUTING
Points to Note
- No topology change, converge in a few rounds
- After one message exchange ,each node knows
about nodes two hops away
- After two message exchanges, each node knows
about nodes three hops away
- And so on…..
- No node has global knowledge
- Fully Distributed, yet maintains correct views.
DISTANCE VECTOR ROUTING
Updates
- When to send a routing message to neighbors?
- Triggered update: Sent whenever the Distance
Vector changes
- Link/Node failure or cost increases
- Periodic update: Sent even when no change in
routing table
- To tell others that “I am still alive”
- Order: few seconds to few minutes
DISTANCE VECTOR ROUTING
Node/Link failure
How are node/link failures detected?
-Didn’t receive periodic update
-can also actively use probe ack message
DISTANCE VECTOR ROUTING
– Advantages of Distance Vector routing •
.It is simpler to configure and maintain than link state routing •
– Disadvantages of Distance Vector routing •
.It is slower to converge than link state •
.It is at risk from the count-to-infinity problem •
It creates more traffic than link state since a hop count change must •
be propagated to all routers and processed on each router. Hop count
updates take place on a periodic basis, even if there are no changes
.in the network topology, so bandwidth-wasting broadcasts still occur
For larger networks, distance vector routing results in larger routing •
tables than link state since each router must know about all other
.routers. This can also lead to congestion on WAN links
Note – Distance Vector routing uses UDP(User datagram protocol) •
.for transportation
DISTANCE VECTOR ROUTING
Summary
-Distance vector: Dynamic, distributed algorithm
that works with local knowledge
-Based on Bellman-Ford equation
Handles node/link failures

You might also like