IP Routing: Intradomain CS/ECE 438: Spring 2014 Instructor: Matthew - - PowerPoint PPT Presentation

ip routing intradomain
SMART_READER_LITE
LIVE PREVIEW

IP Routing: Intradomain CS/ECE 438: Spring 2014 Instructor: Matthew - - PowerPoint PPT Presentation

IP Routing: Intradomain CS/ECE 438: Spring 2014 Instructor: Matthew Caesar http://courses.engr.illinois.edu/cs438/ Today Application Transport Network Link Layer Physical Starting on the internals of the network layer Many pieces to the


slide-1
SLIDE 1

IP Routing: Intradomain

CS/ECE 438: Spring 2014 Instructor: Matthew Caesar http://courses.engr.illinois.edu/cs438/

slide-2
SLIDE 2

Starting on the internals of the network layer

Today

Application Transport Network Link Layer Physical

slide-3
SLIDE 3

Many pieces to the network layer

  • Addressing
  • Routing
  • Forwarding
  • Policy and management
  • IP protocol details

Today + next 1-2 lectures: Routing

slide-4
SLIDE 4

Context and Terminology

“End hosts”

“Clients”, “Users”

“End points” “Interior Routers” “Border Routers” “Autonomous System (AS)” or “Domain”

Region of a network under a single administrative entity

“Route” or “Path”

slide-5
SLIDE 5

to MIT to UW UCB to NYU

Destination Next Hop UCB 4 UW 5 MIT 2 NYU 3

Forwarding Table

111010010

MIT

switch#2 switch#5 switch#3 switch#4

Lecture#2: Routers Forward Packets

slide-6
SLIDE 6 111010010

M I T

Destination Destination Destination Destination Destination Destination Destination Destination

MIT

Internet routing protocols are responsible for constructing and updating the forwarding tables at routers

Context and Terminology

slide-7
SLIDE 7

How can routers find paths?

  • Hosts assigned topology-dependent addresses
  • Routers advertise address blocks (“prefixes”)
  • Routers compute “shortest” paths to prefixes
  • Map IP addresses to names with DNS

Robert twitter.com

23.2.0.0/24 81.2.0.0/24 10.1.0.0/16 4.0.0.0/8 Prefix Hops IF Routing Table at B D 1 4.0.0.0/8 Prefix Hops IF Routing Table at C D 1 4.0.0.0/8 Prefix Hops IF Routing Table at A B 2

A B C D

10.1.0.1 10.1.8.7 23.2.0.1 81.2.0.1 4.5.16.2 4.18.5.1 4.9.0.1

IP address

4.0.0.0/8

Prefix

Robert’s local DNS server Twitter’s authoritative DNS server .com authoritative DNS sever

slide-8
SLIDE 8

Routing Protocols

  • Routing protocols implement the core function of a network
  • Establish paths between nodes
  • Part of the network’s “control plane”
  • Network modeled as a graph
  • Routers are graph vertices
  • Links are edges
  • Edges have an associated “cost”
  • e.g., distance, loss
  • Goal: compute a “good” path from source to destination
  • “good” usually means the shortest (least cost) path

A E D C B F 2 2 1 3 1 1 2 5 3 5

slide-9
SLIDE 9

Internet Routing

  • Internet Routing works at two levels
  • Each AS runs an intra-domain routing protocol that

establishes routes within its domain

  • (AS -- region of network under a single administrative entity)
  • Link State, e.g., Open Shortest Path First (OSPF)
  • Distance Vector, e.g., Routing Information Protocol (RIP)
  • ASes participate in an inter-domain routing protocol that establishes

routes between domains

  • Path Vector, e.g., Border Gateway Protocol (BGP)
slide-10
SLIDE 10

Intra- vs. Inter-domain routing

  • Run “Interior Gateway Protocol” (IGP) within ISPs
  • OSPF, IS-IS, RIP
  • Use “Border Gateway Protocol” (BGP) to connect ISPs
  • To reduce costs, peer at exchange points (AMS-IX, MAE-EAST)

AT&T Sprint BGP session

source dest

slide-11
SLIDE 11
slide-12
SLIDE 12

Addressing (for now)

  • Assume each host has a unique ID (address)
  • No particular structure to those IDs
  • Later in course will talk about real IP addressing
slide-13
SLIDE 13

Outline

  • Link State
  • Distance Vector
  • Routing: goals and metrics (if time)
slide-14
SLIDE 14

Link-State Routing

slide-15
SLIDE 15

Link state: update propagation

B D C E A F [E,F] [E,F] [E,F] [E,F] [E,F] [E,F] [E,F] [E,F] [E,F] [E,F]

  • How to prevent update loops: (seq numbers)
  • How to bring up new node: (load TDB from neighbor)

[D,F] [D,F] [D,F] [D,F] [D,F] [D,F] [D,F] [D,F] [D,F] [D,F]

[C,A] [C,A] [C,A] [C,A] [C,A] [C,A] [C,A] [C,A] [C,A] [C,A] [C,E] [C,E] [C,E] [C,E] [C,E] [C,E] [C,E] [C,E] [C,E] [C,E] [C,B] [C,B] [C,B] [C,B] [C,B] [C,B] [C,B] [C,B] [C,B] [C,B] [A,B] [A,B] [A,B] [A,B] [A,B] [A,B] [A,B] [A,B] [A,B] [A,B] [B,D] [B,D] [B,D] [B,D] [B,D] [B,D] [B,D] [B,D] [B,D] [B,D] [D,E] [D,E] [D,E] [D,E] [D,E] [D,E] [D,E] [D,E] [D,E] [D,E]

F tells all routers: there is a link between F and E Each node maintains a “topology database”

slide-16
SLIDE 16

Link state: route computation

B D C E A F

  • Each router computes shortest path tree, rooted at that router
  • Determines next-hop to each dest, publish to forwarding table
  • Operators can assign link costs to control path selection
slide-17
SLIDE 17

Link-state: packet forwarding

B D C E A F

IP packet

source destination

  • In practice: shortest path precomputed, next-hops stored in forwarding table
  • Downsides of link-state:

– Lesser control on policy (certain routes can’t be filtered), more cpu – Increased visibility (bad for privacy, but good for diagnostics)

slide-18
SLIDE 18

Link State Routing

  • Each node maintains its local “link state” (LS)
  • i.e., a list of its directly attached links and their costs

(N1,N2) (N1,N4) (N1,N5) Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7 N6

slide-19
SLIDE 19

Link State Routing

  • Each node maintains its local “link state” (LS)
  • Each node floods its local link state
  • on receiving a new LS message, a router forwards the message

to all its neighbors other than the one it received the message from

Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7 N6

(N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5)
slide-20
SLIDE 20

Link State Routing

  • Each node maintains its local “link state” (LS)
  • Each node floods its local link state
  • Hence, each node learns the entire network topology
  • Can use Dijkstra’s to compute the shortest paths between nodes

Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7 N6

A B E D C A B E D C A B E D C A B E D C A B E D C A B E D C A B E D C

slide-21
SLIDE 21

Dijkstra’s Shortest Path Algorithm

  • INPUT:
  • Network topology (graph), with link costs
  • OUTPUT:
  • Least cost paths from one node to all other nodes
  • Iterative: after k iterations, a node knows the

least cost path to its k closest neighbors

slide-22
SLIDE 22

Example

A E D C B F 2 2 1 3 1 1 2 5 3 5

slide-23
SLIDE 23

Notation

  • c(i,j): link cost from node i

to j; cost is infinite if not direct neighbors; ≥ 0

  • D(v): total cost of the

current least cost path from source to destination v

  • p(v): v’s predecessor along

path from source to v

  • S: set of nodes whose least

cost path definitively known

A E D C B F 2 2 1 3 1 1 2 5 3 5 Source

slide-24
SLIDE 24

Dijkstra’s Algorithm

1 Initialization: 2 S = {A}; 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ; 7 8 Loop 9 find w not in S such that D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 if D(w) + c(w,v) < D(v) then // w gives us a shorter path to v than we’ve found so far 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S;

¥

  • c(i,j): link cost from node i to j
  • D(v): current cost source  v
  • p(v): v’s predecessor along path

from source to v

  • S: set of nodes whose least cost

path definitively known

slide-25
SLIDE 25

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A D(B),p(B) 2,A D(C),p(C) 5,A D(D),p(D) 1,A D(E),p(E) D(F),p(F)

A E D C B F 2 2 1 3 1 1 2 5 3 5

¥ ¥

1 Initialization: 2 S = {A}; 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ; …

¥

slide-26
SLIDE 26

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A D(B),p(B) 2,A D(C),p(C) 5,A

… 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 If D(w) + c(w,v) < D(v) then 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S; A E D C B F 2 2 1 3 1 1 2 5 3 5

D(D),p(D) 1,A D(E),p(E) D(F),p(F)

¥ ¥

slide-27
SLIDE 27

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A AD D(B),p(B) 2,A D(C),p(C) 5,A D(D),p(D) 1,A D(E),p(E) D(F),p(F)

A E D C B F 2 2 1 3 1 1 2 5 3 5

¥ ¥

… 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 If D(w) + c(w,v) < D(v) then 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S;

slide-28
SLIDE 28

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A AD D(B),p(B) 2,A D(C),p(C) 5,A 4,D D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F)

A E D C B F 2 2 1 3 1 1 2 5 3 5

¥ ¥

… 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 If D(w) + c(w,v) < D(v) then 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S;

slide-29
SLIDE 29

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A AD ADE D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E

¥ ¥

A E D C B F 2 2 1 3 1 1 2 5 3 5 … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 If D(w) + c(w,v) < D(v) then 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S;

slide-30
SLIDE 30

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A AD ADE ADEB D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E

¥ ¥

A E D C B F 2 2 1 3 1 1 2 5 3 5 … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 If D(w) + c(w,v) < D(v) then 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S;

slide-31
SLIDE 31

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A AD ADE ADEB ADEBC D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E

¥ ¥

A E D C B F 2 2 1 3 1 1 2 5 3 5 … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 If D(w) + c(w,v) < D(v) then 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S;

slide-32
SLIDE 32

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E

¥ ¥

A E D C B F 2 2 1 3 1 1 2 5 3 5 … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 If D(w) + c(w,v) < D(v) then 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S;

slide-33
SLIDE 33

Example: Dijkstra’s Algorithm

Step 1 2 3 4 5 set S A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E

¥ ¥

A E D C B F 2 2 1 3 1 1 2 5 3 5

To determine path A  C (say), work backward from C via p(v)

slide-34
SLIDE 34
  • Running Dijkstra at node A gives the shortest

path from A to all destinations

  • We then construct the forwarding table

The Forwarding Table

A E D C B F 2 2 1 3 1 1 2 5 3 5

Destination Link

B (A,B) C (A,D) D (A,D) E (A,D) F (A,D)

slide-35
SLIDE 35

Issue #1: Scalability

  • How many messages needed to flood link state messages?
  • O(N x E), where N is #nodes; E is #edges in graph
  • Processing complexity for Dijkstra’s algorithm?
  • O(N2), because we check all nodes w not in S at each iteration

and we have O(N) iterations

  • more efficient implementations: O(N log(N))
  • How many entries in the LS topology database? O(E)
  • How many entries in the forwarding table? O(N)
slide-36
SLIDE 36
  • Inconsistent link-state database
  • Some routers know about failure before others
  • The shortest paths are no longer consistent
  • Can cause transient forwarding loops

Issue#2: Transient Disruptions

A E D C B F

A and D think that this is the path to C E thinks that this is the path to C

A E D C B F

Loop!

slide-37
SLIDE 37

Hierarchical routing

A B C H G D E I J M P O A B C H G D E I J M P O

In regular link-state, routers maintain map

  • f entire topology
slide-38
SLIDE 38

Hierarchical routing

A B C H G D E I J M P O A H G I J M P O

Routers summarize paths across areas as “virtual links” Aggregate groups of routers into “areas” “Border routers” generate “summary LSPs” to reach other border routers

slide-39
SLIDE 39

Distance Vector

slide-40
SLIDE 40

Learn-By-Doing

Let’s try to collectively develop distance-vector routing from first principles

slide-41
SLIDE 41

Experiment

  • Your job: find the youngest person in the room
  • Ground Rules
  • You may not leave your seat, nor shout loudly

across the class

  • You may talk with your immediate neighbors

(hint: “exchange updates” with them)

  • At the end of 5 minutes, I will pick a victim and ask:
  • who is the youngest person in the room? (name, date)
  • which one of your neighbors first told you this info.?
slide-42
SLIDE 42

Go!

slide-43
SLIDE 43

Distance-Vector

slide-44
SLIDE 44

Example of Distributed Computation

I am one hop away I am one hop away I am one hop away I am two hops away I am two hops away I am two hops away I am two hops away I am three hops away I am three hops away

Destination

I am three hops away

slide-45
SLIDE 45

Distance vector: update propagation

B D C E A F

(F,0) (F,0) (F,1) (F,1) (F,1) (F,1) (F,2) (F,2) (F,2) (F,2) F tells D: I am F, and I can reach F via 0 hops D tells B: I am D, and I can reach F via 1 hop

Dest NextHop Dist F F 1 D’s forwarding table Dest NextHop Dist F D 2 B’s forwarding table

source destination

slide-46
SLIDE 46

Distance Vector Routing

  • Each router knows the links to its neighbors
  • Does not flood this information to the whole network
  • Each router has provisional “shortest path” to

every other router

  • E.g.: Router A: “I can get to router B with cost 11”
  • Routers exchange this distance vector information

with their neighboring routers

  • Vector because one entry per destination
  • Routers look over the set of options offered by their

neighbors and select the best one

  • Iterative process converges to set of shortest paths
slide-47
SLIDE 47

Distance vector: convergence

B D C E A F G H

source destination

Withdraw(H) Updates received by A: 0 1 2 3 4 5 6 7

  • How many updates would link-state require?
  • Is link-state better or worse than distance vector?
  • Which should be used for intra-domain routing?

What about inter-domain routing?

slide-48
SLIDE 48

Bellman-Ford Algorithm

  • INPUT:
  • Link costs to each neighbor

(Not full topology)

  • OUTPUT:
  • Next hop to each destination and the corresponding cost

(Not the complete path to the destination)

  • My neighbors tell me how far they are from dest’n
  • Compute: (cost to nbr) plus (nbr’s cost to destination)
  • Pick minimum as my choice
  • Advertise that cost to my neighbors
slide-49
SLIDE 49

Bellman-Ford Overview

  • Each router maintains a table
  • Best known distance from X to Y,

via Z as next hop = DZ(X,Y)

  • Each local iteration caused by:
  • Local link cost change
  • Message from neighbor
  • Notify neighbors only if least cost

path to any destination changes

  • Neighbors then notify their neighbors

if necessary

wait for (change in local link

cost or msg from neighbor)

recompute distance table

if least cost path to any dest has changed, notify neighbors

Each node:

slide-50
SLIDE 50

Bellman-Ford Overview

  • Each router maintains a table
  • Row for each possible destination
  • Column for each directly-attached

neighbor to node

  • Entry in row Y and column Z of node

X  best known distance from X to Y, via Z as next hop = DZ(X,Y) A C 1 2 7 B D 3 1

B C B 2 8 C 3 7 D 4 8

Node A

Neighbor (next-hop) Destinations DC(A, D)

slide-51
SLIDE 51

Bellman-Ford Overview

  • Each router maintains a table
  • Row for each possible destination
  • Column for each directly-attached

neighbor to node

  • Entry in row Y and column Z of node

X  best known distance from X to Y, via Z as next hop = DZ(X,Y) A C 1 2 7 B D 3 1

B C B 2 8 C 3 7 D 4 8

Node A

Smallest distance in row Y = shortest Distance of A to Y, D(A, Y)

slide-52
SLIDE 52

Distance Vector Algorithm (cont’d)

1 Initialization: 2 for all neighbors V do 3 if V adjacent to A 4 D(A, V) = c(A,V); 5 else 6 D(A, V) = ∞; 7 send D(A, Y) to all neighbors loop: 8 wait (until A sees a link cost change to neighbor V /* case 1 */ 9 or until A receives update from neighbor V) /* case 2 */ 10 if (c(A,V) changes by ±d) /*  case 1 */ 11 for all destinations Y that go through V do 12 DV(A,Y) = DV(A,Y) ± d 13 else if (update D(V, Y) received from V) /*  case 2 */ /* shortest path from V to some Y has changed */ 14 DV(A,Y) = DV(A,V) + D(V, Y); /* may also change D(A,Y) */ 15 if (there is a new minimum for destination Y) 16 send D(A, Y) to all neighbors 17 forever

  • c(i,j): link cost from node i to j
  • DZ(A,V): cost from A to V via Z
  • D(A,V): cost of A’s best path to V
slide-53
SLIDE 53

wait for (change in local link

cost or msg from neighbor)

recompute distance table

if least cost path to any dest has changed, notify neighbors

Each node: initialize, then

Distance Vector Algorithm (cont’d)

slide-54
SLIDE 54

1 Initialization: 2 for all neighbors V do 3 if V adjacent to A 4 D(A, V) = c(A,V); 5 else 6 D(A, V) = ∞; 7 send D(A, Y) to all neighbors loop: 8 wait (until A sees a link cost change to neighbor V /* case 1 */ 9 or until A receives update from neighbor V) /* case 2 */ 10 if (c(A,V) changes by ±d) /*  case 1 */ 11 for all destinations Y that go through V do 12 DV(A,Y) = DV(A,Y) ± d 13 else if (update D(V, Y) received from V) /*  case 2 */ /* shortest path from V to some Y has changed */ 14 DV(A,Y) = DV(A,V) + D(V, Y); /* may also change D(A,Y) */ 15 if (there is a new minimum for destination Y) 16 send D(A, Y) to all neighbors 17 forever

  • c(i,j): link cost from node i to j
  • DZ(A,V): cost from A to V via Z
  • D(A,V): cost of A’s best path to V

Distance Vector Algorithm (cont’d)

slide-55
SLIDE 55

Example: Initialization

A C 1 2 7 B D 3 1

B C B 2 ∞ C ∞ 7 D ∞ ∞

Node A

A C D A 2 ∞ ∞ C ∞ 1 ∞ D ∞ ∞ 3

Node B Node C

A B D A 7 ∞ ∞ B ∞ 1 ∞ D ∞ ∞ 1 B C A ∞ ∞ B 3 ∞ C ∞ 1

Node D

1 Initialization: 2 for all neighbors V do 3 if V adjacent to A 4 D(A, V) = c(A,V); 5 else 6 D(A, V) = ∞; 7 send D(A, Y) to all neighbors

slide-56
SLIDE 56

Example: C sends update to A

A C 1 2 7 B D 3 1

B C B 2 8 C ∞ 7 D ∞ 8

Node A

A C D A 2 ∞ ∞ C ∞ 1 ∞ D ∞ ∞ 3

Node B Node C

A B D A 7 ∞ ∞ B ∞ 1 ∞ D ∞ ∞ 1 B C A ∞ ∞ B 3 ∞ C ∞ 1

Node D

7 loop: … 13 else if (update D(A, Y) from C) 14 DC(A,Y) = DC(A,C) + D(C, Y); 15 if (new min. for destination Y) 16 send D(A, Y) to all neighbors 17 forever DC(A, B) = DC(A,C) + D(C, B) = 7 + 1 = 8 DC(A, D) = DC(A,C) + D(C, D) = 7 + 1 = 8

slide-57
SLIDE 57

Example: Now B sends update to A

A C 1 2 7 B D 3 1

B C B 2 8 C 3 7 D 5 8

Node A

A C D A 2 ∞ ∞ C ∞ 1 ∞ D ∞ ∞ 3

Node B Node C

A B D A 7 ∞ ∞ B ∞ 1 D ∞ ∞ 1

Node D

7 loop: … 13 else if (update D(A, Y) from B) 14 DB(A,Y) = DB(A,B) + D(B, Y); 15 if (new min. for destination Y) 16 send D(A, Y) to all neighbors 17 forever DB(A, C) = DB(A,B) + D(B, C) = 2 + 1 = 3 DB(A, D) = DB(A,B) + D(B, D) = 2 + 3 = 5 B C A ∞ ∞ B 3 ∞ C ∞ 1

Make sure you know why this is 5, not 4!

slide-58
SLIDE 58

Example: After 1st Full Exchange

A C 1 2 7 B D 3 1

B C B 2 8 C 3 7 D 5 8

Node A Node B Node C

A B D A 7 3 ∞ B 9 1 4 D ∞ 4 1

Node D

B C A 5 8 B 3 2 C 4 1

End of 1st Iteration All nodes knows the best two-hop paths

A C D A 2 8 ∞ C 9 1 4 D ∞ 2 3

Make sure you know why this is 3

Assume all send messages at same time

slide-59
SLIDE 59

Example: Now A sends update to B

A C 1 2 7 B D 3 1

B C B 2 8 C 3 7 D 5 8

Node A Node B Node C

A B D A 7 3 ∞ B 9 1 4 D ∞ 4 1

Node D

B C A 5 8 B 3 2 C 4 1 A C D A 2 8 ∞ C 5 1 4 D 7 2 3 7 loop: … 13 else if (update D(B, Y) from A) 14 DA(B,Y) = DA(B,A) + D(A, Y); 15 if (new min. for destination Y) 16 send D(B, Y) to all neighbors 17 forever DA(B, C) = DA(B,A) + D(A, C) = 2 + 3 = 5 DA(B, D) = DA(B,A) + D(A, D) = 2 + 5 = 7

Where does this 5 come from? Where does this 7 come from? What harm does this cause?

slide-60
SLIDE 60

Example: End of 2nd Full Exchange

A C 1 2 7 B D 3 1

B C B 2 8 C 3 7 D 4 8

Node A

A C D A 2 4 8 C 5 1 4 D 7 2 3

Node B Node C

A B D A 7 3 6 B 9 1 3 D 12 3 1

Node D

B C A 5 4 B 3 2 C 4 1

End of 2nd Iteration All nodes knows the best three-hop paths Assume all send messages at same time

slide-61
SLIDE 61

Example: End of 3rd Full Exchange

A C 1 2 7 B D 3 1

B C B 2 8 C 3 7 D 4 8

Node A

A C D A 2 4 7 C 5 1 4 D 6 2 3

Node B Node C

A B D A 7 3 5 B 9 1 3 D 11 3 1

Node D

B C A 5 4 B 3 2 C 4 1

End of 3rd Iteration: Algorithm Converges!

What route does this 11 represent?

Assume all send messages at same time

slide-62
SLIDE 62

Intuition

  • Initial state: best one-hop paths
  • One simultaneous round: best two-hop paths
  • Two simultaneous rounds: best three-hop paths
  • Kth simultaneous round: best (k+1) hop paths
  • Must eventually converge
  • as soon as it reaches longest best path
  • …..but how does it respond to changes in cost?

The key here is that the starting point is not the initialization, but some other set of

  • entries. Convergence could be different!
slide-63
SLIDE 63

Count-to-Infinity Problem

A B C 1 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1

72

slide-64
SLIDE 64

Count-to-Infinity Problem

A B C 1 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1

73

slide-65
SLIDE 65

Count-to-Infinity Problem

A B C 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1

74

slide-66
SLIDE 66

Count-to-Infinity Problem

A B C 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1 ~

75

slide-67
SLIDE 67

Count-to-Infinity Problem

A B C 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1 ~

A 2

76

slide-68
SLIDE 68

Count-to-Infinity Problem

A B C 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1 ~

A 2

3

77

slide-69
SLIDE 69

Count-to-Infinity Problem

A B C 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1 ~

A 3

3

78

slide-70
SLIDE 70

Count-to-Infinity Problem

A B C 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1 ~

A 3

3 4

79

slide-71
SLIDE 71

Count-to-Infinity Problem

A B C 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1 ~

A 4

3 4

80

slide-72
SLIDE 72

Count-to-Infinity Problem

A B C 14 1 dest cost B 1 C 2 dest cost A 1 C 1 dest cost A 2 B 1 ~

A 4

3 4 5

81

slide-73
SLIDE 73

How to deal with count-to infinity problem?

  • Option 1: if router X advertises router Y a route, Y should

not advertise that route back to X

  • Called split horizon
  • Can be fooled by 3-node loops
  • Option 2: if one of my routes is disappeared, I should

advertise that route to all my neighbors with infinite costs

  • Called poison reverse
  • Useful for networks where routes only disappear after a timeout (so

it’s not necessary if you’re using a protocol with triggered updates)

  • Or, can alternatively have an explicit “withdrawal” message
slide-74
SLIDE 74

Split Horizon

A B C 14 1

des t cos t B 1 C 2 des t cos t A 1 C 1 des t cos t A 2 B 1

inf

83

slide-75
SLIDE 75

Split Horizon

A B C 14 1

des t cos t B 1 C 2 des t cos t A 1 C 1 des t cos t A 2 B 1

inf 14

84

A inf

slide-76
SLIDE 76

Split Horizon

A B C 14 1

des t cos t B 1 C 2 des t cos t A 1 C 1 des t cos t A 2 B 1

14

A 14

85

inf

slide-77
SLIDE 77

Split Horizon

A B C 14 1

des t cos t B 1 C 2 des t cos t A 1 C 1 des t cos t A 2 B 1

14

A 14

15

86

inf

slide-78
SLIDE 78

DV: Link Cost Changes

A C A 4 6 C 9 1

Node B

A B A 50 5 B 54 1

Node C Link cost changes here

A C A 1 6 C 6 1 A B A 50 5 B 54 1 A C A 1 6 C 3 1 A B A 50 5 B 51 1 A C A 1 6 C 3 1 A B A 50 2 B 51 1 B C B 4 51 C 5 50

Node A

B C B 1 51 C 2 50 B C B 1 51 C 2 50 B C B 1 51 C 2 50 A C A 1 3 C 3 1 A B A 50 2 B 51 1 B C B 1 51 C 2 50

Stable state A-B changed A sends tables to B, C B sends tables to C C sends tables to B

A C 1 4 50 B 1

“good news travels fast”

slide-79
SLIDE 79

DV: Count to Infinity Problem

A C A 4 6 C 9 1

Node B

A B A 50 5 B 54 1

Node C Link cost changes here

A C A 60

6

C 65

1

A B A 50 5 B 54 1 A C A

60 6

C

110 1

A B A

50 5

B

101 1

A C A

60 6

C

110 1

A B A

50 7

B

101 1

B C B 4 51 C 5 50

Node A

B C B 60

51

C 61

50

B C B 60

51

C 61

50

B C B 60

51

C 61

50

A C A

60 8

C

110 1

A B A

50 7

B

101 1

B C B 60

51

C 61

50 Stable state A-B changed A sends tables to B, C B sends tables to C C sends tables to B

A C 1 4 50 B 60

“bad news travels slowly” (not yet converged)

slide-80
SLIDE 80

DV: Poisoned Reverse

A C A

4 ∞

C

∞ 1 Node B

A B A 50 5 B 54 1

Node C Link cost changes here

A C A 60

C

∞ 1

A B A 50 5 B 54 1 A C A

60 ∞

C

110 1

A B A

50 5

B

∞ 1

A C A

60 ∞

C

110 1

A B A

50 61

B

∞ 1

B C B 4 51 C 5 50

Node A

B C B 60

51

C 61

50

B C B 60

51

C 61

50

B C B 60

51

C 61

50

A C A

60 51

C

110 1

A B A

50 61

B

∞ 1

B C B 60

51

C 61

50 Stable state A-B changed A sends tables to B, C B sends tables to C C sends tables to B

A C 1 4 50 B 60

  • If B routes through C to get to A:
  • B tells C its (B’s) distance to A is infinite (so C won’t route to A via B)

Note: this converges after C receives another update from B

slide-81
SLIDE 81

Will Poison-Reverse Completely Solve the Count-to-Infinity Problem?

A C 1 B D 1 1 1

1 1 2 2 ∞ ∞ ∞

100

100 100 3 ∞ 4 ∞ 4 5 6

slide-82
SLIDE 82

A few other inconvenient aspects

  • What if we use a non-additive metric?
  • E.g., maximal capacity
  • What if routers don’t use the same metric?
  • I want low delay, you want low loss rate?
  • What happens if nodes lie?
slide-83
SLIDE 83

Can You Use Any Metric?

  • I said that we can pick any metric. Really?
  • What about maximizing capacity?
slide-84
SLIDE 84

Policy disputes

ISP A ISP B ISP C

ISP C prefers route through B over direct route ISP B prefers route through A over direct route ISP A prefers route through C over direct route

Advertise(D-p)

Prefix P

ISP D

Advertise(A-D-p) Advertise(A-D-p) Advertise(C-D-p) Advertise(C-D-p) Advertise(B-D-p) Advertise(B-D-p)

(B-C-D-p) (B-A-D-p) (C-B-D-p) (C-B-D-p) (A-C-D-p) (A-C-D-p) (C-B-A-D-p) (C-B-A-D-p) (A-C-B-D-p) (A-C-B-D-p) (B-A-C-D-p) (B-A-C-D-p)

(link price: $100 per 1Gbps) (link price: $5000 per 1Gbps)

(A-C-B-A-D-p)

Withdraw Withdraw Withdraw Withdraw Withdraw Withdraw

slide-85
SLIDE 85

Policy disputes

ISP A ISP B ISP C

ISP C prefers route through B over direct route ISP B prefers route through A over direct route ISP A prefers route through C over direct route

Advertise(D-p)

Prefix P

ISP D

Advertise(A-D-p) Advertise(A-D-p) Advertise(C-D-p) Advertise(C-D-p) Advertise(B-D-p) Advertise(B-D-p)

(B-C-D-p) (B-A-D-p) (C-B-D-p) (C-B-D-p) (A-C-D-p) (A-C-D-p) (C-B-A-D-p) (C-B-A-D-p) (A-C-B-D-p) (A-C-B-D-p) (B-A-C-D-p) (B-A-C-D-p)

Withdraw Withdraw Withdraw Withdraw Withdraw Withdraw

slide-86
SLIDE 86

Policy disputes

ISP A ISP B ISP C

ISP C prefers route through B over direct route ISP B prefers route through A over direct route ISP A prefers route through C over direct route

Advertise(D-p)

Prefix P

ISP D

Advertise(A-D-p) Advertise(A-D-p) Advertise(C-D-p) Advertise(C-D-p) Advertise(B-D-p) Advertise(B-D-p)

(B-C-D-p) (B-A-D-p) (C-B-D-p) (C-B-D-p) (A-C-D-p) (A-C-D-p) (C-B-A-D-p) (C-B-A-D-p) (A-C-B-D-p) (A-C-B-D-p) (B-A-C-D-p) (B-A-C-D-p)

