1 More Routing EE122 Fall 2012 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson and.

Slides:



Advertisements
Similar presentations
Courtesy: Nick McKeown, Stanford
Advertisements

1 LINK STATE PROTOCOLS (contents) Disadvantages of the distance vector protocols Link state protocols Why is a link state protocol better?
Routing - I Important concepts: link state based routing, distance vector based routing.
1 Dijkstra’s Shortest Path Algorithm Gordon College.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 22 Introduction to Computer Networks.
Chapter 4 Distance Vector Problems, and Link-State Routing Professor Rick Han University of Colorado at Boulder
Introduction to Networking Bin Lin TA March 3 rd, 2005 Recital 6.
Routing & IP Routing Protocols
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Link State and Distance Vector Routing Computer Science Division Department of Electrical.
Link-State Routing Reading: Sections 4.2 and COS 461: Computer Networks Spring 2011 Mike Freedman
1 The Fundamentals of Routing EE122 Fall 2011 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica,
Link-State Routing Reading: Sections 4.2 and COS 461: Computer Networks Spring 2010 (MW 3:00-4:20 in COS 105) Michael Freedman
Announcement r Project 2 extended to 2/20 midnight r Project 3 available this weekend r Homework 3 available today, will put it online.
1 EE 122: Shortest Path Routing Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern.
1 Computer Networks Routing Algorithms. 2 IP Packet Delivery Two Processes are required to accomplish IP packet delivery: –Routing discovering and selecting.
4: Network Layer4a-1 14: Intro to Routing Algorithms Last Modified: 7/12/ :17:44 AM.
Announcement r Project 2 Extension ? m Previous grade allocation: Projects 40% –Web client/server7% –TCP stack21% –IP routing12% Midterm 20% Final 20%
EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)
Routing Algorithm March 3 rd, Routing Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links  link cost:
ROUTING ON THE INTERNET COSC Aug-15. Routing Protocols  routers receive and forward packets  make decisions based on knowledge of topology.
Network Layer Goals: understand principles behind network layer services: –routing (path selection) –dealing with scale –how a router works –advanced topics:
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Link-State Routing Protocols Routing Protocols and Concepts – Chapter.
Intra-Domain Routing D.Anderson, CMU Intra-Domain Routing RIP (Routing Information Protocol) & OSPF (Open Shortest Path First)
Computer Networking Lecture 10: Intra-Domain Routing
Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing.
Link-state routing  each node knows network topology and cost of each link  quasi-centralized: each router periodically broadcasts costs of attached.
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
13 – Routing Algorithms Network Layer.
The Network Layer Part 1: Routing EE 122, Fall 2013 Sylvia Ratnasamy
The Network Layer & Routing
1 Week 5 Lecture 2 IP Layer. 2 Network layer functions transport packet from sending to receiving hosts transport packet from sending to receiving hosts.
1 Even More Routing EE122 Fall 2012 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson.
Routing 2 CS457 Fall 2010.
Overview of Internet Routing (I) Fall 2004 CS644 Advanced Topics in Networking Sue B. Moon Division of Computer Science Dept. of EECS KAIST.
1 Computer Communication & Networks Lecture 21 Network Layer: Delivery, Forwarding, Routing Waleed.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 20 Omar Meqdadi Department of Computer Science and Software Engineering University.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
Spring 2000CS 4611 Routing Outline Algorithms Scalability.
Spring Routing: Part I Section 4.2 Outline Algorithms Scalability.
Network Layer (2). Review Physical layer: move bits between physically connected stations Data link layer: move frames between physically connected stations.
4: Network Layer4-1 Chapter 4: Network Layer Last time: r Chapter Goals m Understand network layer principles and Internet implementation r Started routing.
CS 6401 Intra-domain Routing Outline Introduction to Routing Distance Vector Algorithm.
Computer Networking Lecture 11: Intra-Domain Routing RIP (Routing Information Protocol) & OSPF (Open Shortest Path First)
Distance Vector and Link State Routing Pragyaditya Das.
CSE 421 Computer Networks. Network Layer 4-2 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 10: Intra-domain routing Slides used with.
IP tutorial - #2 Routing KAIST Dept. of CS NC Lab.
Network Layer.
The network layer: routing
Routing Jennifer Rexford.
Routing: Link State Algorithm
CS 457 – Lecture 12 Routing Spring 2012.
Intra-Domain Routing Jacob Strauss September 14, 2006.
Routing: Distance Vector Algorithm
Network layer functions
Routing in Packet Networks Shortest Path Routing
Road Map I. Introduction II. IP Protocols III. Transport Layer
CS 4700 / CS 5700 Network Fundamentals
CS 3700 Networks and Distributed Systems
Lowest-Cost Routing EE 122: Intro to Communication Networks
Intradomain Routing Outline Introduction to Routing
COS 561: Advanced Computer Networks
ECE453 – Introduction to Computer Networks
Communication Networks NETW 501
CS 3700 Networks and Distributed Systems
COMP/ELEC 429 Introduction to Computer Networks
Communication Networks
Routing: Link State Algorithm
Network Layer.
EE 122: Intra-domain routing: Link State
Presentation transcript:

