Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

CSE/EE 461: Introduction to

Computer
Communications Networks
Autumn 2010

Module 10
Routing Overview

John Zahorjan
zahorjan@cs.washington.edu
534 Allen Center
This Module

Application
• Review of forwarding Presentation
• Computing routing tables Session
• The centralized explanation
Transport
Network
Data Link
Physical

11/8/2010 CSE 461 10au


Forwarding
142.150.210.12

R2
R1
Routing table
128.208.4.* R2
140.142.13.* R4

… …
R4

R3

140.142.13.107 140.142.13.107

128.208.4.1 128.208.4.3

11/8/2010 CSE 461 10au


Routing: Link Costs
142.150.210.12

2
R2 Routing table
R1

128.208.4.* R2
140.142.13.* R4
1 4
3
… …
R4

R3 2

140.142.13.107 140.142.13.107

128.208.4.1 128.208.4.3

11/8/2010 CSE 461 10au


Routing: Full Duplex Links
142.150.210.12

2
R2 Routing table
R1
1
128.208.4.* R2

3 140.142.13.* R4
1 4
2 1 5
… …
2 R4

R3 2

140.142.13.107 140.142.13.107

128.208.4.1 128.208.4.3

11/8/2010 CSE 461 10au


Routing as a Shortest Path Problem
• Routing table entries: [destination network, next hop router]

• To decide which router is on the next hop, want to find the


shortest path from the router to the destination network’s
router

• We’ll first look at sequential solutions, then distributed


– “Sequential”: full network topology information is available
– “Distributed”: must distribute information and perform
computation on each router

• We’ll first look at the single-destination / all-sources problem,


then all-destinations / all-sources

• One thing to look for:


– each router obtains a consistent view
• forwards on shortest path
• shortest paths don’t have loops!

11/8/2010 CSE 461 10au


First Approach: Greedy
• Dijkstra’s Algorithm

• Greedy:
– Build the spanning tree by adding routers to the current
spanning tree one at a time
– Choose next the as-yet-unadded router whose distance to
the destination is minimal
– Starting conditions:
• [0,-] at destination
• [∞, -] at every other router
• Spanning tree is the destination router alone

• Running time: O(E logV)

11/8/2010 CSE 461 10au


Dijkstra Example

∞,- ∞,- ∞,-

0,- ∞,- ∞,- ∞,-

∞,- ∞,- ∞,-

How do we know this works?

11/8/2010 CSE 461 10au


After One Step

2,A ∞,- ∞,-

0,- ∞,- ∞,- ∞,-

∞,- ∞,- ∞,-

How do we know this works?

11/8/2010 CSE 461 10au


After Two Steps

2,A ∞,- ∞,-

0,- ∞,- ∞,- ∞,-

4,A ∞,- ∞,-

How do we know this works?

11/8/2010 CSE 461 10au


After Three Steps

2,A ∞,- ∞,-

0,- 4,B ∞,- ∞,-

4,A ∞,- ∞,-

How do we know this works?

11/8/2010 CSE 461 10au


After Four Steps

2,A ∞,- ∞,-

0,- 4,B ∞,- ∞,-

4,A 5,C ∞,-

How do we know this works?

11/8/2010 CSE 461 10au


After Five Steps

2,A 6,D ∞,-

0,- 4,B ∞,- ∞,-

4,A 5,C ∞,-

How do we know this works?

11/8/2010 CSE 461 10au


After Six Steps

2,A 6,D ∞,-

0,- 4,B 7,E ∞,-

4,A 5,C ∞,-

How do we know this works?

11/8/2010 CSE 461 10au


After Seven Steps

2,A 6,D 7,E

0,- 4,B 7,E ∞,-

4,A 5,C ∞,-

How do we know this works?

11/8/2010 CSE 461 10au


After Eight Steps

2,A 6,D 7,E

0,- 4,B 7,E ∞,-

4,A 5,C 9,F

How do we know this works?

11/8/2010 CSE 461 10au


After Nine Steps

2,A 6,D 7,E

0,- 4,B 7,E 10,I

4,A 5,C 9,F

How do we know this works?

11/8/2010 CSE 461 10au


Second Approach: Iterative

• Bellman-Ford Algorithm

• Iterative:
– At each step, update [cost, next hop] for every router
based on [cost] at neighbors
– Starting conditions:
• [0,-] at destination
• [∞, -] at every other router

• Running time: O(VE) = O(V2D)


– V: number of vertices (routers)
– E: number of edges (links)
– D: average degree (#edges per vertex)

11/8/2010 CSE 461 10au


Bellman-Ford Example

∞,- ∞,- ∞,-

0,- ∞,- ∞,- ∞,-

∞,- ∞,- ∞,-

How long can it take to converge?

11/8/2010 CSE 461 10au


After One Iteration

2,A ∞,- ∞,-

0,- ∞,- ∞,- ∞,-

4,A ∞,- ∞,-

How long can it take to converge?

11/8/2010 CSE 461 10au


After Two Iterations

2,A 8,B ∞,-

0,- 4,B ∞,- ∞,-

4,A 5.C ∞,-

How long can it take to converge?

11/8/2010 CSE 461 10au


After Three Iterations

2,A 6,D 9,E

0,- 4,B 8,F ∞,-

4,A 5.C 9,F

How long can it take to converge?

11/8/2010 CSE 461 10au


After Four Iterations

2,A 6,D 7,E

0,- 4,B 7,E 10,I

4,A 5.C 9,F

How long can it take to converge?

11/8/2010 CSE 461 10au


After Five Iterations

2,A 6,D 7,E

0,- 4,B 7,E 10,I

4,A 5.C 9,F

How long can it take to converge?

11/8/2010 CSE 461 10au


Result

Note: The result is a spanning tree rooted at the destination

11/8/2010 CSE 461 10au


Moving to the Internet

• Routing table reflects spanning tree from source to


every destination
– Not really a big change
• Bellman-Ford: every destination is engaged in the procedure
• Dykstra: make the source the root, rather than the destination

• Have to distribute information


– Bellman-Ford: neighbor information about current costs to each
destination
– Dijkstra: full topology/cost information

• The process is on-going


– Not all routers boot at once

• Router/link failures can occur


– Link cost data isn’t static

11/8/2010 CSE 461 10au

You might also like