Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia...

13
Network Technologies essentials Week 5: Routing n made by Tim Moors, UNSW Australia lides by David Wetherall, University of Washington 133766624 © 2014 ok A. Tanenbaum and D. Wetherall : Computer Networks, 5 th ed , Prentic Tim added green graffiti

Transcript of Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia...

Page 2: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 2

Shortest Paths (4)• Optimality property:

– Subpaths of shortest paths are also shortest paths

• ABCE is a shortest pathSo are ABC, AB, BCE, BC, CE A B

C

D

E

F

G

H

2

1

10

2

24

24

4

3

3

3

5-2.7

Page 3: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 3

Dijkstra’s AlgorithmAlgorithm:

• Mark all nodes tentative, set distances from source to 0 (zero) for source, and ∞ (infinity) for all other nodes

• While tentative nodes remain:– Extract N, a node with lowest distance– Add link to N to the shortest path tree– Relax the distances of neighbors of N by

lowering any better distance estimates5-3.4

Page 4: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 4

Dijkstra’s Algorithm (2)• Initialization

A B

C

D

E

F

G

H

2

1

10

2

24

24

4

33

3

0 ∞

∞ ∞

We’ll compute shortest paths

from A ∞5-3.5

Page 5: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 5

Distance Vector AlgorithmEach node maintains a vector of distances (and next hops) to all destinations

1. Initialize vector with 0 (zero) cost to self, ∞ (infinity) to other destinations

2. Periodically send vector to neighbors3. Update vector for each destination by

selecting the shortest distance heard, after adding cost of neighbor link– Use the best neighbor for forwarding

5-4.5

Page 6: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 6

DV Example (4)• Second exchange for all nodes to find best 2-hop routes

A learnsCost Next

0 --

3 B

9 D

6 B

To A says

B says

C says

D says

A 0 3 ∞ 7

B 3 0 6 3

C ∞ 6 0 2

D 7 3 2 0

= learned better routeB

C

D

A2

6

7

3

3

B learnsCost Next

3 A

0 --

5 D

3 D

C learnsCost Next

9 B

5 D

0 --

2 D

D learnsCost Next

6 B

3 B

2 C

0 --

5-4.9

Page 7: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 7

Forwarding with ECMP (2)

A B

C

D

E

F

G

H

2

2

10

1

14

24

4

3

3

3

Multipath routes from F/E to C/H E’s Forwarding Choices

Flow Possiblenext hops

Example choice

F H C, D DF C C, D DE H C, D CE C C, D C

Use both paths to getto one destination

5-7.9

Page 8: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 8

Hierarchical Routing (4)• Penalty is longer paths

1C is best route to region 5, except for destination 5C

5-9.10

Page 9: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 9

Subnets• Internally split up one IP prefix

64K addresses

One prefix sent to rest of Internet16K

32K

8K Company Rest of Internet

5-10.7

Page 10: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 10

Routing Policies – Transit• One party (customer) gets

TRANSIT service from another party (ISP)– ISP accepts traffic from customer

to deliver to the rest of Internet– ISP accepts traffic from the rest of

the Internet to delivery to customer– Customer pays ISP for the privilege

Customer 1

ISP

Customer 2

Rest ofInternet

Non-customer

5-11.7

Page 11: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 11

Routing Policies – Peer• Both party (ISPs in example) get

PEER service from each other– Each ISP accepts traffic from the

other ISP only for their customers– ISPs do not carry traffic to the rest

of the Internet for each other– ISPs don’t pay each other

Customer A1

ISP A

Customer A2

Customer B1

ISP B

Customer B2

5-11.8

Page 12: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 12

BGP Example• AS2 buys TRANSIT service from AS1 and PEER service from AS3

5-12.8

← B, AS3→ A, AS2

← C, AS4→ B, AS3

↑ C, AS4↓ A, AS1,AS2↓ B, AS1, AS3

↑ A, AS2↓ B, AS1, AS3↓ C, AS1, AS4

↑ B, AS3↓ A, AS1, AS2↓ C, AS1, AS4

Page 13: Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington.

Computer Networks 13

END

© 2013 D. Wetherall

Slide material from: TANENBAUM, ANDREW S.; WETHERALL, DAVID J., COMPUTER NETWORKS, 5th Edition, © 2011. Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey