network layer routing n.
Skip this Video
Loading SlideShow in 5 Seconds..
Network Layer: Routing PowerPoint Presentation
Download Presentation
Network Layer: Routing

Loading in 2 Seconds...

play fullscreen
1 / 117

Network Layer: Routing - PowerPoint PPT Presentation

Download Presentation
Network Layer: Routing
An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Goals: understand principles behind network layer services: routing (path selection) dealing with scale how a router works Previous two lectures instantiation and implementation in the Internet Overview: network layer services routing principle: path selection hierarchical routing IP Internet routing protocols: intra-domain inter-domain Network Layer: Routing Lecture 6: Network Layer

  2. Network Layer • Transport packet from source to dest. • Network layer in every host, router Basic functions: • Data plane: forwarding • move packets from router’s input port to router output port • Control plane: path determination and call setup • determine route taken by packets from source to destination Lecture 6: Network Layer

  3. Forwarding: Illustration routing and call setup 3 Lecture 6: Network Layer

  4. Network Layer: Complexity Factors For users: quality of service guaranteed bandwidth? preservation of inter-packet timing (no jitter)? loss-free delivery? in-order delivery? Interaction between users and network providers signaling: congestion feedback/resource reservation For network providers efficiency policy of route control scalability Lecture 6: Network Layer

  5. Q: What service model for “channel” transporting packets from sender to receiver? guaranteed bandwidth? preservation of inter-packet timing (no jitter)? loss-free delivery? in-order delivery? congestion feedback to sender? Network service model The most important abstraction provided by network layer: ? ? virtual circuit or datagram? ? service abstraction Lecture 6: Network Layer

  6. call setup, teardown for each call before data can flow each packet carries VC identifier (not destination host ID) every router on source-dest path s maintain “state” for each passing connection link, router resources (bandwidth, buffers) may be allocatedto VC to get circuit-like performance. “source-to-dest path behaves much like telephone circuit” performance-wise network actions along source-to-dest path Virtual Circuits (VC) Lecture 6: Network Layer

  7. VC implementation A VC consists of: • Path from source to destination • VC numbers, one number for each link along path • Entries in forwarding tables in routers along path • Packet belonging to VC carries a VC number. • VC number must be changed on each link. • New VC number comes from forwarding table Lecture 6: Network Layer

  8. VC number 22 32 12 2 1 3 interface number Incoming interface Incoming VC # Outgoing interface Outgoing VC # 1 12 2 22 2 63 1 18 3 7 2 17 1 97 3 87 … … … … Forwarding table Forwarding table in northwest router: Routers maintain connection state information! Lecture 6: Network Layer #8

  9. used to setup, maintain teardown VC used in ATM, frame-relay, X.25 not used in today’s Internet Cisco’s MPLS application transport network data link physical application transport network data link physical Virtual circuits: signaling protocols 6. Receive data 5. Data flow begins 4. Call connected 3. Accept call 1. Initiate call 2. incoming call Lecture 6: Network Layer

  10. no call setup at network layer routers: no state about end-to-end connections no network-level concept of “connection” packets typically routed using destination host ID packets between same source-dest pair may take different paths application transport network data link physical application transport network data link physical Datagram networks: the Internet model 1. Send data 2. Receive data Lecture 6: Network Layer

  11. Forwarding table 4 billion possible entries Destination Address RangeLink Interface 11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111 otherwise 3 Lecture 6: Network Layer

  12. Longest prefix matching Prefix MatchLink Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3 VC implementation VC implementation Examples Which interface? DA: 11001000 00010111 00010110 10100001 Which interface? DA: 11001000 00010111 00011000 10101010 Lecture 6: Network Layer

  13. ATM: overview • Asynchronous Transfer Mode • Fixed packets size: called cells • 53 bytes = 5 header + 48 data • All virtual circuit-based • Types of virtual circuits • Virtual circuits and virtual paths • Permanent and switched • Architecture is a QoS-based approach Lecture 6: Network Layer

  14. Network Layer Quality of Service Guarantees ? Network Architecture Internet ATM ATM ATM ATM Service Model best effort CBR VBR ABR UBR Congestion feedback no (inferred via loss/delay) no congestion no congestion yes no Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes yes no no Order no yes yes yes yes Timing no yes yes no no • Internet model being extended: Intserv, Diffserv • multimedia networking ATM: Asynchronous Transfer Mode; CBR: Constant Bit Rate; V: Variable; A: available; U: Unspecified Lecture 6: Network Layer

  15. Internet (Datagram) data exchange among computers “elastic” service, no strict timing req. “smart” end systems (computers) can adapt, perform control, error recovery simple inside network, complexity at “edge” many link types different characteristics uniform service difficult ATM (VC) evolved from telephony human conversation: strict timing, reliability requirements need for guaranteed service “dumb” end systems telephones complexity inside network VC Benefits: Fast forwarding Traffic Engineering. Datagram or VC network: why? Lecture 6: Network Layer

  16. Network Layer: Protocols Network layer functions: • Control protocols • error reportinge.g. ICMP Control protocols - router “signaling”e.g. RSVP • Network layer protocol (e.g., IP) • addressing conventions • packet format • packet handling conventions • Routing protocols • path selection • e.g., RIP, OSPF, BGP forwarding Transport layer Network layer Link layer physical layer Lecture 6: Network Layer

  17. Control: ROUTING algorithms Lecture 6: Network Layer

  18. 5 3 5 2 2 1 3 1 2 1 A D E B F C Routing Control Plane: Routing Goal: determine “good” paths (sequences of routers) thru network from sources to dest. Graph abstraction for the routing problem: • graph nodes are routers • graph edges are physical links • links have properties: delay, capacity, $ cost, policy Lecture 6: Network Layer

  19. Key Desired Properties of a Routing Algorithm Robustness Optimality find good path (for user/provider) Simplicity Lecture 6: Network Layer

  20. Routing Design Space Routing has a large design space who decides routing? source routing: end hosts make decision network routing: networks make decision how many paths from source s to destination d? multi-path routing single path routing will routing adapt to network traffic demand? adaptive routing static routing … - Robustness - Optimality - Simplicity Lecture 6: Network Layer

  21. 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 Routing Algorithm classification Lecture 6: Network Layer

  22. Dijkstra’s algorithm net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same info computes least cost paths from one node (“source”) to all other nodes gives routing table for that node iterative: after k iterations, know least cost path to k dest.’s Notation: c(i,j): link cost from node i to j. cost infinite if not direct neighbors D(v): current value of cost of path from source to dest. V p(v): predecessor node along path from source to v, that is next v N: set of nodes whose least cost path definitively known A Link-State Routing Algorithm Lecture 6: Network Layer

  23. Dijsktra’s Algorithm 1 Initialization: 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) = infty 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 Lecture 6: Network Layer

  24. 5 3 5 2 2 1 3 1 2 1 A D B E F C Dijkstra’s algorithm: example D(B),p(B) 2,A 2,A 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E 3,E D(E),p(E) infinity 2,D Step 0 1 2 3 4 5 start N A AD ADE ADEB ADEBC ADEBCF D(F),p(F) infinity infinity 4,E 4,E 4,E Lecture 6: Network Layer

  25. Algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n(n+1)/2 comparisons: O(n2) more efficient implementations possible: O(nlogn) Oscillations possible: e.g., link cost = amount of carried traffic A A A A D D D D B B B B C C C C 2+e 2+e 0 0 1 1 1+e 1+e 0 0 0 0 Dijkstra’s algorithm, discussion 1 1+e 0 2+e 0 0 0 0 e 0 1 1+e 1 1 e … recompute … recompute routing … recompute initially Lecture 6: Network Layer

  26. iterative: continues until no nodes exchange info. self-terminating: no “signal” to stop asynchronous: nodes need not exchange info/iterate in lock step! distributed: each node communicates only with directly-attached neighbors Distance Table data structure each node has its own row for each possible destination column for each directly-attached neighbor to node example: in node X, for dest. Y via neighbor Z: distance from X to Y, via Z as next hop X = D (Y,Z) Z c(X,Z) + min {D (Y,w)} = w Distance Vector Routing Algorithm Lecture 6: Network Layer

  27. Distance Vector Routing Basis of RIP, IGRP, EIGRP routing protocols Based on the Bellman-Ford algorithm (BFA) Conceptually, runs for each destination separately Lecture 6: Network Layer

  28. Distance Vector Routing: Basic Idea At node i, the basic update rule where - di denotes the distance estimation from i to the destination, - N(i) is set of neighbors of node i, and - dij is the distance of the direct link from i to j;assume positive destination j i Lecture 6: Network Layer

  29. Distance Table: Example 1 distance table E sends to its neighbors 7 A: 10 B: 8 C: 4 D: 2 E: 0 2 8 10 2 A D E B C Below is just one step! The algorithm repeats forever! distance tablesfrom neighbors computation E’s distance table E d () A B C D A B D A B D 10 15  0 7  A: 10 B: 8 7 0  17 8  destinations D: 4 1 2 9 4 0 2 D: 2 10 8 2 Lecture 6: Network Layer

  30. cost to destination via E D () A B C D A 1 7 6 4 B 14 8 9 11 D 5 5 4 2 1 7 2 8 1 destination 2 A D B E C E E E D (C,D) D (A,D) D (A,B) B D D c(E,B) + min {D (A,w)} c(E,D) + min {D (A,w)} c(E,D) + min {D (C,w)} = = = w w w = = = 2+3 = 5 2+2 = 4 8+6 = 14 Distance Table: example loop! (why not 15?) Lecture 6: Network Layer

  31. cost to destination via E D () A B C D A 1 7 6 4 B 14 8 9 11 D 5 5 4 2 destination Distance table gives routing table Outgoing link to use, cost A B C D A,1 D,5 D,4 D,2 destination Routing table Distance table Lecture 6: Network Layer

  32. 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 Distance Vector Routing: overview Each node: Lecture 6: Network Layer

  33. Distance Vector Algorithm: At all nodes, X: 1 Initialization: 2 for all adjacent nodes v: 3 DX(*,v) = infty /* the * operator means "for all rows" */ 4 DX(v,v) = c(X,v) 5 for all destinations, y 6 send minw DX(y,w) to each neighbor /* w over all X's neighbors */ Lecture 6: Network Layer

  34. Distance Vector Algorithm (cont.): 8 loop 9 wait(until a link cost change to neighbor V 10 or until 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: DX(y,V) = DX(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 minw DV(Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D (Y,V) = c(X,V) + newval 22 23 if a new minw DX(Y,w) for any destination Y 24 send new value of minw DX(Y,w) to all neighbors 25 26 forever X Lecture 6: Network Layer

  35. 2 1 7 Y Z X X c(X,Y) + min {D (Z,w)} c(X,Z) + min {D (Y,w)} D (Y,Z) D (Z,Y) = = w w = = 2+1 = 3 7+1 = 8 X Z Y Distance Vector Algorithm: example Lecture 6: Network Layer

  36. 2 1 7 X Z Y Distance Vector Algorithm: example Lecture 6: Network Layer

  37. 1 4 1 50 X Z Y Distance Vector: link cost changes 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) algorithm terminates “good news travels fast” Lecture 6: Network Layer

  38. 60 4 1 50 X Z Y Distance Vector: link cost changes Link cost changes: • good news travels fast • bad news travels slow - “count to infinity” problem! algorithm continues on! Lecture 6: Network Layer

  39. 60 4 1 50 X Z Y Distance Vector: 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? algorithm terminates Lecture 6: Network Layer

  40. Message complexity LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only larger msgs convergence time varies Speed of Convergence LS: 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 propagate thru network Comparison of LS and DV algorithms Lecture 6: Network Layer

  41. 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 Hierarchical Routing Our routing study thus far - idealization • all routers identical • network “flat” … not true in practice Lecture 6: Network Layer

  42. aggregate routers into regions, “autonomous systems” (AS) routers in same AS run same routing protocol “intra-AS” routing protocol routers in different AS can run different intra-AS routing protocol Gateway router Direct link to router in another AS Hierarchical Routing Lecture 6: Network Layer

  43. 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 3a 3b 2a AS3 AS2 1a 2c AS1 2b 3c 1b 1d 1c Inter-AS Routing algorithm Intra-AS Routing algorithm Forwarding table Interconnected ASes Lecture 6: Network Layer

  44. Suppose router in AS1 receives datagram for which dest is outside of AS1 Router should forward packet towards on of the gateway routers, but which one? 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! 3a 3b 2a AS3 AS2 1a AS1 2c 2b 3c 1b 1d 1c Inter-AS tasks Lecture 6: Network Layer

  45. Example: Setting forwarding table in router 1d • Suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 (gateway 1c) but not from AS2. • Inter-AS protocol propagates reachability info to all internal routers. • Router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c. • Puts in forwarding table entry (x,I). Lecture 6: Network Layer

  46. Determine from forwarding table the interface I that leads to least-cost gateway. Enter (x,I) in forwarding table Use routing info from intra-AS protocol to determine costs of least-cost paths to each of the gateways Learn from inter-AS protocol that subnet x is reachable via multiple gateways Hot potato routing: Choose the gateway that has the smallest least cost Example: Choosing among multiple ASes • Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2. • To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x. • This is also the job on inter-AS routing protocol! • Hot potato routing: send packet towards closest of two routers. Lecture 6: Network Layer

  47. Broadcast and Multicast Routing Lecture 6: Network Layer

  48. duplicate creation/transmission duplicate duplicate in-network duplication sourceduplication R3 R2 R4 R2 R4 R3 R1 R1 Broadcast Routing • Deliver packets from source to all other nodes • Source duplication is inefficient: • Source duplication: how does source determine recipient addresses Lecture 6: Network Layer

  49. In-network duplication • Flooding: when node receives brdcst pckt, sends copy to all neighbors • Problems: cycles & broadcast storm • Controlled flooding: node only brdcsts pkt if it hasn’t brdcst same packet before • Node keeps track of pckt ids already brdcsted • Or reverse path forwarding (RPF): only forward pckt if it arrived on shortest path between node and source • Spanning tree • No redundant packets received by any node Lecture 6: Network Layer

  50. (b) Broadcast initiated at D (a) Broadcast initiated at A A A D D G G B E E B F F c c Spanning Tree • First construct a spanning tree • Nodes forward copies only along spanning tree Lecture 6: Network Layer