Download presentation
Presentation is loading. Please wait.
1
CS 5565 Network Architecture and Protocols
Lecture 18 Godmar Back
2
Announcements Project 2A due Apr 4 Project 2B due in 2 parts:
CS 5565 Spring 2012
3
Routing Algorithms
4
Routing Algorithm Classification
Global or decentralized information? Global: all routers have complete topology, link cost info “link state” algorithms Decentralized: router knows physically-connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors “distance vector” algorithms Static or dynamic? Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes Note: Global/decentralized classification does not say where routing computation is performed, it says what information one has when computing routes CS 5565 Spring 2012
5
Link State Routing Routers periodically broadcast link state information link state messages or LSA (link state advertisement) broadcast via sequence-number controlled flooding All routers acquire complete connectivity + link cost information of entire network Each router computes routing table from that obtained topology Dijkstra’s shortest path to other routers, from computing router this becomes forwarding table CS 5565 Spring 2012
6
Distance Vector Algorithm (1)
Bellman-Ford Equation (dynamic programming) Define dx(y) := cost of least-cost path from x to y Then dx(y) = min {c(x,v) + dv(y) } where min is taken over all neighbors of x CS 5565 Spring 2012
7
Bellman-Ford Example (2)
u y x w v z 2 1 3 5 Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3 B-F equation says: du(z) = min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieves minimum is next hop in shortest path ➜ forwarding table CS 5565 Spring 2012
8
Distance Vector Algorithm (3)
Dx(y) = estimate of least cost from x to y Distance vector: Dx = [Dx(y): y N ] Node x knows cost to each neighbor v: c(x,v) Node x maintains Dx = [Dx(y): y N ] Node x also maintains its neighbors’ distance vectors (at least temporarily) For each neighbor v, x maintains Dv = [Dv(y): y N ] CS 5565 Spring 2012
9
Distance Vector Algorithm (4)
Basic Idea: Each node periodically sends its own distance vector estimate to neighbors When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N Under minor, natural conditions, the estimate Dx(y) converges to actual least cost dx(y) CS 5565 Spring 2012
10
Distance Vector Algorithm (5)
Iterative, asynchronous: each local iteration caused by: local link cost change DV update message from neighbor Distributed: each node notifies neighbors only when its DV changes neighbors then notify their neighbors if necessary Each node: wait for (change in local link cost of msg from neighbor) recompute estimates if DV to any dest has changed, notify neighbors CS 5565 Spring 2012
11
Example DV Routing - 1 2 5 1 1 1 - 4 2 5 4 2 2 4 - 1 1 3 5 1 -
- 1 2 5 1 1 1 - 4 2 5 4 2 2 4 - 1 1 3 5 1 - CS 5565 Spring 2012
12
Example (cont’d) Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N - 1
2 5 - 1 2 3 - 1 2 3 1 1 - 4 1 - 3 5 1 - 3 4 2 4 2 4 - 1 2 3 - 1 2 3 - 1 5 1 5 1 - 3 5 1 - 3 4 1 - time Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N CS 5565 Spring 2012
13
Example (cont’d) Converged after 3 iterations
What if link cost changes? 1 2 3 - 4 CS 5565 Spring 2012
14
Distance Vector: Link Cost Changes
node detects local link cost change updates routing info, recalculates distance vector if DV changes, notify neighbors 1 y 4 1 x z 50 At time t0, y detects the link-cost change, updates its DV, and informs its neighbors. At time t1, z receives the update from y and updates its table. It computes a new least cost to x and sends its neighbors its DV. At time t2, y receives z’s update and updates its distance table. y’s least costs do not change and hence y does not send any message to z. “good news travels fast” CS 5565 Spring 2012
15
Count-To-Infinity Before change: x y z 51 50 x z y 60 y to x via z
4 50 y Before change: - 4 5 4 - 1 5 1 - 50 51 - 1 5 60 50 51 - 1 6 50 51 - 1 7 50 51 - 1 8 x y z y to x via z z to x via y y to x via z CS 5565 Spring 2012
16
Distance Vector: Link Cost Changes
good news travels fast bad news travels slow - “count to infinity” problem! 44 iterations before algorithm stabilizes 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 CS 5565 Spring 2012
17
Poisoned Reverse After change: x y z x z y 60 50 1 y to x via z
4 50 y After change: - 51 50 51 - 1 5 1 - - 51 50 - 51 50 50 51 - 1 50 51 - 1 x 60 51 - 1 - 1 6 - 1 y 50 1 5 1 - 50 1 - z y to x via z Don’t tell z dist to x z to x via x CS 5565 Spring 2012
18
Comparison of LS and DV algorithms
Message complexity LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n2) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem Robustness: what happens if router malfunctions? LS: node can advertise incorrect link cost each node computes only its own table DV: DV node can advertise incorrect path cost each node’s table used by others error propagates thru network CS 5565 Spring 2012
19
Hierarchical Routing Our routing study thus far - idealization
all routers identical network “flat” … not true in practice scale: with 200 million destinations: can’t store all dest’s in routing tables! routing table exchange would swamp links! administrative autonomy internet = network of networks each network admin may want to control routing in its own network CS 5565 Spring 2012
20
Hierarchical Routing aggregate routers into regions, “autonomous systems” (AS) routers in same AS run same routing protocol “intra-AS” routing protocol routers in different AS may run different intra-AS routing protocols Gateway router Direct link to router in another AS Example: [AS1312] CS 5565 Spring 2012
21
Interconnected ASes 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b Intra-AS Routing algorithm Inter-AS Forwarding table 3c Forwarding table is configured by both intra- and inter-AS routing algorithm Intra-AS sets entries for internal dests Inter-AS & Intra-AS sets entries for external dests CS 5565 Spring 2012
22
Inter-AS tasks AS1 needs:
to learn which dests are reachable through AS2 and which through AS3 to propagate this reachability info to all routers in AS1 Job of inter-AS routing! Suppose router in AS1 receives datagram for which dest is outside of AS1 Router should forward packet towards one of the gateway routers, but which one? 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c CS 5565 Spring 2012
23
Inter-AS tasks (cont’d)
Scenario 1 Destination x is reachable through single AS Inter-AS must propagate this information inside AS Suppose router in AS1 receives datagram for which dest is outside of AS1 Router should forward packet towards one of the gateway routers, but which one? Least cost path to 1c is interface l, add (x, l) to routing table AS3 advertises route to x 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c AS2 does not advertise route to x Spread in AS1: use gateway 1c to get to x CS 5565 Spring 2012
24
Hot Potato Routing Scenario 2:
Destination is reachable through multiple AS: Hot potato routing: send packet towards closest of two routers Suppose router in AS1 receives datagram for which dest is outside of AS1 Router should forward packet towards one of the gateway routers, but which one? 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c CS 5565 Spring 2012
25
Hot Potato Routing Scenario 2:
Destination is reachable through multiple AS: Hot potato routing: send packet towards closest of two routers Suppose router in AS1 receives datagram for which dest is outside of AS1 Router should forward packet towards one of the gateway routers, but which one? 1b is closer than 1c, interface k leads to 1b, so add (x, k) to routing table AS3 advertises route to x 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c AS2 advertises route to x Spread in AS1: 1c and 1b lead to x CS 5565 Spring 2012
26
Summary Routing algorithms: Hierarchical Routing
Link State Distance Vector Hierarchical Routing AS: autonomous systems Next: application to Internet/IP CS 5565 Spring 2012
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.