0% found this document useful (0 votes)
11 views57 pages

DVRouting

The document discusses distance vector routing protocols. It explains the distance vector algorithm and how it is implemented in a distributed routing protocol. Nodes exchange routing information with neighbors to calculate least cost paths through the network.

Uploaded by

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

DVRouting

The document discusses distance vector routing protocols. It explains the distance vector algorithm and how it is implemented in a distributed routing protocol. Nodes exchange routing information with neighbors to calculate least cost paths through the network.

Uploaded by

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

CS 382: Network-Centric Computing

Distance Vector Routing

Zartash Afzal Uzmi


Spring 2023-24

ACK: Slides use some material from Scott Shenker (UC Berkeley) and Jim Kurose (UMass)
Agenda
⚫ Finish Up: Distance Vector Routing
⚫ Complexity
⚫ Count to infinity
⚫ Split horizon and Poisonous Reverse

⚫ Comparison of DV and LS
⚫ Scale and complexity

2
Recap: DV Routing (generally: links have costs)
d(x,z) represents the total cost
y over the path from x to z
2
x 7 u z
1 cost(x,y) represents the cost
w from x to a directly attached
neighbor y

d(x,z) = min{ cost(x,y) + d(y,z),


cost(x,u) + d(u,z),
cost(x,w) + d(w,z) }

Bellman-Ford equation 3
Three Node Network
to
x y z
x 0 2 7
from

y 2 0 1 y
z 7 1 0 2 1
x 7 z

d(x,z) = min{ cost(x,z),


cost(x,y) + d(y,z) }

4
Three Node Network
to
x y z
x 0 2 3
from

y 2 0 1 y
z 7 1 0 2 1
x 7 z

d(x,z) = min{ cost(x,z),


cost(x,y) + d(y,z) }

5
From Algorithm to Protocol
⚫ Algorithm:
⚫ Nodes use Bellman-Ford to compute distances

⚫ Protocol:
⚫ Nodes exchange distance vectors
⚫ Update their own routing tables
⚫ And exchange again….
⚫ Details: when to exchange, what to exchange, etc….

6
Overall Approach
⚫ Each node 𝒙 begins with an estimate 𝒅(𝒙, 𝒚) for all nodes 𝒚
⚫ An “estimate” of the cost of the least-cost path from itself to all nodes 𝒚
⚫ Why are we calling it an estimate?
⚫ It’s the cost along the currently known least-cost path – may get updated

⚫ Each node, 𝑥, maintains the following routing information:


1. For each neighbor 𝑣, the 𝑐𝑜𝑠𝑡(𝑥, 𝑣) from 𝑥 to a directly attached neighbor, 𝑣
2. Node 𝑥’𝑠 distance vector, containing 𝑥’𝑠 estimate of its cost to all destinations
3. The distance vectors of 𝑥’𝑠 neighbors

7
Overall Approach (Cont’d)
⚫ Each node sends a copy of its distance vector to each neighbor

⚫ Node 𝑥 receiving a new distance vector from a neighbor 𝑤


⚫ Saves 𝑤’𝑠 distance vector
⚫ Uses the Bellman-Ford equation to update its own distances vector

⚫ If node 𝑥’𝑠 distance vector changes, it sends its updated distance vector
to each of its neighbors

8
x y z
This is y’s x - - -
“distance vector” y 2 0 1
z - - -

y
2 1
x 7 z
to
x y z x y z
x 0 2 7 x - - -
from

y - - - y - - -
z - - - z 7 1 0
9
x y z
x 0 2 7
y 2 0 1
z 7 1 0

y
2 1
x 7 z
to
x y z x y z
x 0 2 7 x 0 2 7
from

y y 2 0 1
z z 7 1 0
10
x y z
x 0 2 7
y 2 0 1
z 7 1 0

y
2 1
x 7 z
to
x y z x y z
x 0 2 3 x 0 2 7
from

y 2 0 1 y 2 0 1
z 7 1 0 z 7 1 0
11
x y z
x 0 2 7
y 2 0 1
z 7 1 0

y
2 1
x 7 z
to
x y z x y z
x 0 2 3 x 0 2 7
from

y 2 0 1 y 2 0 1
z 7 1 0 z 3 1 0
12
x y z
x 0 2 3
y 2 0 1
z 3 1 0

y
2 1
x 7 z
to
x y z x y z
x 0 2 3 x 0 2 3
from

y 2 0 1 y 2 0 1
z 3 1 0 z 3 1 0
13
A More Complicated Case
⚫ The three-node network:
⚫ Everyone was neighbors with everyone else

⚫ What happens in a larger network?

14
x y v z Four Node Network
x - - - - x y v z
y 1 0 - 3
y - - - -
z - - - - v - - - -
y z - 3 1 0
1 3
x z
2 1
to
x y v z v
x x y v z
0 1 2 -
from

y - - - - x - - - -
v - - - - v 2 - 0 1
z - - - -
15
x y v z After first exchange
x 0 1 2 - x y v z
y 1 0 - 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z - 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z
x 0 1 2 -
from

y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 - 0 1
Let’s find d(x,z), which
z - 3 1 0
represents the total cost over 16

the path from x to z


x y v z Recomputing Tables
x 0 1 2 - x y v z
y 1 0 - 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z - 3 1 0
1 3
Let’s now find d(z,x) at router
z to update its DV
x z
2 1
to
x y v z v
x y v z
x 0 1 2 3
from

y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 - 0 1
z - 3 1 0
17
Let’s now find d(y,v) to x y v z Recomputing Tables
update the DV of y
x 0 1 2 - x y v z
y 1 0 - 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z 3 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z
x 0 1 2 3
from

y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 - 0 1
z - 3 1 0
18
x y v z Recomputing Tables
x 0 1 2 - x y v z
y 1 0 3 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z 3 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z Finally, update the DV of v
x 0 1 2 3
from

by finding d(y,v)
y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 - 0 1
z - 3 1 0
19
x y v z Recomputing Tables
x 0 1 2 - x y v z
y 1 0 3 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z 3 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z
x 0 1 2 3
from

y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 3 0 1
z - 3 1 0
20
x y v z Vectors distributed
x 0 1 2 3 x y v z
y 1 0 3 3
y 1 0 3 3
z 3 3 1 0 v 2 3 0 1
y z 3 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z
x 0 1 2 3
from

y 1 0 3 3 x 0 1 2 3
v 2 3 0 1 v 2 3 0 1
z 3 3 1 0
21
Distance Vector Routing

Cost to neighbor routers


Distances to all destinations
Send own DV to all neighbors

Receive DVs from neighbors – apply Bellman-Ford

Send updated own DV to all neighbors


22
Questions?

23
Other Aspects of Protocol
⚫ When to send messages?
⚫ When any of your distances d(u,v) change or the link cost changes to some
neighbor
⚫ Periodically, to ensure consistency between neighbors

⚫ What information to send?


⚫ Could send entire vector
⚫ Or just updated entries

⚫ Do we send every neighbor the same information?


⚫ Before answering: consider the following slides
24
x y z

y 2 0 1
z 3 1 0

Failed Link 2 y
1
x 7 z

x y z
What happens now?
y 2 0 1
z 3 1 0
25
x y z

y 4 0 1
z 3 1 0 routing loop!

y
1
x 7 z

x y z

y 2 0 1
z 3 1 0
26
x y z

y 4 0 1
z 3 1 0 routing loop!

y
1
x 7 z

x y z

y 4 0 1
z 3 1 0
27
x y z

y 4 0 1
z 3 1 0 routing loop!

y
1
x 7 z

x y z

y 4 0 1
z 5 1 0
28
x y z

y 4 0 1
z 5 1 0 routing loop!

y
1
x 7 z

x y z

y 4 0 1
z 5 1 0
29
x y z

y 6 0 1
z 5 1 0 routing loop!

y
1
x 7 z

x y z

y 4 0 1
z 5 1 0
30
x y z

y 6 0 1
z 5 1 0 routing loop!

y
1
x 7 z

x y z

y 6 0 1
z 5 1 0
31
x y z

y 6 0 1
z 5 1 0 routing loop!

y
1
x 7 z

x y z

y 6 0 1
z 7 1 0
32
x y z

y 6 0 1
z 7 1 0 routing loop!

y
1
x 7 z

x y z

y 6 0 1
z 7 1 0
33
x y z

y 8 0 1
z 7 1 0 routing loop!

y
1
x 7 z

x y z

y 6 0 1
z 7 1 0
34
x y z

y 8 0 1
z 7 1 0 routing loop!

y
1
x 7 z

x y z

y 8 0 1
z 7 1 0
35
x y z

y 8 0 1
z 7 1 0 routing loop!

y
1
x 7 z

“Count-to-Infinity” Scenario if c(x,z) x y z


was infinite
y 8 0 1
z 7 1 0
36
x y z

y 8 0 1 Routing loop are possible in


z 7 1 0 case of link failures and cost
changes!
y
1
x 7 z

“Count-to-Infinity” Scenario if c(x,z) x y z


was infinite
y 8 0 1
z 7 1 0
37
Why the loop?
⚫ Why would a router advertise a path back to the router which advertised
it?
⚫ Which doesn’t tell them anything new
⚫ Perhaps misleads the other router to think there is an independent path
⚫ And in case of failure (or link cost change), can lead to a loop
x y z

