interplay between routing and forwarding routing
play

Interplay between routing and forwarding routing algorithm Routing - PDF document

Interplay between routing and forwarding routing algorithm Routing Algorithms and Routing local forwarding table header value output link in the Internet 0100 3 0101 2 0111 2 1001 1 value in arriving packets header 1 0111 2 3


  1. Interplay between routing and forwarding routing algorithm Routing Algorithms and Routing local forwarding table header value output link in the Internet 0100 3 0101 2 0111 2 1001 1 value in arriving packet’s header 1 0111 2 3 Network Layer 4-1 Network Layer 4-2 Graph abstraction Graph abstraction: costs 5 5 • c(x,x’) = cost of link (x,x’) 3 v w 3 v w 5 2 5 2 - e.g., c(w,z) = 5 u z 2 1 u z 2 1 3 3 1 1 • cost could always be 1, or 2 x y 2 x y Graph: G = (N,E) 1 inversely related to bandwidth, 1 or inversely related to N = set of routers = { u, v, w, x, y, z } congestion Cost of path (x 1 , x 2 , x 3 ,…, x p ) = c(x 1 ,x 2 ) + c(x 2 ,x 3 ) + … + c(x p-1 ,x p ) E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Question: What’s the least-cost path between u and z ? Remark: Graph abstraction is useful in other network contexts Routing algorithm: algorithm that finds least-cost path Example: P2P, where N is set of peers and E is set of TCP connections Network Layer 4-3 Network Layer 4-4 Routing Algorithm classification A Link-State Routing Algorithm Global or decentralized Static or dynamic? Dijkstra’s algorithm Notation: information? Static: net topology, link costs known ❒ c(x,y): link cost from node x Global: ❒ to all nodes ❒ routes change slowly over to y; = ∞ if not direct all routers have complete ❒ ❍ accomplished via “link neighbors topology, link cost info time state broadcast” “link state” algorithms ❒ D(v): current value of cost of Dynamic: ❒ ❍ all nodes have same info Decentralized: path from source to dest. v ❒ routes change more quickly computes least cost paths ❒ router knows physically- ❒ p(v): predecessor node along ❒ from one node (‘source”) to all ❍ periodic update connected neighbors, link path from source to v other nodes costs to neighbors ❍ in response to link cost ❒ N': set of nodes whose least ❍ gives forwarding table for iterative process of changes ❒ cost path definitively known that node computation, exchange of info iterative: after k iterations, with neighbors ❒ know least cost path to k “distance vector” algorithms ❒ dest.’s Network Layer 4-5 Network Layer 4-6 1

  2. Dijsktra’s Algorithm Dijkstra’s algorithm: example 1 Initialization: Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z) 2 N' = {u} 0 u 2,u 5,u 1,u ∞ ∞ 3 for all nodes v 1 ux 2,u 4,x 2,x ∞ 4 if v adjacent to u 2 uxy 2,u 3,y 4,y 5 then D(v) = c(u,v) 3 uxyv 3,y 4,y 6 else D(v) = ∞ 4 uxyvw 4,y 7 5 uxyvwz 8 Loop 9 find w not in N' such that D(w) is a minimum 5 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 3 v w 5 12 D(v) = min( D(v), D(w) + c(w,v) ) 2 13 /* new cost to v is either old cost to v or known u z 2 1 3 14 shortest path cost to w plus cost from w to v */ 1 2 x 15 until all nodes in N' y 1 Network Layer 4-7 Network Layer 4-8 Dijkstra’s algorithm, discussion Distance Vector Algorithm (1) Algorithm complexity: n nodes Bellman-Ford Equation (dynamic programming) ❒ each iteration: need to check all nodes, w, not in N Define ❒ n(n+1)/2 comparisons: O(n 2 ) d x (y) := cost of least-cost path from x to y ❒ more efficient implementations possible: O(nlogn) Oscillations possible: ❒ e.g., link cost = amount of carried traffic Then A A A 1 A d x (y) = min {c(x,v) + d v (y) } 1+e 2+e 0 0 2+e 2+e 0 D B D B D 0 B D B 0 1+e 1 0 0 1+e 1 e 0 0 0 1 1+e e 0 C C C C 1 1 where min is taken over all neighbors of x e … recompute … recompute … recompute initially routing Network Layer 4-9 Network Layer 4-10 Bellman-Ford example (2) Distance Vector Algorithm (3) 5 ❒ D x (y) = estimate of least cost from x to y Clearly, d v (z) = 5, d x (z) = 3, d w (z) = 3 3 v w 5 ❒ Distance vector: D x = [D x (y): y є N ] 2 B-F equation says: u 2 z 1 3 ❒ Node x knows cost to each neighbor v: 1 d u (z) = min { c(u,v) + d v (z), 2 x y c(x,v) 1 c(u,x) + d x (z), c(u,w) + d w (z) } ❒ Node x maintains D x = [D x (y): y є N ] = min {2 + 5, ❒ Node x also maintains its neighbors’ 1 + 3, distance vectors 5 + 3} = 4 Node that achieves minimum is next ❍ For each neighbor v, x maintains hop in shortest path ➜ forwarding table D v = [D v (y): y є N ] Network Layer 4-11 Network Layer 4-12 2

  3. Distance vector algorithm (4) Distance Vector Algorithm (5) Iterative, asynchronous: Each node: Basic idea: each local iteration caused ❒ Each node periodically sends its own distance by: wait for (change in local link vector estimate to neighbors ❒ local link cost change cost of msg from neighbor) ❒ When node a node x receives new DV estimate ❒ DV update message from from neighbor, it updates its own DV using B-F neighbor equation: recompute estimates Distributed: D x (y) ← min v {c(x,v) + D v (y)} for each node y ∊ N ❒ each node notifies ❒ Under minor, natural conditions, the estimate if DV to any dest has neighbors only when its changed, notify neighbors D x (y) converge the actual least cost d x (y) DV changes ❍ neighbors then notify their neighbors if necessary Network Layer 4-13 Network Layer 4-14 D x (z) = min{ c(x,y) + D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} D y (z), c(x,z) + D z (z) } Distance Vector: link cost changes = min{2+0 , 7+1} = 2 node x table = min{2+1 , 7+0} = 3 cost to cost to cost to x y z x y z x y z Link cost changes: 1 x 0 2 7 x 0 2 3 x 0 2 3 y from from ❒ node detects local link cost change from y y 2 0 1 4 1 ∞ ∞ ∞ y 2 0 1 z z 7 1 0 ❒ updates routing info, recalculates x ∞ ∞ ∞ z z 3 1 0 50 node y table distance vector cost to cost to cost to y x y z x y z x y z ❒ if DV changes, notify neighbors 2 1 x ∞ ∞ x 0 2 7 ∞ x 0 2 3 z x At time t 0 , y detects the link-cost change, updates its DV, from from from y y 7 2 0 1 y 2 0 1 “good and informs its neighbors. 2 0 1 z z ∞ ∞ ∞ 7 1 0 z 3 1 0 news node z table cost to cost to At time t 1 , z receives the update from y and updates its table. cost to travels x y z x y z It computes a new least cost to x and sends its neighbors its DV. x y z fast” x 0 2 7 x 0 2 3 x ∞ ∞ ∞ from from from At time t 2 , y receives z ’s update and updates its distance table. y y 2 0 1 y 2 0 1 ∞ ∞ ∞ y ’s least costs do not change and hence y does not send any z z z 3 1 0 3 1 0 7 1 0 message to z . time Network Layer 4-15 Network Layer 4-16 Distance Vector: link cost changes Comparison of LS and DV algorithms Message complexity Robustness: what happens if Link cost changes: router malfunctions? 60 LS: with n nodes, E links, O(nE) good news travels fast ❒ y ❒ LS: msgs sent 4 1 bad news travels slow - “count ❒ ❍ node can advertise incorrect DV: exchange between x z ❒ to infinity” problem! link cost 50 neighbors only ❍ each node computes only its 44 iterations before ❒ ❍ convergence time varies own table algorithm stabilizes: see text DV: Speed of Convergence Poissoned reverse: ❍ DV node can advertise LS: O(n 2 ) algorithm requires ❒ If Z routes through Y to get incorrect path cost ❒ O(nE) msgs to X : ❍ each node’s table used by ❍ may have oscillations others ❍ Z tells Y its (Z’s) distance to DV: convergence time varies ❒ • error propagate thru network X is infinite (so Y won’t route ❍ may be routing loops to X via Z) ❍ count-to-infinity problem will this completely solve ❒ count to infinity problem? Network Layer 4-17 Network Layer 4-18 3

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend