1 / 116

Network Layer: Routing

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

camp
Télécharger la présentation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

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. 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

  5. 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

  6. Virtual Circuit: call setup • Resource allocation: • The call setup msg from source to destination. • Path determination: • Source based or network based. • Msgs includes the required resources: • BW, latency, buffer, etc. • A router can either: • accept (and commit) or reject • Path accepted if all routers accept. Lecture 6: Network Layer

  7. Virtual Circuit: Identifiers • Forward call-setup pass: • Each router allocate an id for the VC • Backward call-setup pass: • Each router informs its predecessor its id • Runtime: • When receiving a packet with an id: • Looks up the output port • Looks up the new id • Send on the required port with new id. Lecture 6: Network Layer

  8. Virtual Circuit: identifiers • Example setup BW=1Mb BW=1Mb BW=1Mb 1 2 2 1 Lecture 6: Network Layer

  9. Virtual Circuit: identifiers • Example runtime VCid=38 VCid=xx VCid=22 2 1 2 1 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 D(v): current value of cost of path from source to dest. V 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 c(i,j): link cost from node i to j. cost infinite if not direct neighbors Lecture 6: Network Layer

  24. 5 3 5 2 2 1 3 1 2 1 A D E B 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) infiity 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 Implementation Is “not Distributed” 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+ |E|) 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 Distribute: 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 No changes --> No update 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. 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

  42. Broadcast and Multicast Routing Lecture 6: Network Layer

  43. 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

  44. 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

  45. (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

  46. A A D D G G B E B E F F c c Spanning Tree: Creation • Center node • Each node sends unicast join message to center node • Message forwarded until it arrives at a node already belonging to spanning tree 3 4 2 5 1 • Stepwise construction of spanning tree (b) Constructed spanning tree Lecture 6: Network Layer

  47. Source-based trees Multicast Routing: Problem Statement • Goal: find a tree (or trees) connecting routers having local mcast group members • tree: not all paths between routers used • source-based: different tree from each sender to rcvrs • shared-tree: same tree used by all group members Shared tree Lecture 6: Network Layer

  48. Approaches for building mcast trees Approaches: • source-based tree: one tree per source • shortest path trees • reverse path forwarding • group-shared tree: group uses one tree • minimal spanning (Steiner) • center-based trees …we first look at the basic approaches Lecture 6: Network Layer

  49. 1 i 5 4 3 6 2 Shortest Path Tree • mcast forwarding tree: tree of shortest path routes from source to all receivers • Dijkstra’s algorithm S: source LEGEND R1 R4 router with attached group member R2 router with no attached group member R5 link used for forwarding, i indicates order link added by algorithm R3 R7 R6 Lecture 6: Network Layer

  50. Reverse Path Forwarding if (mcast datagram received on incoming link on shortest path back to center) then flood datagram onto all outgoing links else ignore datagram • rely on router’s knowledge of unicast shortest path from it to sender • each router has simple forwarding behavior: Lecture 6: Network Layer

More Related