Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CSE524: Lecture 12 Network layer Functions. 2 Where we’re at… Internet architecture and history Internet protocols in practice Application layer Transport.

Similar presentations


Presentation on theme: "1 CSE524: Lecture 12 Network layer Functions. 2 Where we’re at… Internet architecture and history Internet protocols in practice Application layer Transport."— Presentation transcript:

1 1 CSE524: Lecture 12 Network layer Functions

2 2 Where we’re at… Internet architecture and history Internet protocols in practice Application layer Transport layer Network layer –Network-layer functions Addressing, Demux to upper layer, Error detection, Delivery semantics Security, Fragmentation, Quality of service Routing –Algorithms »Link-state (Dijkstra’s SPT) »Distance-vector (Distributed Bellman-Ford) –Hierarchies –Specific network layer protocols (IP) and devices Data-link layer Physical layer

3 3 Recall Link-state algorithms –Broadcast all link states to each router –Each router performs Dijkstra’s shortest-path tree calculation to generate forwarding tables per- destination Now… –Analyzing link-state algorithms

4 4 NL: Link State Characteristics Computation overhead –n nodes –each iteration: need to check all nodes, w, not in N n*(n+1)/2 comparisons: O(n**2) more efficient implementations possible: O(n log(n)) Space requirements Bandwidth requirements Stability –Inconsistencies can cause transient loops –Consistent LSDBs required for loop-free paths A B C D 1 3 52 1 Packet from C  A may loop around BDC if B knows about failure and C & D do not X

5 5 NL: Link-state issues Oscillations possible: e.g., link cost = amount of carried traffic Example: path to A flaps as traffic routed clockwise and counter-clockwise Common problem in load-based link metrics –A. Khanna and J. Zinky, "The Revised ARPANET Routing Metric," in ACM SIGCOMM, 1989, pp. 45--46. A D C B 1 1+e e 0 e 1 1 0 0 A D C B 2+e 0 0 0 1+e 1 A D C B 0 2+e 1+e 1 0 0 A D C B 2+e 0 e 0 1+e 1 initially … recompute routing … recompute

6 6 NL: Distance vector routing algorithms Variants used in –Early ARPAnet –RIP (intra-domain routing protocol) –BGP (inter-domain routing protocol) Distributed next hop computation –“Gossip with immediate neighbors until you find the best route” –Best route is achieved when there are no more changes Unit of information exchange –Vector of distances to destinations

7 7 NL: Distance vector routing algorithms Exchange known distance information iteratively Example (Bellman 1957) –Start with link table (as with Dijkstra), calculate distance table iteratively –Distance table data structure table of known distances and next hops kept per node row for each possible destination column for each directly-attached neighbor to node example: in node X, for dest. Y via neighbor Z: D (Y,Z) X distance from X to Y, via Z as next hop c(X,Z) + min {D (Y,w)} Z w = = D (Y,*) X Minimum known distance from X to Y = H (Y) X = Next hop node from X to Y

8 8 NL: Distance table example A E D CB 7 8 1 2 1 2 D () A B C D A1764A1764 B 14 8 9 11 D5542D5542 E cost to destination via destination D (C,D) E c(E,D) + min {D (C,w)} D w = = 2+2 = 4 D (A,D) E c(E,D) + min {D (A,w)} D w = = 2+3 = 5 D (A,B) E c(E,B) + min {D (A,w)} B w = = 8+6 = 14 loop! H (Y) = X

9 9 NL: Distance table gives routing table D () A B C D A1764A1764 B 14 8 9 11 D5542D5542 E cost to destination via destination ABCD ABCD A,1 D,5 D,4 Outgoing link to use, cost destination Distance table Routing table H (Y) X

10 10 D j (k,*) NL: Bellman algorithm How to calculate best routes? i j k j’ k’ c(i,j) c(i,j’) D j’ (k,*) D i (k,*) For node i while there is a change in D { for all k not neighbor of i { for each j neighbor of i { D i (k,j) = c(i,j) + D j (k,*) if D i (k,j) < D i (k,*) { D i (k,*) = D i (k,j) H i (k) = j }

11 11 NL: Distributed Bellman-Ford Make Bellman algorithm distributed (Ford-Fulkerson 1962) –Each node i knows part of link table –Iterative Each node sends around and recalculates D[i,*] continues until no nodes exchange info. self-terminating: no “signal” to stop –Asynchronous nodes need not exchange info/iterate in lock step! “triggered updates” –Distributed each node communicates only with directly-attached neighbors

12 12 NL: Distributed Bellman-Ford overview Iterative, asynchronous: each local iteration caused by: local link cost change message from neighbor: its least cost path change from neighbor Distributed: each node notifies neighbors only when its least cost path to any destination changes –neighbors then notify their neighbors if necessary wait for (change in local link cost of msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Each node:

13 13 NL: Distributed Bellman-Ford algorithm 1 Initialization: 2 for all adjacent nodes v: 3 D X (*,v) = infinity /* the * operator means "for all rows" */ 4 D X (v,v) = c(X,v) 5 for all destinations, y 6 send min w D X (y,w) to each neighbor /* w over all X's neighbors */ At all nodes, X:

14 14 NL: Distributed Bellman-Ford algorithm (cont.): 8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 12 if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D X (y,V) = D X (y,V) + d 16 17 else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min w D V (Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D X (Y,V) = c(X,V) + newval 22 23 if we have a new min w D X (Y,w)for any destination Y 24 send new value of min w D X (Y,w) to all neighbors 25 26 forever

15 15 NL: DBF example A B E C D Info at Node A B C D ABC 07~ 701 ~10 ~~2 7 1 1 2 28 Distance to Node D ~ ~ 2 0 E18~2 1 8 ~ 2 0 E Initial Distance Vectors

16 16 NL: DBF example Info at Node A B C D ABC 07 ~ 701 ~ 10 ~~ 2 Distance to Node D ~ ~ 2 0 E1842 1 8 ~ 2 0 E A B E C D 7 1 1 2 28 E Receives D’s Routes Updates cost to C

17 17 NL: DBF example Info at Node A B C D ABC 078 701 ~10 ~~2 Distance to Node D ~ ~ 2 0 E1842 1 8 ~ 2 0 E A B E C D 7 1 1 2 28 A receives B’s update Updates cost to C, but cost to E unchanged

18 18 NL: DBF example Info at Node A B C D ABC 075 701 ~10 ~~2 Distance to Node D 3 ~ 2 0 E1842 1 8 ~ 2 0 E A B E C D 7 1 1 2 28 A receives E’s routes Updates cost to C (new min) and D

19 19 NL: DBF example Info at Node A B C D ABC 065 601 510 332 Distance to Node D 3 3 2 0 E1542 1 5 4 2 0 E A B E C D 7 1 1 2 28 And so on, until final distances....

20 20 NL: DBF example dest A B C D ABD 1145 785 694 4112 Next hop E’s routing table A B E C D 7 1 1 2 28

21 21 NL: DBF (another example) X Z 1 2 7 Y See book for explanation of this example

22 22 NL: DBF (another example) X Z 1 2 7 Y D (Y,Z) X c(X,Z) + min {D (Y,w)} w = = 7+1 = 8 Z D (Z,Y) X c(X,Y) + min {D (Z,w)} w = = 2+1 = 3 Y

23 23 Analyzing Distributed Bellman-Ford Continuously send local distance tables of best known routes to all neighbors until your table converges –Computation diffuses until all nodes converge –Will computation converge quickly and deterministically? Not all the time Pathologic cases possible Several algorithms for minimizing such cases

24 24 NL: DBF (good news example) Link cost changes: node detects local link cost change updates distance table (line 15) if cost change in least cost path, notify neighbors (lines 23,24) fast convergence (see book for details) X Z 1 4 50 Y 1 algorithm terminates “good news travels fast”

25 25 NL: DBF (count-to-infinity example) Link cost changes: good news travels fast bad news travels slow - “count to infinity” problem! alternate route implicitly used link that changed X Z 1 4 50 Y 60 algorithm continues on!

26 26 NL: DBF: (count-to-infinity example) A 25 1 1 BC B C2 1 dest cost A C1 1 dest cost A B1 2 dest cost X

27 27 NL: DBF: (count-to-infinity example) A 25 1 BC B C2 1 dest cost A C1 ~ dest cost A B1 2 dest cost C Sends Routes to B

28 28 NL: DBF: (count-to-infinity example) A 25 1 BC B C2 1 dest cost A C1 3 dest cost A B1 2 dest cost B Updates Distance to A

29 29 NL: DBF: (count-to-infinity example) A 25 1 BC B C2 1 dest cost A C1 3 dest cost A B1 4 dest cost B Sends Routes to C

30 30 NL: DBF: (count-to-infinity example) A 25 1 BC B C2 1 dest cost A C1 5 dest cost A B1 4 dest cost C Sends Routes to B

31 31 NL: How are loops caused? Observation 1: –B’s metric increases Observation 2: –C picks B as next hop to A –But, the implicit path from C to A includes itself!

32 32 NL: Solutions to looping Split horizon –Do not advertise route to X to an adjacent neighbor if your route to X goes through that neighbor –If C routes through B to get to A, C does not advertise (C=>A) route to B. Poisoned reverse –Advertise an infinite distance route to X to an adjacent neighbor if your route to X goes through that neighbor –If C routes through B to get to A, C advertises to B that its distance to A is infinity Works for two node loops –Does not work for loops with more nodes

33 33 NL: Split-horizon with poisoned reverse If Z routes through Y to get to X : Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) will this completely solve count to infinity problem? X Z 1 4 50 Y 60 algorithm terminates new route to X not involving Y can now select and advertise route to X via Z route to X through Y goes thru Z poison it!

34 34 NL: Solutions to looping 1 1 1 1 A X B C D

35 35 NL: Solutions to looping Route poisoning –Advertise infinite cost on a route to everyone (not just next hop) when lowest cost route increases –Gets rid of stale information throughout network –Used in conjunction with Path Holdown Path Holddown –Freeze route for a fixed time Do not switch to an alternate while route poisoning is happening In our example, A and B delay changing and advertising new routes A and B both set route to D to infinity after single step –Configuring holddown delay Delay too large: Slow convergence Delay too small: Count-to-infinity more probable

36 36 NL: Solutions to looping Path vector –Select loop-free paths –Each route advertisement carries entire path –If a router sees itself in path, it rejects the route –BGP does it this way –Space proportional to diameter of network

37 37 NL: Solutions to looping Do solutions completely eliminate loops? –No! Transient loops are still possible –Why? Because implicit path information may be stale –See this in BGP convergence Only way to fix this –Ensure that you have up-to-date information by explicitly querying

38 38 NL: Comparing Link State vs. Distance Vector Network bandwidth –DV send everything you know to your neighbors large messages, transfers only to neighbors –LS send info about your neighbors to everyone small messages, but broadcast globally

39 39 NL: Link State vs. Distance Vector Convergence speed: –LS faster – don’t need to process LSPs before forwarding single SPT calculation –DV fast with triggered updates count-to-infinity problem Space requirements: –LS maintains entire topology –DV maintains only neighbor state path vector maintains routes proportional to network diameter

40 40 NL: Link State vs. Distance Vector Robustness: –LS can broadcast incorrect/corrupted LSP Can be made robust since sources are aware of alternate paths within topology –DV can advertise incorrect paths to all destinations Incorrect calculation can spread to entire network

41 41 NL: DUAL Distributed Update Algorithm –Garcia-Luna-Aceves 1989 –Goal: Avoid transient loops in DV and LS algorithms Similar in flavor to route poisoning and path holddown –2 ideas A path shorter than current path cannot contain a loop Based on diffusing computation (Dijkstra-Scholten 1980) –Wait until computation completes before changing routes in response to a new update –Similar to path-holddown –3 kinds of messages Update, query, reply –2 states for routers Active (queries outstanding), passive

42 42 NL: DUAL On update if (lower cost) adopt else if (higher cost) { if (from next hop) { if (any path exists < old length from next hop) switch path else freeze route send query to all neighbors except next hop go into active wait for reply from all neighbors update route return to passive } send reply to all querying neighbors }

43 43 NL: Routing Hierarchies Flat routing doesn’t scale –Each node/router cannot be expected to store routes to every destination (or destination network) –50 million destinations –Route table exchange would swamp network Key observation –Need less information with increasing distance to destination Two radically different approaches for routing –The area hierarchy –The landmark hierarchy Covered in advanced topics at end of course...

44 44 NL: Areas Divide network into areas –Areas can have nested sub-areas –No path between two sub-areas of an area can exit that area –Within area, each node has routes to every other node –Outside area Each node has routes for other top-level areas only Inter-area packets are routed to nearest appropriate border router Can result in sub-optimal paths Hierarchically address nodes in a network –Sequentially number top-level areas –Sub-areas of area are labeled relative to that area –Nodes are numbered relative to the smallest containing area

45 45 NL: Network layer functions summary Each networking layer provides varying degrees of functionality including…. –security, delivery semantics, quality of service, demux to upper layer, error detection, fragmentation, addressing, routing Next: IP network layer –IP demux to upper layer –IP error detection –IP delivery semantics –IP security –IP fragmentation –IP quality-of-service –IP addressing –IP routing


Download ppt "1 CSE524: Lecture 12 Network layer Functions. 2 Where we’re at… Internet architecture and history Internet protocols in practice Application layer Transport."

Similar presentations


Ads by Google