Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ......

27
Discussion 8: Link State Routing CSE 123: Computer Networks Marti Motoyama & Chris Kanich

Transcript of Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ......

Page 1: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Discussion 8:

Link State Routing

CSE 123: Computer Networks

Marti Motoyama & Chris Kanich

Page 2: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Schedule

Project Questions:

Email Chris, post to moodle, or attend his OH

Homework Questions?

Link State Discussion

CSE 123 – Discussion 8 2

Page 3: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Autonomous Systems

Autonomous systems: a network that is under the

control of a single administrative entity

Internet is not a single network; it is composed of multiple

ASes (e.g. UCSD, ISPs, big corporations, etc.)

Goals:

ASes want to choose their own local routing algorithms (intra-

domain routing)

» Link State, e.g., Open Shortest Path First (OSPF)

» Distance Vector, e.g., Routing Information Protocol (RIP)

ASes want to set policies about non-local routing (inter-

domain routing)

» Border Gateway Routing (BGP), which you’ll see later….

CSE 123 – Discussion 8 3

Page 4: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Internet Today

Figure 4.29 in the book

Each oval corresponds to a different AS

You will learn more about this picture in later lectures

CSE 123 – Discussion 8 4

Page 5: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Routing

We mentioned the term routing

First, let’s make distinction between what you’ve seen

previously, forwarding….

Forwarding (data plane): moving packets between

ports

Look up the destination address in forwarding table

Locate {out-port} or {out-port, MAC address} pair

Routing (control plane): process of populating

forwarding table

Routers exchange messages about networks they can reach

Goal is to find an “optimal” route for every destination

CSE 123 – Discussion 8 5

Page 6: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Routing Strategies

Routing requires knowledge of the network structure

This is often sensitive information…

Centralized global state: Single entity knows the complete network

structure, can calculate all routes centrally

Problems with this approach?

Distributed, global state: Every router knows the complete network

structure, routers can independently calculate routes

Problems with this approach?

Distributed, no-global state: Every router knows only about its

neighboring routers, routers can independently calculate routes

Problems with this approach?

CSE 123 – Discussion 8 6

Page 7: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Modeling a Network

Modeled a network as a graph:

Routers nodes

Links edges

» Associated with each edges is a cost

» What are some metrics you might use as cost?

Latency, bandwidth, utilization, queue length, etc

CSE 123 – Discussion 8 7

A

E D

C B

F

2

2

1 3

1

1

2

5

3

5

Page 8: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State: Control Traffic

Each node floods its local information to every other node in the network

Each node knows the entire network topology and can compute shortest paths to other nodes using Dijkstra’s

CSE 123 – Discussion 8 8

Host A

Host B Host E

Host D

Host C

N1 N2

N3

N4

N5

N7 N6

Page 9: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State: Node State

CSE 123 – Discussion 8 9

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

Page 10: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State Question

Name some problems that would arise if all routing in

the Internet was done using Link-State and Dijkstra’s

algorithm.

CSE 123 – Discussion 8 10

Page 11: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Implementing Link State Routing

As given in the book on page 281

As always, intimately understand version given in lecture

Overview:

Each node maintains two lists:

» Tentative (similar to Q): nodes whose shortest paths still need to

be computed, we know about their existences

» Confirmed (similar to S): nodes whose shortest paths are known

Each list contains entries of the type:

» {Destination, Cost, Next Hop}.

The two lists are continuously updated as new nodes are

added to the shortest path tree (as in the Dijkstra’s algorithm).

CSE 123 – Discussion 8 11

Page 12: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Book Algorithm in Gory Detail

1. Initialize Confirmed list with myself, cost = 0

2. For node Next added to Confirmed in the previous step, select its LSP. Call NextHop the node used to reach Next.

3. For each neighbor of Next, calculate cost to reach Neighbor

Cost(me, Neighbor) = Cost(me, Next) + Cost(Next, Neighbor)

a) If Neighbor not on Tentative or Confirmed:

b) If Neighbor is on Tentative:

4. If Tentative list is empty, stop. Else, pick entry from the Tentative list with lowest cost and move it to Confirmed list. Return to Step 2.

CSE 123 – Discussion 8 12

If cost computed is less than the cost currently listed for Neighbor, replace the entry with {Neighbor, Cost, NextHop}. Else, do nothing.

Add {Neighbor, Cost, NextHop} to Tentative

Page 13: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State Example

Problem: Build routing table for A

Initialize Confirmed list with myself, cost = 0

CSE 123 – Discussion 8 13

Step Confirmed Tentative

1 (A, 0, -)

A

E D

C B

F

2

2

1 3

1

1

2

5

3

5

Page 14: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State Example

If Neighbor not on Tentative or Confirmed: add

{Neighbor, Cost, NextHop} to Tentative

CSE 123 – Discussion 8 14

Step Confirmed Tentative

2 (A, 0, -)

A

E D

C B

F

2

2

1 3

1

1

2

5

3

5

(B,2,B), (C,5,C), (D,1,D)

Page 15: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State Example

Pick entry from the Tentative list with lowest cost and

move it to Confirmed list.

CSE 123 – Discussion 8 15

Step Confirmed Tentative

3 (A, 0, -), (B,2,B), (C,5,C), (D,1,D)

A

E D

C B

F

2

2

1 3

1

1

2

5

3

5

Page 16: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State Example

Node Next D

If Neighbor is on Tentative: If cost computed is less than the

cost currently listed for Neighbor, replace the entry with

{Neighbor, Cost, NextHop}. Else, do nothing.

CSE 123 – Discussion 8 16

Step Confirmed Tentative

4.i (A, 0, -), (D,1,D)

(B ), (C, ), ,2,B 4,D

A

E D

C B

F

2

2

1 3

1

1

2

5

3

5

Page 17: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State Example

Node Next D

If Neighbor not on Tentative or Confirmed: add {Neighbor,

Cost, NextHop} to Tentative

CSE 123 – Discussion 8 17

Step Confirmed Tentative

4.ii (A, 0, -), (D,1,D)

(B 2,B), (C,4,D), , (E,2,D),

A

E D

C B

F

2

2

1 3

1

1

2

5

3

5

Page 18: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link State Example

And so on…

Final Routing Table:

CSE 123 – Discussion 8 18

Step Confirmed Tentative

? (A,0,-),(B,2,B),(C,3,D), (D,1,D),(E,2,D),(F,4,D)

A

E D

C B

F

2

2

1 3

1

1

2

5

3

5

Page 19: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

The Forwarding Table

• Running Dijkstra at node A gives the shortest path from A to all destinations

• We then construct the forwarding table

CSE 123 – Discussion 8 19

A

E D

C B

F

2

2

1 3

1

1

2

5

3

5 Destination Interface

B

C

D

E

F

if1

if0

if2

if0

Page 20: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Complexity

How much processing does running the Dijkstra

algorithm take?

Assume a fully connected network with N nodes:

Each iteration: need to check all nodes not in Confirmed

» 1st iteration: search through all (N-1) nodes in Tentative to find

one with minimum cost

» 2nd iteration: search through all (N-2) nodes in Tentative to find

one with minimum cost

» ~N(N+1)/2 comparisons O(N2)

More efficient implementations possible using sorting

algorithms O(N log(N))

CSE 123 – Discussion 8 20

Page 21: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Obtaining Global State

Flooding

Each router sends link-state information out its links

The next node sends it out through all of its links

» Except the one where the information arrived

CSE 123 – Discussion 8 21

X A

C B D

(a)

X A

C B D

(b)

X A

C B D

(c)

X A

C B D

(d)

Page 22: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Flooding the Link State

Reliable flooding

Ensure all nodes receive link-state information

Ensure all nodes use the latest version

Challenges:

Packet loss

Out-of-order arrival

Solutions:

Acknowledgments and retransmissions

Sequence numbers

Time-to-live for each packet

CSE 123 – Discussion 8 22

Page 23: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Flooding the Link State

Topology change Link or node failure

Link or node recovery

Configuration change Link cost change

Coping with a dynamic environment: Periodically refresh the link-state information

Typically (say) 30 minutes

Corrects for possible corruption of the data

CSE 123 – Discussion 8 23

Page 24: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link Costs

About those link costs...

Importance of Cost Metric:

Choice of link cost defines traffic load

Low cost = high probability that link belongs to shortest path

tree and will attract traffic, which increases cost

Main problem: convergence

Want to avoid oscillations while achieving good network

utilization

CSE 123 – Discussion 8 24

Page 25: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Link Cost Question

Explain why using a static cost metric like hop count is

a bad idea.

CSE 123 – Discussion 8 25

Page 26: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Load Sensitivity Question

CSE 123 – Discussion 8 26

A

B

C

D

• Assume the routing protocol computes the shortest path, where the

cost of a link represents its traffic load (i.e., the amount of traffic on

the link). The traffic from A to D represents the only traffic in the

network.

• Which route is the traffic from A to D going to use? Is the route

stable? Explain why, or why not.

Page 27: Discussion 8: Link State Routing - Computer Science and ... · Discussion 8: Link State Routing ... Build routing table for A ... sensitive routing algorithm on TCP performance? Consider

Load Sensitivity Question

CSE 123 – Discussion 8 27

A

B

C

D

• Assume the traffic from A to D is TCP and assume that the round-

trip time along A B D is much higher than the round-trip-time

along A C D. What are some negative impacts of the load-

sensitive routing algorithm on TCP performance? Consider the

effects in particular on TCP that implements fast retransmission.