y 2 0 1 x y z
z 3 1 0
2 y
1 y 2 0 1
z 3 1 0
x 7 z 38
How can we fix this?
⚫ Solution: if a router is using a next-hop’s path, then:

⚫ Do not tell them that you independently have a path to destination


⚫ Called “split horizon”

⚫ OR…

⚫ Tell the other router not to use your path (by telling them cost of ∞)
⚫ Called “poisoned reverse”
⚫ A node is poisoning its route for a destination in its update message to the other
node
39
x y z

y 2 0 1
poisoned reverse z ∞ 1 0

2 y
1
x 7 z

x y z

y 2 0 1
z 3 1 0
40
x y z

y ∞ 0 1
poisoned reverse z ∞ 1 0

y
1
x 7 z

x y z

y 2 0 1
z 3 1 0
41
x y z

y ∞ 0 1
poisoned reverse z ∞ 1 0

y
1
x 7 z

x y z

y ∞ 0 1
z 3 1 0
42
x y z

y ∞ 0 1
poisoned reverse z ∞ 1 0

y
1
x 7 z

x y z

y ∞ 0 1
z 7 1 0
43
x y z

y ∞ 0 1
poisoned reverse z 7 1 0

y
1
x 7 z

x y z

y ∞ 0 1
z 7 1 0
44
x y z

y 8 0 1
z 7 1 0

y
1
x 7 z

x y z

poisoned reverse y ∞ 0 1
z 7 1 0
45
Homework Problem

Is it possible that we may still have a count-to-


infinity problem even with poisoned reverse?
Hint: Consider network topologies with more than 3 routers, and try to create
a count-infinity problem with poisoned reverse

46
More on Loops …
⚫ Routing loops can be alleviated by limiting the maximum number of hops
a packet can take
⚫ Customary for the packet header to include a hop-limit
⚫ Source sets this to some value larger than the number of hops it believes are
needed to get to the destination
⚫ Each switch/router decrements hop limit field by 1
⚫ If this field reaches 0, then it does not forward the packet

⚫ Loops can be avoided by exposing complete paths, instead of just


distance vectors
⚫ This method is used by BGP (next lecture)
47
DV Routing Complexity
⚫ Algorithm Complexity
⚫ In the worst case, how many computations
would a router have to perform when a
distance vector is received?

⚫ Message Complexity
⚫ How many messages would be exchanged
as neighbors share their distance vectors
(given e links)?

48
DV Routing Complexity
⚫ Algorithm Complexity
⚫ In the worst case, how many computations
would a router have to perform when a
distance vector is received?
⚫ O(N)

⚫ Message Complexity
⚫ How many messages would be exchanged
as neighbors share their distance vectors
(given 𝑒 links)?
⚫ At least 𝟐𝒆 messages. Why?

49
LS and DV: Key Difference
⚫ In Distance Vector Routing, each node
⚫ Shares routing information only with its directly connected neighbors
⚫ Routing information is the Distance Vector! What does that mean?
⚫ The shortest currently known distances to every node
⚫ These shortest distances may get updated when information propagates

⚫ In Link State Routing, each node


⚫ Floods/broadcasts routing information to all nodes in the entire network
⚫ What is routing information in this case?
⚫ Link state! What does that mean?
⚫ Cost of each directly connected link – only what a router knows for sure!
50
Summary: LS and DV Comparison
⚫ Link-State:
⚫ Global flood: each router’s link state (# ports)
⚫ Send it once per link event, or periodically
⚫ Message complexity: 𝑶(𝒏. 𝒆), Algorithm complexity = 𝑶(𝒏𝟐)
⚫ Distance-Vector:
⚫ Send longer vector (# destinations) just to neighbors
⚫ But might end up triggering their updates
⚫ Send it every time DV changes (which can be often)
⚫ Can run into count-to-infinity problems
⚫ Overall message and algorithm complexity can vary

51
Summary: LS and DV Comparison
⚫ LS vs. DV Tradeoff:
⚫ LS: Send it everywhere and be done in a predictable time
⚫ DV: Send locally, and perhaps iterate until convergence

52
What happens when routers lie?
⚫ What if router claims a 1-hop path to everywhere?
⚫ All traffic from nearby routers gets sent there

⚫ How can you tell if they are lying?


⚫ You can’t in DV
⚫ In LS both ends of link send updates

⚫ Can this happen in real life?


⚫ It has, several times….

53
Q: Can we scale either distance-vector or
link-state routing to the scale of the Internet?
Problem: neither distance-vector nor link-state
routing will scale to the size of the Internet
Preview of Next Lecture

56
Questions?

57

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy