CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by...

87
CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis,

Transcript of CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by...

Page 1: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

CPS-356- Computer NetworksClass 9: IP-Continued

Theophilus Benson

Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti

Page 2: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Administrivia

• Slides Updates– Class slides 08 updated– Class slides 06 updated– Class slides 07 uploaded–

• HW #1 put up on site

• Can we move exams?

Page 3: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Distance Vector Recap

A

B

C

4 1

10

• Neighbor information is preconfigured– The link cost to a neigh and the link to that neighbor

• Nodes exchange message with neighbors– (cost, dest)

• Pick the shortest paths

A 4 A

C 1 C

A 10 A

B 1 B

B 4 B

C 10

C

Page 4: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Distance Vector Recap

A

B

C

4 1

10

• Neighbor information is preconfigured– The link cost to a neigh and the link to that neighbor

• Nodes exchange message with neighbors– (cost, dest)

• Pick the shortest paths

A 4 A

C 1 C

A 10 A

B 1 B

B 4 B

C 10

C

(B,4)(C,10)

(A,10)(B,1)

(A,4)(C,1)

Page 5: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Distance Vector Recap

A

B

C

4 1

10

• Pick the shortest paths

A 4 A

C 1 C

A 10 A

B 1 B

B 4 B

C 10

C

From A(B,4), (C,10)

From C(A,10), (B,1)

From B(A,4), (C,1)From C

(A,10), (B,1)From A

(B,4), (C,10)From B(A,4), (C,1)

Page 6: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Distance Vector Recap

A

B

C

4 1

10

• Pick the shortest paths

A 4 A

C 1 C

A 10 A

B 1 B

B 4 B

C 10

C

From A(B,4), (C,10)

From C(A,10), (B,1)

From B(A,4), (C,1)From C

(A,10), (B,1)From A

(B,4), (C,10)From B(A,4), (C,1)

Page 7: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Distance Vector Recap

A

B

C

4 1

10

• Pick the shortest paths

A 4 A

C 1 C

A 5 B

B 1 B

B 4 B

C 5 B

From A(B,4), (C,10)

From C(A,10), (B,1)

From B(A,4), (C,1)From C

(A,10), (B,1)From A

(B,4), (C,10)From B(A,4), (C,1)

Page 8: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Distance Vector Recap

A

B

C

4 1

10

• Pick the shortest paths• Update message are triggered by– Change in Routing Table– Or periodically every N seconds, by a timer

A 4 A

C 1 C

A 5 B

B 1 B

B 4 B

C 5 B

(B,4)(C,5)

(A,5)(B,1)

Page 9: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Good news travels fast

A

B

C

4 1

10

1

• A decrease in link cost has to be fresh information• Network converges at most in O(diameter) steps

A 4 A

C 1 C

A 5 B

B 1 B

B 4 B

C 5 B

Page 10: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Good news travels fast

A

B

C

4 1

10

1

• A decrease in link cost has to be fresh information• Network converges at most in O(diameter) steps

A 1 A

C 1 C

A 5 B

B 1 B

B 1 B

C 5 B

(B,1)(C,10)

(A,1)(C,1)

Page 11: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Good news travels fast

A

B

C

4 11

• A decrease in link cost has to be fresh information• Network converges at most in O(diameter) steps

A 1 A

C 1 C

A 5 B

B 1 B

B 1 B

C 5 B(B,1)

(C,10)

(A,1)(C,1)

10

Page 12: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Good news travels fast

A

B

C

4 11

• A decrease in link cost has to be fresh information• Network converges at most in O(diameter) steps

A 1 A

C 1 C

A 2 B

B 1 B

B 1 B

C 5 B(B,1)

(C,10)

(A,1)(C,1)

10

Page 13: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Good news travels fast

A

B

C

4 11

• A decrease in link cost has to be fresh information• Network converges at most in O(diameter) steps

A 1 A

C 1 C

A 2 B

B 1 B

B 1 B

C 2 B 10

(A,2)(B,1)

(B,1)(C,2)

Page 14: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10• An increase in cost may cause confusion with old information, may form loops• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 1 A

C 1 C

A 5 B

B 1 B

B 1 B

C 5 B

Page 15: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A6C

A 4 A

C 1 C

A 5 B

B 1 B

B 1 B

C 5 B

Page 16: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 12 A

C 1 C

A 5 B

B 1 B

B 12

B

C 13

B

Page 17: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 12 A

C 1 C

A 5 B

B 1 B

B 12

B

C 13

B

(A,5)(B,1)

Page 18: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 6 C

C 1 C

A 5 B

B 1 B

B 11

C

C 10

C

(A,5)(B,1)

Page 19: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 6 C

C 1 C

A 5 B

B 1 B

B 11

C

C 10

C

(A,6)(C,1)

Page 20: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 6 C

C 1 C

A 7 B

B 1 B

B 11

C

C 10

C

(A,6)(C,1)

Page 21: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 6 C

C 1 C

A 7 B

B 1 B

B 11

C

C 10

C

(A,7)(B,1)

Page 22: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 8 C

C 1 C

A 7 B

B 1 B

B 11

C

C 10

C

(A,8)(C,1)

Page 23: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 8 C

C 1 C

A 9 B

B 1 B

B 11

C

C 10

C

(A,9)(B,1)

Page 24: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 10 C

C 1 C

A 9 B

B 1 B

B 11

C

C 10

C

(A,10)(C,1)

Page 25: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

A

B

C

4 1

10

12

• An increase in cost may cause confusion with old information, may form loops

• Consider routes to A• Initially, B:A,4,A; C:A,5,B• Then B:A,12,A, selects C as next hop -> B:A,6,C• C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C;• C finally chooses C:A,10,A, and B -> A,11,C!

A 10 C

C 1 C

A 10 A

B 1 B

B 11

C

C 10

C

(A,10)(C,1)

(A,10)(B,1)

Page 26: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

How to avoid loops

• IP TTL field prevents a packet from living forever– Does not repair a loop

• Simple approach: consider a small cost n (e.g., 16) to be infinity– After n rounds decide node is unavailable– But rounds can be long, this takes time

• Problem: distance vector based only on local information

Page 27: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bad news travels slowly

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

12

A 6 C

C 1 C

A 5 B

B 1 B

B 11

C

C 10

C

(A,6)(C,1)

(A,5)(B,1)

Page 28: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Better loop avoidance

• Split Horizon– When sending updates to node A, don’t include

routes you learned from A– Prevents B and C from sending cost 2 to A

• Split Horizon with Poison Reverse– Rather than not advertising routes learned from A,

explicitly include cost of ∞.– Faster to break out of loops, but increases

advertisement sizes

Page 29: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Split Horizon

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

A 4 A

C 1 C

A 10 A

B 1 B

B 4 B

C 10

C

(B,4)(C,10)

(A,10)(B,1)

(A,4)(C,1)

Page 30: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Split Horizon

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

A 4 A

C 1 C

A 5 B

B 1 B

B 4 B

C 5 B

(B,4)(C,10)

(A,10)(B,1)

(A,5)(B,1)

(B,4)(C,5)

Page 31: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Split Horizon

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

A 12 A

C 1 C

A 5 B

B 1 B

B 12

B

C 13

B

(B,4)(C,10)

(A,10)(B,1)

(A,5)(B,1)

(B,4)(C,5)

12

Page 32: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Split Horizon

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

A 12 A

C 1 C

A 5 B

B 1 B

B 11

C

C 10

C

(B,4)(C,10)

(A,10)(B,1)

(A,5)(B,1)

(B,4)(C,5)

12

Page 33: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Split Horizon

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

A 12 A

C 1 C

A 5 B

B 1 B

B 11

C

C 10

C

(A,10)(B,1)

12

(A,12)(C,1)

Page 34: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Split Horizon

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

A 12 A

C 1 C

A 10 B

B 1 B

B 11

C

C 10

C

(A,10)(B,1)

12

(A,12)(C,1)

Page 35: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Split Horizon

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

A 12 A

C 1 C

A 10 B

B 1 B

B 11

C

C 10

C

(A,10)(B,1)

12

(A,12)(C,1)

Page 36: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Split Horizon

• Why did it take a while to converge?– Nodes are unknowingly using each other

A

B

C

4 1

10

A 11 A

C 1 C

A 10 B

B 1 B

B 11

C

C 10

C

12

(A,12)(C,1)

(A,10)(B,1)

Page 37: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Warning

• Split horizon/split horizon with poison reverse only help between two nodes– Can still get loop with three nodes involved– Might need to delay advertising routes after

changes, but affects convergence time

Page 38: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Other approaches

• DSDV: destination sequenced distance vector– Uses a ‘version’ number per destination message– Avoids loops by preventing nodes from using old

information from descendants– But, you can only update when new version comes

from root• Path Vector: (BGP) – Replace ‘distance’ with ‘path’– Avoids loops with extra cost

Page 39: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Link State Routing

• Strategy: – send to all nodes information about directly

connected neighbors• Link State Packet (LSP)– ID of the node that created the LSP– Cost of link to each directly connected neighbor– Sequence number (SEQNO)– TTL

Page 40: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Time 0: Generate LSP from Config File and Send out Updates

A

B

C4

110

D

5

6

• Directly Connected Neighbors are pre-configured into the device

B 4C 1

Page 41: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Time 0: Generate LSP from Config File and Send out Updates

A

B

C4

110

D

5

6

• Directly Connected Neighbors are pre-configured into the device

B 4C 1

Page 42: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Reliable Flooding• Store most recent LSP from each node– Ignore earlier versions of the same LSP

• Forward LSP to all nodes but the one that sent it• Generate new LSP periodically– Increment SEQNO

• Start at SEQNO=0 when reboot– If you hear your own packet with SEQNO=n, set your

next SEQNO to n+1• Decrement TTL of each stored LSP– Discard when TTL=0

Page 43: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Time 1: Receive LSPs

• When a node gets an LSA, it floods it on all ports except the port it received it from.

A

B

C4

110

D

5

6

B 4

C 1

B 4

C 1

Page 44: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Time 1: Receive LSPs

• When a node gets an LSA, it floods it on all ports except the port it received it from.

A

B

C4

110

D

5

6

B 4

C 1

B 4

C 1

Page 45: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Time 10: Regenerate LSP and send out

A

B

C4

110

D

5

6

• Generate new LSP periodically– Increment SEQNO

Page 46: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Calculating best path• Djikstra’s single-source shortest path algorithm

– Each node computes shortest paths from itself• Let:

– N denote set of nodes in the graph– l(i,j) denote the non-negative link between i,j

• ∞ if there is no direct link between i and j

– C(n) denote the cost of path from s to n– s denotes yourself (node computing paths)

• Initialize variables– M = {s} (set of nodes incorporated thus far)– For each n in N-{s}, C(n) = l(s,n)– Next(n) = n if l(s,n) < ∞, – otherwise

Page 47: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Djikstra’s Algorithm• While N≠M– Let w (N-M) be the node with lowest C(w)∈– M = M ∪ {w}– Foreach n (N-M), if C(w) + l(w,n) < C(n)∈

then C(n) = C(w) + l(w,n), Next(n) = Next(w)

• Example: D: (D,0,-) (C,2,C) (B,5,C) (A,10,C)

Page 48: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Draw Backs of Link State Protocols

Page 49: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Draw Backs of Link State Protocols

• Scalability– A lot of Network packets (Flooding of LSPs)– A lot computation overhead, for each router:• Router Memory: to store entire network• Router CPU: to calculate Dijkstra

Page 50: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

To Scale Add Areas (Hierarchy)

A

BC

D

• Divide into backbone and other areas

F

E

X

YZArea 1 Area 2

Backbone(Area 0)

Page 51: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

To Scale Add Areas (Hierarchy)

A

BC

D

• Divide into backbone and other areas• An area must know how to route within itself

– LSPs are contained to an area: never flood outside of your area– This provides scaling properties

• To route between two areas, you must go through the backbone

F

E

X

YZArea 1 Area 2

Backbone(Area 0)

Page 52: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

To Scale Add Areas (Hierarchy)

A

BC

• Divide into backbone and other areas• An area must know how to route within itself

– LSPs are contained to an area: never flood outside of your area– This provides scaling properties in all areas except Area 0

• To route between two areas, you must go through the backbone• Backbone know how to route between areas but not how to route within

other areas.– Backbone views each area as one node– Allows scaling in the backbones

Area 1 Area 2

Backbone(Area 0)

Page 53: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Distance Vector vs. Link StateDistance Vector Link State

# of Messages O(d), where d is degree of node

O(nd) for n nodes in system

Computation convergence time varies (e.g., count-to-infinity)

O(n2) with O(nd) messages

Robustness: what happens with malfunctioning router?

Nodes can advertise incorrect path cost

Others can use the cost, propagates through network

Nodes can advertise incorrect link cost

May get correct link information from another node

Page 54: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Metrics• Original ARPANET metric

– measures number of packets enqueued in each link– neither latency nor bandwidth in consideration

• New ARPANET metric– Stamp arrival time (AT) and departure time (DT)– When link-level ACK arrives, compute

Delay = (DT – AT) + Transmit + Latency

– If timeout, reset DT to departure time for retransmission– Link cost = average delay over some time period

• Fine Tuning– Compressed dynamic range– Replaced Delay with link utilization

• Today: commonly set manually to achieve specific goals

Page 55: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Examples of Distance Vector & Link State

• Distance Vector: RIPv2– Fairly simple implementation of DV– RFC 2453 (38 pages)

• Link State: OSPF (Open Shortest Path First)– More complex link-state protocol– Adds notion of areas for scalability– RFC 2328 (244 pages)

Page 56: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

RIPv2: Default on Several Cisco Routers

• Runs on UDP port 520• Link cost = 1• Periodic updates every 30s, plus triggered

updates• Relies on count-to-infinity to resolve loops– Maximum diameter 15 (∞ = 16)– Supports split horizon, poison reverse

• Deletion– If you receive an entry with metric = 16 from parent

OR– If a route times out

Page 57: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

OSPFv2: Costs more to activate on Several Cisco Routers

• Link state protocol• Runs directly over IP (protocol 89)– Has to provide its own reliability

• All exchanges are authenticated• Adds notion of areas for scalability

Page 58: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Other Routing Protocols

Routing Protocol Name Type of Protocol

IS-IS (intermediate system –to- intermediate system) Link State Protocol

IGRP (Interior Gateway Routing Protocol) Distance Vector Protocol

BGP (border Gateway Protocol) Distance-Vector (with Paths)“Path-Vector”

Page 59: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Now You Have Your Routes, what next?

Page 60: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 0: Operator preconfigures routers with IP addresses

Router BRouter C

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24128.35.7.*/24

128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24

Page 61: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 1: Router builds Routing Table using Routing Protocol

Router BRouter C

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

Page 62: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 2: Get Your IP Address (DHCP)

Router BRouter C

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

Page 63: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 2: Bonus Switch Learns (Learning Switch)

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Page 64: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 2: Bonus Switch Learns (Learning Switch)

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Page 65: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 3: Get Dest-IP Address (DNS)

Source: MAC_A:128.35.7.2 Dest:UNKnown MAC: 128.35.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Page 66: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 4: Get Dest MAC Address (ARP)

Source: MAC_A:128.35.7.2 Dest:UnKnown MAC: 128.35.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Page 67: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 4: Get Dest MAC Address (ARP)

Source: MAC_A:128.35.7.2 Dest:UnKnown MAC: 128.35.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Compare your IP address with destination IP addressSource IP: 128.35.7.2

You netmask is 128.35.7.*/24 so you network has: 128.35.7.0-128.35.7.255

Dest IP: 128.35.7.5Destination is in your network range, so you have to send to the destination!!!

So you ARP for the MAC address of the destination.

Page 68: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 4: Get Dest MAC Address (ARP)

Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.35.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Page 69: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 5: Send packets

Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.35.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

MAC: A->BIP: A->B

Page 70: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 5: Send packets

Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.35.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

MAC: A->BIP: A->B

Page 71: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.
Page 72: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 3: Get Dest-IP Address (DNS)

Alice to EveSource: MAC_A:128.35.7.2 Dest:UNKnown MAC: 128.35.9.9

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Page 73: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 4: Get Dest MAC Address (ARP)

Alice to EveSource: MAC_A:128.35.7.2 Dest:UnKnown MAC: 128.35.9.9

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Page 74: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 4: Get Dest MAC Address (ARP)

Alice to EveSource: MAC_A:128.35.7.2 Dest:UnKnown MAC: 128.35.9.9

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Compare your IP address with destination IP addressSource IP: 128.35.7.2

You netmask is 128.35.7.*/24 so you network has: 128.35.7.0-128.35.7.255

Dest IP: 128.35.9.9Destination is not in your network range, so you have to send to router!!!

So you ARP for the MAC address of the router.

Page 75: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 4: Get Dest MAC Address (ARP)

Source: MAC_A:128.35.7.2 Dest: MAC_Y: 128.35.9.9

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

Page 76: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 5: Send packets

Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.357.5

Router ZMAC_Z

Router YMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_YMAC: A->Y

IP: A->E

Page 77: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 5: Send packets

Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.357.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

MAC: A->ZIP: A->E

Page 78: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 5: Send packets

Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.357.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

MAC: A->EIP: A->E

Page 79: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Bring it All Together: Ethernet + IPStep 5: Send packets

Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.357.5

Router BMAC_Z

Router CMAC_Y

G H G H

128.35.8.*/24128.35.6.*/24

128.35.9.*/24

128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

128.35.6.*/24128.35.9.*/24128.35.8.*/24128.35.7.*/24

MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9

MAC_AMAC_BMAC_Y

MAC_EMAC_Z

MAC_EMAC_Z

MAC_AMAC_BMAC_Y

MAC: A->ZIP: A->E

Page 80: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

What Limitations Does Ethernet Have?

• Minimum Packet Size– 64Bytes (512 bits): To ensure that collisions are

detected!– Bandwidth-Delay-Product*2

• Maximum Ethernet LAN size– 2500 meters: Due to signal decay, any longer and

packets would not be delivered

Page 81: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

A Router Does Two Things

Forwarding (per-node operation): – how to pass a packet from an input interface to

the output interface of a router– Destination based forwarding

• Check destination IP and look it up in your forwarding table

Routing (distributed algorithm): – how to find and setup a route? Implemented by

dynamic routing protocols– OSPF, RIP

Page 82: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Forwarding

• Due to CIDR, Routers use longest prefix match

From 128.35.6.0 To: 123.35.6.255From 128.35.0.0 To: 123.35.255.255From 128.35.6.3 To: 123.35.6.3From 128.35.7.0 To: 128.35.7.255

Router Forwarding TableAfter OSPF or RIP

128.35.6.*/24, fwd port 1128.35.*.*/16, fwd port 3128.35.6.3/32, fwd port 6

128.35.7.*/24, fwd port 18

Page 83: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Forwarding

• Due to CIDR, Routers use longest prefix match

128.35.6.*/24, fwd port 1128.35.*.*/16, fwd port 3128.35.6.3/32, fwd port 6

128.35.7.*/24, fwd port 18

From 128.35.6.0 To: 123.35.6.255From 128.35.0.0 To: 123.35.255.255From 128.35.6.3 To: 123.35.6.3From 128.35.7.0 To: 128.35.7.255

Router Forwarding TableAfter OSPF or RIP

Page 84: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Forwarding

• Due to CIDR, Routers use longest prefix match

From 128.35.6.0 To: 123.35.6.255From 128.35.0.0 To: 123.35.255.255From 128.35.6.3 To: 123.35.6.3From 128.35.7.0 To: 128.35.7.255

Router Forwarding TableAfter OSPF or RIP

Packet with destination: 128.35.6.3. Which entry does it match? What port does it get forwarded on?

128.35.6.*/24, fwd port 1128.35.*.*/16, fwd port 3128.35.6.3/32, fwd port 6

128.35.7.*/24, fwd port 18

Page 85: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Forwarding

• Due to CIDR, Routers use longest prefix match

From 128.35.6.0 To: 123.35.6.255From 128.35.0.0 To: 123.35.255.255From 128.35.6.3 To: 123.35.6.3From 128.35.7.0 To: 128.35.7.255

Router Forwarding TableAfter OSPF or RIP

Packet with destination: 128.35.6.8Which entry does it match? What port does it get forwarded on?

128.35.6.*/24, fwd port 1128.35.*.*/16, fwd port 3128.35.6.3/32, fwd port 6

128.35.7.*/24, fwd port 18

Page 86: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Router Versus Switches

Router• Runs multiple switching

protocols: Ethernet, ATM– Switches between techs

• Runs routing protocols

• Runs DHCP

• Needs a common address across techs: IP address– E.g. Ethernet addresses make no

sense to ATM hosts

Switches• Runs one switching protocol

– Can only work with same tech

• Dictates how bits become signals

• Dictates how bits becomes a packet/frame

• Needs hardware addresses to identify hosts/switches

Page 87: CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti.

Summary

• This Class– Link State protocols– Link State V. Distance Vector– Routing V Forwarding– How routing works within one ISP/AS

• Next Class– Inter-Domain routing– Routing over the Wide Area Network