Withdraw Withdraw Withdraw Withdraw Withdraw Withdraw

slide-87
SLIDE 87

Policy disputes

ISP A ISP B ISP C

ISP C prefers route through B over direct route ISP B prefers route through A over direct route ISP A prefers route through C over direct route

Advertise(D-p)

Prefix P

ISP D

Advertise(A-D-p) Advertise(A-D-p) Advertise(C-D-p) Advertise(C-D-p) Advertise(B-D-p) Advertise(B-D-p)

(B-C-D-p) (B-A-D-p) (C-B-D-p) (C-B-D-p) (A-C-D-p) (A-C-D-p) (C-B-A-D-p) (C-B-A-D-p) (A-C-B-D-p) (A-C-B-D-p) (B-A-C-D-p) (B-A-C-D-p)

Withdraw Withdraw Withdraw Withdraw Withdraw Withdraw

slide-88
SLIDE 88

What Happens Here?

All nodes want to maximize capacity A high capacity link gets reduced to low capacity

Problem:“cost” does not change around loop Additive measures avoid this problem!

slide-89
SLIDE 89

No agreement on metrics?

  • If the nodes choose their paths according to

different criteria, then bad things might happen

  • Example
  • Node A is minimizing latency
  • Node B is minimizing loss rate
  • Node C is minimizing price
  • Any of those goals are fine, if globally adopted
  • Only a problem when nodes use different criteria
  • Consider a routing algorithm where paths are

described by delay, cost, loss

slide-90
SLIDE 90

What Happens Here?

Low price link Low loss link Low delay link Low loss link Low delay link Low price link Cares about price, then loss Cares about delay, then price Cares about loss, then delay

slide-91
SLIDE 91

Must agree on loop-avoiding metric

  • When all nodes minimize same metric
  • And that metric increases around loops
  • Then process is guaranteed to converge
slide-92
SLIDE 92

What happens when routers lie?

  • What if a router claims a 1-hop path to everywhere?
  • All traffic from nearby routers gets sent there
  • How can you tell if they are lying?
  • Can this happen in real life?
  • It has, several times….
slide-93
SLIDE 93

Link State vs. Distance Vector

  • Core idea
  • LS: tell all nodes about your immediate neighbors
  • DV: tell your immediate neighbors about (your least

cost distance to) all nodes

slide-94
SLIDE 94

Link State vs. Distance Vector

  • LS: each node learns the complete network map; each node

computes shortest paths independently and in parallel

  • DV: no node has the complete picture; nodes cooperate to

compute shortest paths in a distributed manner LS has higher messaging overhead LS has higher processing complexity LS is less vulnerable to looping

slide-95
SLIDE 95

Link State vs. Distance Vector

Message complexity

  • LS: O(NxE) messages;
  • N is #nodes; E is #edges
  • DV: O(#Iterations x E)
  • where #Iterations is ideally

O(network diameter) but varies due to routing loops or the count-to-infinity problem

Processing complexity

  • LS: O(N2)
  • DV: O(#Iterations x N)

Robustness: what happens if router malfunctions?

  • LS:
  • node can advertise incorrect link

cost

  • each node computes only its own

table

  • DV:
  • node can advertise incorrect path

cost

  • each node’s table used by others;

error propagates through network

slide-96
SLIDE 96

Routing: Just the Beginning

  • Link state and distance-vector are the deployed

routing paradigms for intra-domain routing

  • Next lecture: inter-domain routing (BGP)
  • new constraints: policy, privacy
  • new solutions: path vector routing
  • new pitfalls: truly ugly ones
slide-97
SLIDE 97

What are desirable goals for a routing solution?

  • “Good” paths (least cost)
  • Fast convergence after change/failures
  • no/rare loops
  • Scalable
  • #messages
  • table size
  • processing complexity
  • Secure
  • Policy
  • Rich metrics (more later)
slide-98
SLIDE 98

Delivery models

  • What if a node wants to send to more than one

destination?

  • broadcast: send to all
  • multicast: send to all members of a group
  • anycast: send to any member of a group
  • What if a node wants to send along more than one

path?

slide-99
SLIDE 99

Metrics

  • Propagation delay
  • Congestion
  • Load balance
  • Bandwidth (available, capacity, maximal, bbw)
  • Price
  • Reliability
  • Loss rate
  • Combinations of the above

In practice, operators set abstract “weights” (much like

  • ur costs); how exactly is a bit of a black art