1 More Routing EE122 Fall 2012 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson and other colleagues at Princeton and UC Berkeley

Let’s focus on clarifying questions I love the degree of interaction in this year’s class But there are many people who are confused I’d like to give them the chance to ask about basics So today, let’s give priority to questions of the form –“I don’t understand X” or “how does that work?” Ask speculative questions during or after break 2

Warning…. This lecture contains detailed calculations Prolonged exposure may induce drowsiness To keep you awake I will be tossing beanbags –Do not misplace them –Do not read the sheet of paper attached –If you’ve already participated, hand to nbr who hasn’t 3

Logic Refresher A if B means B  A – if B is true, then A is true A only if B means A  B – if A is true, then B is true A if and only if B means: A  B 1.If A is true, then B is true 2.If B is true, then A is true To make the statement that A if and only if B, you must prove statements 1 and 2. 4

Short Summary of Course Architecture, layering, E2E principle, blah, blah,… –How functionality is organized There are only two important design challenges: –Reliable Transport and Routing Reliable Transport: A transport mechanism is “reliable” if and only if it resends all dropped or corrupted packets Routing: Global routing state is valid if and only if there are no dead ends (easy) and there are no loops (hard) 5

10 Years from Now…. If you remember nothing else from this course except this single slide, I’ll be very happy If you don’t remember this slide, you have wasted your time… 6

Previous Routing Lecture We assume destination-based forwarding The key challenge is to compute loop-free routes This is easy when the topology is a tree –Loops are impossible without reversing a packet –Flooding always will find the destination –Can use “learning” to reduce need for flooding But this approach has serious disadvantages –Can’t use entire network, must restrict to tree –Does not react well to failures or host movement –Universally hated by operators…. 7

Other Ways to Avoid Loops? If I gave you a network graph, could you define loop-free paths to a given destination? Simple algorithm: –For given source, pick an arbitrary path that doesn’t loop –For any node not on path, draw a path that does not contradict earlier path –Continue until all nodes are covered Can pick any spanning tree rooted at destination 8

Example 9

Loops are easy to avoid…..if you have the whole graph Centralized or pseudo-centralized computation –Requirement: routes computed knowing global view –One node can do calculation for everyone –Or each node can do calculation for themselves But question is: how do you construct global view? 10

11 Link-State Details in Section

12 Link-State Routing Is Conceptually Simple Each router keeps track of its incident links Each router broadcasts the link state –To give every router a complete view of the graph Each router computes paths using same algorithm Example protocols –Open Shortest Path First (OSPF) –Intermediate System – Intermediate System (IS-IS) Challenges: scaling, transient disruptions

13 Link State Routing Each node floods its local information Each node then knows entire network topology Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7N6

14 Link State: Each Node Has Global View Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7N6 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

How to Compute Routes Each node should have same global view They each compute their own routing tables Using exactly the same algorithm Can use any algorithm that avoids loops Computing shortest paths is one such algorithm –Associate “cost” with links, don’t worry what it means…. –Dijkstra’s algorithm is one way to compute shortest paths We will review Dijkstra’s algorithm briefly –But that’s just because it is expected from such courses oSnore…. 15

“Least Cost” Routes No sensible cost metric will be minimized by traversing a loop “Least cost” routes an easy way to avoid loops Least cost routes are also “destination-based” –i.e., do not depend on the source –Why is this? Therefore, least-cost paths form a spanning tree 16

17 Example A E D CB F

Dijkstra’s Shortest Path Algorithm INPUT: –Network topology (graph), with link costs OUTPUT: –Least cost paths from one node to all other nodes –Produces “tree” of routes oDifferent from what we talked about before oPrevious tree was rooted at destination oThis is rooted at source oBut shortest paths are reversible! Warnings: –There is a typo, but I don’t remember where (prize!) –Most claim to know Dijkstra, but in practice they don’t 18

19 Notation c(i,j): link cost from node i to j; cost infinite if not direct neighbors; ≥ 0 D(v): current value of cost of path from source to destination v p(v): predecessor node along path from source to v, that is next to v S: set of nodes whose least cost path definitively known A E D CB F Source

20 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): predecessor node along path from source to v, that is next to v S: set of nodes whose least cost path definitively known

21 Example: Dijkstra’s Algorithm Step start 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 CB F 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) = ; …

22 Example: Dijkstra’s Algorithm Step start 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; 11update D(v) for all v adjacent to w and not in S: 12If 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 CB F D(D),p(D) 1,A D(E),p(E) D(F),p(F)

23 Example: Dijkstra’s Algorithm Step start 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 CB F … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11update D(v) for all v adjacent to w and not in S: 12If 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;

24 Example: Dijkstra’s Algorithm Step start 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 CB F … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11update D(v) for all v adjacent to w and not in S: 12If 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;

25 Example: Dijkstra’s Algorithm Step start 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 CB F … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11update D(v) for all v adjacent to w and not in S: 12If 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;

26 Example: Dijkstra’s Algorithm Step start 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 CB F … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11update D(v) for all v adjacent to w and not in S: 12If 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;

27 Example: Dijkstra’s Algorithm Step start 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 … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11update D(v) for all v adjacent to w and not in S: 12If 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;

28 Example: Dijkstra’s Algorithm Step start 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 CB F … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S; 11update D(v) for all v adjacent to w and not in S: 12If 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;

29 Example: Dijkstra’s Algorithm Step start 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 CB F To determine path A  C (say), work backward from C via p(v)

30 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 CB F DestinationLink B(A,B) C(A,D) D E F

Complexity How much processing does running the Dijkstra algorithm take? Assume a network consisting of N nodes –Each iteration: check all nodes w not in S –N(N+1)/2 comparisons: O(N 2 ) –More efficient implementations: O(N log(N)) 31

32 Flooding the Topology Information Each router sends information out its ports The next node sends it out through all of its ports –Except the one where the information arrived –Need to remember previous msgs, suppress duplicates! X A CBD (a) XA C BD (b) X A CB D (c) XA CBD (d)

Making Flooding Reliable 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 How can it still fail? 33

When to Initiate Flood? Topology change –Link or node failure –Link or node recovery Configuration change –Link cost change –Potential problems with making cost dynamic! Periodically –Refresh the link-state information –Typically (say) 30 minutes –Corrects for possible corruption of the data 34

35 Convergence Getting consistent routing information to all nodes –E.g., all nodes having the same link-state database Forwarding is consistent after convergence –All nodes have the same link-state database –All nodes forward packets on same paths

36 Convergence Delay Time elapsed before every router has a consistent picture of the network Sources of convergence delay –Detection latency –Flooding of link-state information –Recomputation of forwarding tables –Storing forwarding tables Performance during convergence period –Lost packets due to blackholes and TTL expiry –Looping packets consuming resources –Out-of-order packets reaching the destination Very bad for VoIP, online gaming, and video

37 Inconsistent link-state database –Some routers know about failure before others –The shortest paths are no longer consistent –Can cause transient forwarding loops Transient Disruptions A E D CB F A E D CB F A and D think that this is the path to C E thinks that this is the path to C Loop!

38 Reducing Convergence Delay Faster detection –Smaller “hello” timers –Link-layer technologies that can detect failures Faster flooding –Flooding immediately –Sending link-state packets with high-priority Faster computation –Faster processors on the routers –Incremental Dijkstra algorithm Faster forwarding-table update –Data structures supporting incremental updates

39 Scaling Link-State Routing Overhead of link-state routing –Flooding link-state packets throughout the network –Running Dijkstra’s shortest-path algorithm –Becomes unscalable when 100s of routers Introducing hierarchy through “areas” Area 0 Area 1 Area 2 Area 3 Area 4 area border router

What about other approaches? Link-state is essentially a centralized computation: –Global state, local computation What about a more distributed approach? –Local state, global computation 40

41 Learn-By-Doing I need 40 volunteers If you haven’t participated, this is your chance!

The Task Remove sheet of paper from beanbag, but do not look at sheet of paper until I say so You will have five minutes to complete this task Each sheet says: You are node X You are connected to nodes Y,Z Your job: find route from source (node 1) to destination (node 40) in five minutes 42

Ground Rules You may not: –Leave your seat (but you can stand) –Pass your sheet of paper –Let anyone copy your sheet of paper You may: –Ask nearby friends for advice –Shout to other participants (anything you want) –Curse your instructor (sotto voce) You must: Try 43

Go! 44

46 Distance-Vector Details in Section

Distributed Computation of Routes More scalable than Link-State –No global flooding Each node computing the outgoing port based on: –Local information (who it is connected to) –Paths advertised by neighbors Algorithms differ in what these exchanges contain –Distance-vector: just the distance to each destination –Path-vector: the entire path to each destination We will focus on distance-vector for now 47

Example of Distributed Computation 48 I am one hop away I am two hops away I am three hops away Destination I am three hops away

This is what you could have done Destination stands up Announces neighbors –They stand up They announce their neighbors –They stand up (if they haven’t already done so) –They remember who called them to stand …..and so on, until source stands Key point: don’t stand up twice! 49

Step 1 Destination stands up 50

Step 1 51

Step 2 Destination stands up Announces neighbors –They stand up 52

Step 2 53 I am one hop away

Step 3 Destination stands up Announces neighbors –They stand up They announce their neighbors –They stand up 54

Step 3 55 I am two hops away

Why Not Stand Up Twice? Being called a second time means that there is a second (and longer) path to you –You already contacted your neighbors the first time –Your distance to destination is based on shorter path 56

Congratulations! You have “implemented” Distance-Vector routing –For a single destination –With the slowest code possible OK, so now let’s consider this more generally…. 57

Routing “Metrics” Algorithm finds path with smallest hop-count –More complicated if you route with a different metric Other routing goals (besides hop-count) –Path with highest capacity –Path with lowest latency –Path with most reliable links –…. Generally, assume every link has “cost” or weight associated with it, and you want to minimize cost 58

59 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” –E.g.: Router A: “I can get to router B with cost 11 via next hop router D” Routers exchange this Distance-Vector information with their neighboring routers –Vector because one entry per destination Routers update their idea of the best path using info from neighbors Iterative process converges to set of shortest paths

60 Information Flow in Distance Vector Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7N6

61 Information Flow in Distance Vector Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7N6

62 Information Flow in Distance Vector Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7N6 Why is this different from flooding?