Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.

Similar presentations


Presentation on theme: "Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router."— Presentation transcript:

1 Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router technology. The transport layer should be shielded form the number, type and topology of the routers present. The network addresses made available to the trasport layer should use a uniform numbering plan, even across LANs and WANs. Implementation of Connectionless Service Implementation of Connection-Oriented Service Comparison of Virtual-Circuit and Datagram Subnets

2 Store-and-Forward Packet Switching The environment of the network layer protocols. fig 5-1

3 Implementation of Connectionless Service Routing within a diagram subnet.

4 Implementation of Connection-Oriented Service Routing within a virtual-circuit subnet.

5 Comparison of Virtual-Circuit and Datagram Subnets 5-4

6 Routing Algorithms Routing algorithms can be grouped into two major classes: nonadaptive (static) and adaptive The Optimality Principle If router I is on the optimal path from J to K, then the optimal path from I to K also falls along the same route. Shortest Path Routing Flooding Distance Vector Routing Link State Routing Hierarchical Routing Broadcast Routing Multicast Routing Routing for Mobile Hosts Routing in Ad Hoc Networks

7 Link State Algorithm for Source Node A 1.Initialisation: 2. N = {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 N such that D(w) is a minimum 10. add w to N 11. update D(v) for all v adjacent to w and not in N: 12. D(v) = min( D(v), D(w)+c(w,v)) 13. /* new cost to v is either old cost to v or known 14. shortest path cost to w plus cost from w to v */ 15.Until all nodes in N

8 Shortest Path Routing Dijkstra's algorithm to compute the shortest path through a graph. 5-8 top

9 Shortest Path Routing Dijkstra's algorithm to compute the shortest path through a graph. 5-8 bottom

10 Link State Routing Each router must do the following: 1.Discover its neighbors, learn their network address. 2.Measure the delay or cost to each of its neighbors. 3.Construct a packet telling all it has just learned. 4.Send this packet to all other routers. 5.Compute the shortest path to every other router.

11 Learning about the Neighbors (a) Nine routers and a LAN. (b) A graph model of (a).

12 Measuring Line Cost A subnet in which the East and West parts are connected by two lines.

13 Building Link State Packets (a) A subnet. (b) The link state packets for this subnet.

14 Shortest Path Routing The first 5 steps used in computing the shortest path from A to D. The arrows indicate the working node.

15 Distance Vector (DV) Algorithm 1.Initialization: 2. for all adjacent node v: 3. D x (*.v) = ∞ 4. // the * operator means “for all rows” 5. D x (v,v) = c(X,v) 6. for all destinations, y 7. send min w D(y,w) to each neighbor 8. // w over all X’s neighbors 9. 10.Loop 11.wait (until I see a link cost change to neighbour v or until I receive an update from neighbour v) 12.If (c(X,V) changes by d) 13./* change cost to all dest’s via neighbor v by d note: d could be positive or negative*/ 14.for all destinations y: D x (y,v)= D x (y,v)+d 15.else if ( update received form V wrt destination Y) 16./* shortest path from V to some Y has changed, V has sent a new value for its min w D v (Y,w), call this received new value “newval” */ 17.for the single destination y: 18. D x (y,v)= c(X,V)+newval 19.if we have a new min w D x (Y,w) for any destination Y send new value of min w D x (Y,w) to all neighbors 20.forever

16 Distance Vector Routing (a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.

17 Network Layer Distance Vector Algorithm (1) Bellman-Ford Equation (dynamic programming) Define d x (y) := cost of least-cost path from x to y Then d x (y) = min {c(x,v) + d v (y) } where min is taken over all neighbors of x

18 Network Layer Distance Vector Algorithm (3) r D x (y) = estimate of least cost from x to y r Distance vector: D x = [D x (y): y є N ] r Node x knows cost to each neighbor v: c(x,v) r Node x maintains D x = [D x (y): y є N ] r Node x also maintains its neighbors’ distance vectors m For each neighbor v, x maintains D v = [D v (y): y є N ]

19 Network Layer Distance vector algorithm (4) Basic idea: r Each node periodically sends its own distance vector estimate to neighbors r When node a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: D x (y) ← min v {c(x,v) + D v (y)} for each node y ∊ N  Under minor, natural conditions, the estimate D x (y) converge the actual least cost d x (y)

20 Network Layer Distance Vector Algorithm (5) Iterative, asynchronous: each local iteration caused by: r local link cost change r DV update message from neighbor Distributed: r each node notifies neighbors only when its DV changes m neighbors then notify their neighbors if necessary wait for (change in local link cost of msg from neighbor) recompute estimates if DV to any dest has changed, notify neighbors Each node:

21 Network Layer x y z x y z 0 2 7 ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z ∞∞∞ 710 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 time x z 1 2 7 y node x table node y table node z table D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{2+0, 7+1} = 2 D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3 32

22 Network Layer x y z x y z 0 2 7 ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 2 3 from cost to x y z x y z 0 2 3 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z 0 2 7 from cost to x y z x y z 0 2 3 from cost to x y z x y z 0 2 3 from cost to x y z x y z 0 2 7 from cost to x y z x y z ∞∞∞ 710 cost to ∞ 2 0 1 ∞ ∞ ∞ 2 0 1 7 1 0 2 0 1 7 1 0 2 0 1 3 1 0 2 0 1 3 1 0 2 0 1 3 1 0 2 0 1 3 1 0 time x z 1 2 7 y node x table node y table node z table D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{2+0, 7+1} = 2 D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3

23 Network Layer Distance Vector: link cost changes Link cost changes: r node detects local link cost change r updates routing info, recalculates distance vector r if DV changes, notify neighbors “good news travels fast” x z 1 4 50 y 1 At time t 0, y detects the link-cost change, updates its DV, and informs its neighbors. At time t 1, 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 t 2, 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.

24 Network Layer Distance Vector: link cost changes Link cost changes: r good news travels fast r bad news travels slow - “count to infinity” problem! r 44 iterations before algorithm stabilizes: see text Poisoned reverse: r If Z routes through Y to get to X : m Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) r will this completely solve count to infinity problem? x z 1 4 50 y 60

25 Network Layer Distance Vector Routing (2) The count-to-infinity problem.

26 Network Layer Comparison of LS and DV algorithms Message complexity r LS: with n nodes, E links, O(nE) msgs sent r DV: exchange between neighbors only m convergence time varies Speed of Convergence r LS: O(n 2 ) algorithm requires O(nE) msgs m may have oscillations r DV: convergence time varies m may be routing loops m count-to-infinity problem Robustness: what happens if router malfunctions? LS: m node can advertise incorrect link cost m each node computes only its own table DV: m DV node can advertise incorrect path cost m each node’s table used by others error propagate thru network

27 Network Layer Hierarchical Routing scale: with 200 million destinations: r can’t store all dest’s in routing tables! r routing table exchange would swamp links! administrative autonomy r internet = network of networks r each network admin may want to control routing in its own network Our routing study thus far - idealization r all routers identical r network “flat” … not true in practice


Download ppt "Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router."

Similar presentations


Ads by Google