Network Layer: Routing


Published on

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Robustness: a network is expected to run continuously for many years, with changes in topology and traffic Optimality: depends on whose point of view: users: networks
  • Choose
  • How to specify hosts in D
  • Does not have to be 24; some can be, say 22.
  • Network Layer: Routing

    1. 1. Network Layer: Routing <ul><li>Goals: </li></ul><ul><li>understand principles behind network layer services: </li></ul><ul><ul><li>routing (path selection) </li></ul></ul><ul><ul><li>dealing with scale </li></ul></ul><ul><ul><li>how a router works </li></ul></ul><ul><ul><ul><li>Previous two lectures </li></ul></ul></ul><ul><li>instantiation and implementation in the Internet </li></ul><ul><li>Overview: </li></ul><ul><li>network layer services </li></ul><ul><li>routing principle: </li></ul><ul><ul><li>path selection </li></ul></ul><ul><li>hierarchical routing </li></ul><ul><li>IP </li></ul><ul><li>Internet routing protocols: </li></ul><ul><ul><li>intra-domain </li></ul></ul><ul><ul><li>inter-domain </li></ul></ul>
    2. 2. Network Layer <ul><li>Transport packet from source to dest. </li></ul><ul><li>Network layer in every host, router </li></ul><ul><li>B asic functions: </li></ul><ul><li>Data plane: forwarding </li></ul><ul><ul><li>move packets from router’s input port to router output port </li></ul></ul><ul><li>Control plane: path determination and call setup </li></ul><ul><ul><li>determine route taken by packets from source to destination </li></ul></ul>
    3. 3. Forwarding: Illustration routing and call setup
    4. 4. Network Layer: Complexity Factors <ul><li>For users: quality of service </li></ul><ul><ul><li>guaranteed bandwidth? </li></ul></ul><ul><ul><li>preservation of inter-packet timing (no jitter)? </li></ul></ul><ul><ul><li>loss-free delivery? </li></ul></ul><ul><ul><li>in-order delivery? </li></ul></ul><ul><li>Interaction between users and network providers </li></ul><ul><ul><li>signaling: congestion feedback/resource reservation </li></ul></ul><ul><li>For network providers </li></ul><ul><ul><li>efficiency </li></ul></ul><ul><ul><li>policy of route control </li></ul></ul><ul><ul><li>scalability </li></ul></ul>
    5. 5. Network service model <ul><li>Q: What service model for “channel” transporting packets from sender to receiver? </li></ul><ul><li>guaranteed bandwidth? </li></ul><ul><li>preservation of inter-packet timing (no jitter)? </li></ul><ul><li>loss-free delivery? </li></ul><ul><li>in-order delivery? </li></ul><ul><li>congestion feedback to sender? </li></ul>? ? ? virtual circuit or datagram? The most important abstraction provided by network layer: service abstraction
    6. 6. Virtual Circuits (VC) <ul><li>call setup, teardown for each call before data can flow </li></ul><ul><li>each packet carries VC identifier (not destination host ID) </li></ul><ul><li>every router on source-dest path s maintain “state” for each passing connection </li></ul><ul><li>link, router resources (bandwidth, buffers) may be allocated to VC </li></ul><ul><ul><li>to get circuit-like performance. </li></ul></ul><ul><li>“ source-to-dest path behaves much like telephone circuit” </li></ul><ul><ul><li>performance-wise </li></ul></ul><ul><ul><li>network actions along source-to-dest path </li></ul></ul>
    7. 7. Virtual circuits: signaling protocols <ul><li>used to setup, maintain teardown VC </li></ul><ul><li>used in ATM, frame-relay, X.25 </li></ul><ul><li>not used in today’s Internet </li></ul><ul><ul><li>Cisco’s MPLS </li></ul></ul>1 . Initiate call 2 . incoming call 3 . Accept call 4 . Call connected 5 . Data flow begins 6 . Receive data application transport network data link physical application transport network data link physical
    8. 8. Datagram networks: the Internet model <ul><li>no call setup at network layer </li></ul><ul><li>routers: no state about end-to-end connections </li></ul><ul><ul><li>no network-level concept of “connection” </li></ul></ul><ul><li>packets typically routed using destination host ID </li></ul><ul><ul><li>packets between same source-dest pair may take different paths </li></ul></ul>1 . Send data 2 . Receive data application transport network data link physical application transport network data link physical
    9. 9. Network Layer Quality of Service Network Architecture Internet ATM ATM ATM ATM Service Model best effort CBR VBR ABR UBR 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 Congestion feedback no (inferred via loss/delay) no congestion no congestion yes no Guarantees ? <ul><li>Internet model being extended: Intserv, Diffserv </li></ul><ul><ul><li>multimedia networking </li></ul></ul>ATM: Asynchronous Transfer Mode; CBR: Constant Bit Rate; V: Variable; A: available; U: User
    10. 10. Datagram or VC network: why? <ul><li>Internet (Datagram) </li></ul><ul><li>data exchange among computers </li></ul><ul><ul><li>“ elastic” service, no strict timing req. </li></ul></ul><ul><li>“ smart” end systems (computers) </li></ul><ul><ul><li>can adapt, perform control, error recovery </li></ul></ul><ul><ul><li>simple inside network, complexity at “edge” </li></ul></ul><ul><li>many link types </li></ul><ul><ul><li>different characteristics </li></ul></ul><ul><ul><li>uniform service difficult </li></ul></ul><ul><li>ATM (VC) </li></ul><ul><li>evolved from telephony </li></ul><ul><li>human conversation: </li></ul><ul><ul><li>strict timing, reliability requirements </li></ul></ul><ul><ul><li>need for guaranteed service </li></ul></ul><ul><li>“ dumb” end systems </li></ul><ul><ul><li>telephones </li></ul></ul><ul><ul><li>complexity inside network </li></ul></ul><ul><li>VC Benefits: </li></ul><ul><ul><li>Fast forwarding </li></ul></ul><ul><ul><li>Traffic Engineering. </li></ul></ul>
    11. 11. Network Layer: Protocols <ul><li>Network layer functions: </li></ul>Transport layer Link layer physical layer Network layer forwarding <ul><li>Routing protocols </li></ul><ul><li>path selection </li></ul><ul><li>e.g., RIP, OSPF, BGP </li></ul><ul><li>Network layer protocol (e.g., IP) </li></ul><ul><li>addressing conventions </li></ul><ul><li>packet format </li></ul><ul><li>packet handling conventions </li></ul><ul><li>Control protocols </li></ul><ul><li>error reporting e.g. ICMP </li></ul>Control protocols - router “signaling” e.g. RSVP
    12. 12. Control: ROUTING algorithms
    13. 13. Control Plane: Routing <ul><li>Graph abstraction for the routing problem: </li></ul><ul><li>graph nodes are routers </li></ul><ul><li>graph edges are physical links </li></ul><ul><ul><li>links have properties: delay, capacity, $ cost, policy </li></ul></ul>Goal: determine “good” paths (sequences of routers) thru network from sources to dest. Routing A E D C B F 2 2 1 3 1 1 2 5 3 5
    14. 14. Key Desired Properties of a Routing Algorithm <ul><li>Robustness </li></ul><ul><li>Optimality </li></ul><ul><ul><li>find good path (for user/provider) </li></ul></ul><ul><li>Simplicity </li></ul>
    15. 15. Routing Design Space <ul><li>Routing has a large design space </li></ul><ul><ul><li>who decides routing? </li></ul></ul><ul><ul><ul><li>source routing: end hosts make decision </li></ul></ul></ul><ul><ul><ul><li>network routing: networks make decision </li></ul></ul></ul><ul><ul><li>how many paths from source s to destination d? </li></ul></ul><ul><ul><ul><li>multi-path routing </li></ul></ul></ul><ul><ul><ul><li>single path routing </li></ul></ul></ul><ul><ul><li>will routing adapt to network traffic demand? </li></ul></ul><ul><ul><ul><li>adaptive routing </li></ul></ul></ul><ul><ul><ul><li>static routing </li></ul></ul></ul><ul><ul><li>… </li></ul></ul>- Robustness - Optimality - Simplicity
    16. 16. Routing Algorithm classification <ul><li>Global or decentralized information? </li></ul><ul><li>Global: </li></ul><ul><li>all routers have complete topology, link cost info </li></ul><ul><li>“ link state” algorithms </li></ul><ul><li>Decentralized: </li></ul><ul><li>router knows physically-connected neighbors, link costs to neighbors </li></ul><ul><li>iterative process of computation, exchange of info with neighbors </li></ul><ul><li>“ distance vector” algorithms </li></ul><ul><li>Static or dynamic? </li></ul><ul><li>Static: </li></ul><ul><li>routes change slowly over time </li></ul><ul><li>Dynamic: </li></ul><ul><li>routes change more quickly </li></ul><ul><ul><li>periodic update </li></ul></ul><ul><ul><li>in response to link cost changes </li></ul></ul>
    17. 17. A Link-State Routing Algorithm <ul><li>Dijkstra’s algorithm </li></ul><ul><li>net topology, link costs known to all nodes </li></ul><ul><ul><li>accomplished via “link state broadcast” </li></ul></ul><ul><ul><li>all nodes have same info </li></ul></ul><ul><li>computes least cost paths from one node (“source”) to all other nodes </li></ul><ul><ul><li>gives routing table for that node </li></ul></ul><ul><li>iterative: after k iterations, know least cost path to k dest.’s </li></ul><ul><li>Notation: </li></ul><ul><li>c(i,j): link cost from node i to j. cost infinite if not direct neighbors </li></ul><ul><li>D(v): current value of cost of path from source to dest. V </li></ul><ul><li>p(v): predecessor node along path from source to v, that is next v </li></ul><ul><li>N: set of nodes whose least cost path definitively known </li></ul>
    18. 18. 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
    19. 19. Dijkstra’s algorithm: example Step 0 1 2 3 4 5 start N A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A 2,A 2,A D(C),p(C) 5,A 4,D 3,E 3,E D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity infinity 4,E 4,E 4,E A E D C B F 2 2 1 3 1 1 2 5 3 5
    20. 20. Dijkstra’s algorithm, discussion <ul><li>Algorithm complexity: n nodes </li></ul><ul><li>each iteration: need to check all nodes, w, not in N </li></ul><ul><li>n(n+1)/2 comparisons: O(n 2 ) </li></ul><ul><ul><li>more efficient implementations possible: O(nlogn) </li></ul></ul><ul><li>Oscillations possible: </li></ul><ul><li>e.g., link cost = amount of carried traffic </li></ul>1 1+ e e 0 e 1 1 0 0 0 2+ e 1+ e 1 0 0 initially … recompute routing … recompute … recompute A D C B A D C B 2+ e 0 0 0 1+ e 1 A D C B A D C B 2+ e 0 0 0 1+ e 1
    21. 21. Distance Vector Routing Algorithm <ul><li>iterative: </li></ul><ul><li>continues until no nodes exchange info. </li></ul><ul><li>self-terminating : no “signal” to stop </li></ul><ul><li>asynchronous: </li></ul><ul><li>nodes need not exchange info/iterate in lock step! </li></ul><ul><li>distributed: </li></ul><ul><li>each node communicates only with directly-attached neighbors </li></ul><ul><li>Distance Table data structure </li></ul><ul><li>each node has its own </li></ul><ul><li>row for each possible destination </li></ul><ul><li>column for each directly-attached neighbor to node </li></ul><ul><li>example: in node X, for dest. Y via neighbor Z: </li></ul>D (Y,Z) X distance from X to Y, via Z as next hop c(X,Z) + min {D (Y,w)} Z w = =
    22. 22. Distance Vector Routing <ul><li>Basis of RIP, IGRP, EIGRP routing protocols </li></ul><ul><li>Based on the Bellman-Ford algorithm (BFA) </li></ul><ul><li>Conceptually, runs for each destination separately </li></ul>
    23. 23. Distance Vector Routing : Basic Idea <ul><li>At node i , the basic update rule </li></ul><ul><li>where </li></ul><ul><li>- d i denote s the distance estimation from i to the destination, </li></ul><ul><li>- N( i ) is set of neighbors of node i , and </li></ul><ul><li>- d ij is the distance of the direct link from i to j; assume positive </li></ul>i j destination
    24. 24. Distance Table: Example d () A B C D E distance tables from neighbors destinations computation E’s distance table Below is just one step! The algorithm repeats forever! 10 15  A B D 0 7  A B D 10 8 2 7 0   1 2   0 A: 1 0 B: 8 D : 4 D: 2 17 8   9 4   2 A E D C B 7 8 1 0 2 1 2 distance table E sends to its neighbors A: 1 0 B: 8 C: 4 D: 2 E: 0
    25. 25. Distance Table: example loop! (why not 15?) A E D C B 7 8 1 2 1 2 D () A B C D A 1 7 6 4 B 14 8 9 11 D 5 5 4 2 E cost to destination via destination D (C,D) E c(E,D) + min {D (C,w)} D w = = 2+2 = 4 D (A,D) E c(E,D) + min {D (A,w)} D w = = 2+3 = 5 D (A,B) E c(E,B) + min {D (A,w)} B w = = 8+6 = 14
    26. 26. Distance table gives routing table A B C D A,1 D,5 D,4 D,2 Outgoing link to use, cost destination Distance table Routing table D () A B C D A 1 7 6 4 B 14 8 9 11 D 5 5 4 2 E cost to destination via destination
    27. 27. Distance Vector Routing: overview <ul><li>Iterative, asynchronous: each local iteration caused by: </li></ul><ul><li>local link cost change </li></ul><ul><li>message from neighbor: its least cost path change from neighbor </li></ul><ul><li>Distributed: </li></ul><ul><li>each node notifies neighbors only when its least cost path to any destination changes </li></ul><ul><ul><li>neighbors then notify their neighbors if necessary </li></ul></ul>Each node: 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
    28. 28. Distance Vector Algorithm: 1 Initialization: 2 for all adjacent nodes v: 3 D X (*,v) = infty /* the * operator means &quot;for all rows&quot; */ 4 D X (v,v) = c(X,v) 5 for all destinations, y 6 send min w D X (y,w) to each neighbor /* w over all X's neighbors */ At all nodes, X:
    29. 29. 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: D X (y,V) = D X (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 min w D V (Y,w) */ 20 /* call this received new value is &quot;newval&quot; */ 21 for the single destination y: D (Y,V) = c(X,V) + newval 22 23 if a new min w D X (Y,w) for any destination Y 24 send new value of min w D X (Y,w) to all neighbors 25 26 forever X
    30. 30. Distance Vector Algorithm: example X Z 1 2 7 Y D (Y,Z) X c(X,Z) + min {D (Y,w)} w = = 7+1 = 8 Z D (Z,Y) X c(X,Y) + min {D (Z,w)} w = = 2+1 = 3 Y
    31. 31. Distance Vector Algorithm: example X Z 1 2 7 Y
    32. 32. Distance Vector: link cost changes <ul><li>Link cost changes: </li></ul><ul><li>node detects local link cost change </li></ul><ul><li>updates distance table (line 15) </li></ul><ul><li>if cost change in least cost path, notify neighbors (lines 23,24) </li></ul>algorithm terminates “ good news travels fast” X Z 1 4 50 Y 1
    33. 33. Distance Vector: link cost changes <ul><li>Link cost changes: </li></ul><ul><li>good news travels fast </li></ul><ul><li>bad news travels slow - “count to infinity” problem! </li></ul>algorithm continues on! X Z 1 4 50 Y 60
    34. 34. Distance Vector: poisoned reverse <ul><li>If Z routes through Y to get to X : </li></ul><ul><li>Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) </li></ul><ul><li>will this completely solve count to infinity problem? </li></ul>algorithm terminates X Z 1 4 50 Y 60
    35. 35. Comparison of LS and DV algorithms <ul><li>Message complexity </li></ul><ul><li>LS: with n nodes, E links, O(nE) msgs sent </li></ul><ul><li>DV: exchange between neighbors only </li></ul><ul><ul><li>larger msgs </li></ul></ul><ul><ul><li>convergence time varies </li></ul></ul><ul><li>Speed of Convergence </li></ul><ul><li>LS: requires O(nE) msgs </li></ul><ul><ul><li>may have oscillations </li></ul></ul><ul><li>DV : convergence time varies </li></ul><ul><ul><li>may be routing loops </li></ul></ul><ul><ul><li>count-to-infinity problem </li></ul></ul><ul><li>Robustness: what happens if router malfunctions? </li></ul><ul><li>LS: </li></ul><ul><ul><li>node can advertise incorrect link cost </li></ul></ul><ul><ul><li>each node computes only its own table </li></ul></ul><ul><li>DV: </li></ul><ul><ul><li>DV node can advertise incorrect path cost </li></ul></ul><ul><ul><li>each node’s table used by others </li></ul></ul><ul><ul><ul><li>error propagate thru network </li></ul></ul></ul>
    36. 36. Hierarchical Routing <ul><li>scale: with 50 million destinations: </li></ul><ul><li>can’t store all dest’s in routing tables! </li></ul><ul><li>routing table exchange would swamp links! </li></ul><ul><li>administrative autonomy </li></ul><ul><li>internet = network of networks </li></ul><ul><li>each network admin may want to control routing in its own network </li></ul><ul><li>Our routing study thus far - idealization </li></ul><ul><li>all routers identical </li></ul><ul><li>network “flat” </li></ul><ul><li>… not true in practice </li></ul>
    37. 37. Hierarchical Routing <ul><li>aggregate routers into regions, “autonomous systems” (AS) </li></ul><ul><li>routers in same AS run same routing protocol </li></ul><ul><ul><li>“ intra-AS” routing protocol </li></ul></ul><ul><ul><li>routers in different AS can run different intra-AS routing protocol </li></ul></ul><ul><li>special routers in AS </li></ul><ul><li>run intra-AS routing protocol with all other routers in AS </li></ul><ul><li>also responsible for routing to destinations outside AS </li></ul><ul><ul><li>run inter-AS routing protocol with other gateway routers </li></ul></ul>gateway routers
    38. 38. Intra-AS and Inter-AS routing <ul><li>Gateways: </li></ul><ul><ul><li>perform inter-AS routing amongst themselves </li></ul></ul><ul><ul><li>perform intra-AS routers with other routers in their AS </li></ul></ul>inter-AS, intra-AS routing in gateway A.c network layer link layer physical layer a b a C A B d b a A.a A.c C.b B.a c b c
    39. 39. Intra-AS and Inter-AS routing Host h2 Intra-AS routing within AS A Intra-AS routing within AS B <ul><li>We’ll examine specific inter-AS and intra-AS Internet routing protocols shortly </li></ul>a b b a a C A B d c A.a A.c C.b B.a c b Host h1 Inter-AS routing between A and B
    40. 40. The Internet Network layer <ul><li>Host, router network layer functions: </li></ul>Transport layer: TCP, UDP Link layer physical layer Network layer routing table <ul><li>Routing protocols </li></ul><ul><li>path selection </li></ul><ul><li>RIP, OSPF, BGP </li></ul><ul><li>IP protocol </li></ul><ul><li>addressing conventions </li></ul><ul><li>datagram format </li></ul><ul><li>packet handling conventions </li></ul><ul><li>ICMP protocol </li></ul><ul><li>error reporting </li></ul><ul><li>router “signaling” </li></ul>
    41. 41. Routing: Example AS C i b b->i: I can reach hosts in D; my path: BCD a1 a2 d d->a2: I can reach hosts in D; my path: D a1->i: I can reach hosts in D; my path: AD E F Export to E: i->e: I can reach hosts in D; path: IBCD AS I a2->a1: I can reach hosts in D; path: D choose BCD using a1 b->i2: I can reach hosts in D; my path: BCD i2 b->i2: I can reach hosts in D; path: BCD No Export to F AS A ( OSPF) AS B ( OSPF intra routing) AS D
    42. 42. Routing: Example AS C i b How to specify? a1 a2 d a1->i: I can reach hosts in D; my path: AD E F AS I d1 d2 AS A ( OSPF) AS B ( OSPF intra routing) AS D
    43. 43. IP Addressing Scheme <ul><li>We need an address to uniquely identify each destination </li></ul><ul><li>Routing scalability needs flexibility in aggregation of destination addresses </li></ul><ul><ul><li>we should be able to aggregate a set of destinations as a single routing unit </li></ul></ul><ul><li>Preview: the unit of routing in the Internet is a network---the destinations in the routing protocols are networks </li></ul>
    44. 44. IP Addressing: introduction <ul><li>IP address: 32-bit identifier for host, router interface </li></ul><ul><li>interface: connection between host, router and physical link </li></ul><ul><ul><li>router’s typically have multiple interfaces </li></ul></ul><ul><ul><li>host may have multiple interfaces </li></ul></ul><ul><ul><li>IP addresses associated with interface, not host, or router </li></ul></ul> = 11011111 00000001 00000001 00000001 223 1 1 1
    45. 45. IP Addressing: introduction <ul><li>IP address: 32-bit identifier for host, router interface </li></ul><ul><li>interface: connection between host, router and physical link </li></ul><ul><ul><li>router’s typically have multiple interfaces </li></ul></ul><ul><ul><li>host may have multiple interfaces </li></ul></ul><ul><ul><li>IP addresses associated with interface, not host, or router </li></ul></ul> = 10000100 01000011 11000000 10000101 223 67 133 192
    46. 46. IP Addressing <ul><li>IP address: </li></ul><ul><ul><li>network part </li></ul></ul><ul><ul><ul><li>high order bits </li></ul></ul></ul><ul><ul><li>host part </li></ul></ul><ul><ul><ul><li>low order bits </li></ul></ul></ul><ul><li>What’s a network ? (from IP address perspective) </li></ul><ul><ul><li>device interfaces with same network part of IP address </li></ul></ul><ul><ul><li>can physically reach each other without intervening router </li></ul></ul> network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) LAN
    47. 47. IP Addressing <ul><li>How to find the networks? </li></ul><ul><li>Detach each interface from router, host </li></ul><ul><li>create “islands of isolated networks </li></ul> Interconnected system consisting of six networks
    48. 48. IP Addresses <ul><li>given notion of “network”, let’s re-examine IP addresses: </li></ul>0 network host A B C D class to to to to 32 bits “ class-full” addressing: 10 network host 110 network host 1110 multicast address
    49. 49. IP addressing: CIDR <ul><li>classful addressing: </li></ul><ul><ul><li>inefficient use of address space, address space exhaustion </li></ul></ul><ul><ul><li>e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network </li></ul></ul><ul><li>CIDR: C lassless I nter D omain R outing </li></ul><ul><ul><li>network portion of address of arbitrary length </li></ul></ul><ul><ul><li>address format: a.b.c.d/x , where x is # bits in network portion of address </li></ul></ul>11001000 00010111 0001000 0 00000000 network part host part
    50. 50. CIDR Address Aggregation i a1 a2 d i->a1: I can reach 130.132/ 16 ; my path: I AS I d1 130.132.1/ 24 130.132.2/ 24 130.132.3/ 24 intradomain routing uses /24 AS A ( OSPF) AS D
    51. 51. CIDR Address Aggregation x00/24: B x01/24: C x10/24: E x/22: A x11/24: F A B C E F x11/24: F x11/24: GF G
    52. 52. IP addresses: how to get one? <ul><li>Hosts (host portion): </li></ul><ul><li>hard-coded by system admin in a file </li></ul><ul><li>DHCP: D ynamic H ost C onfiguration P rotocol: dynamically get address: “plug-and-play” </li></ul><ul><ul><li>host broadcasts “ DHCP discover ” msg </li></ul></ul><ul><ul><li>DHCP server responds with “ DHCP offer ” msg </li></ul></ul><ul><ul><li>host requests IP address: “ DHCP request ” msg </li></ul></ul><ul><ul><li>DHCP server sends address: “ DHCP ack ” msg </li></ul></ul><ul><ul><li>The common practice in LAN and home access (why?) </li></ul></ul>
    53. 53. IP addresses: how to get one? <ul><li>Network (network portion): </li></ul><ul><li>get allocated portion of ISP’s address space: </li></ul>ISP's block 11001000 00010111 0001 0000 00000000 Organization 0 11001000 00010111 0001000 0 00000000 Organization 1 11001000 00010111 0001001 0 00000000 Organization 2 11001000 00010111 0001010 0 00000000 ... ….. …. …. Organization 7 11001000 00010111 0001111 0 00000000
    54. 54. Hierarchical addressing: route aggregation “ Send me anything with addresses beginning” Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “ Send me anything with addresses beginning” Organization 2 Hierarchical addressing allows efficient advertisement of routing information: . . . . . .
    55. 55. Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1 “ Send me anything with addresses beginning” Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “ Send me anything with addresses beginning or” Organization 2 . . . . . .
    56. 56. Network Address Translation: Motivation 1 92 . 168 . 1 . 2 1 92 . 168 . 1 . 3 1 92 . 168 . 1 . 4 1 92 . 168 . 1 . 1 local network (e.g., home network) 1 92 . 168 . 1.0 /24 rest of Internet Datagrams with source or destination in this network have 1 92 . 168 . 1 /24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address:, different source port numbers <ul><ul><li>A loc al network uses just one public IP address as far as outside world is concerned </li></ul></ul><ul><ul><li>Each device on the local network is assigned a private IP address </li></ul></ul>
    57. 57. NAT: Network Address Translation <ul><li>Implementation: NAT router must: </li></ul><ul><ul><li>outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) </li></ul></ul><ul><ul><ul><li>. . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr. </li></ul></ul></ul><ul><ul><li>remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair </li></ul></ul><ul><ul><li>incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table </li></ul></ul>
    58. 58. NAT: Network Address Translation 1 92 . 168 . 1 . 2 1 92 . 168 . 1 . 1 NAT translation table WAN side addr LAN side addr, 5001 1 92 . 168 . 1 . 2 , 3345 …… …… 3: Reply arrives dest. address:, 5001 4: NAT router changes datagram dest addr from, 5001 to 1 92 . 168 . 1 . 2 , 3345 1 92 . 168 . 1 . 3 1 92 . 168 . 1 . 4 S: 1 92 . 168 . 1 . 2 , 3345 D:, 80 1 1: host 1 92 . 168 . 1 . 2 sends datagram to, 80 S:, 80 D: 1 92 . 168 . 1 . 2 , 3345 4 S:, 5001 D:, 80 2 2: NAT router changes datagram source addr from 1 92 . 168 . 1 . 2 , 3345 to, 5001, updates table S:, 80 D:, 5001 3
    59. 59. Network Address Translation: Advantages <ul><li>No need to be allocated range of addresses from ISP: - just one public IP address is used for all devices </li></ul><ul><ul><li>16-bit port-number field allows 60,000 simultaneous connections with a single LAN-side address ! </li></ul></ul><ul><ul><li>can change ISP without changing addresses of devices in local network </li></ul></ul><ul><ul><li>can change addresses of devices in local network without notifying outside world </li></ul></ul><ul><li>Devices inside local net not explicitly addressable, visible by outside world (a security plus) </li></ul>
    60. 60. NAT: Network Address Translation <ul><li>If both hosts are behind NAT, they will have difficulty establishing connection </li></ul><ul><li>NAT is controversial: </li></ul><ul><ul><li>routers should process up to only layer 3 </li></ul></ul><ul><ul><li>violates end-to-end argument </li></ul></ul><ul><ul><ul><li>NAT possibility must be taken into account by app designers, e.g., P2P applications </li></ul></ul></ul><ul><ul><li>address shortage should instead be solved by having more addresses --- IPv6 ! </li></ul></ul>
    61. 61. IP addressing: the last word... <ul><li>Q: How does an ISP get block of addresses? </li></ul><ul><li>A: ICANN : I nternet C orporation for A ssigned </li></ul><ul><li>N ames and N umbers </li></ul><ul><ul><li>allocates addresses </li></ul></ul><ul><ul><li>manages DNS </li></ul></ul><ul><ul><li>assigns domain names, resolves disputes </li></ul></ul>
    62. 62. Getting a datagram from source to dest. <ul><li>IP datagram: </li></ul><ul><li>datagram remains unchanged, as it travels source to destination </li></ul><ul><li>addr fields of interest here </li></ul><ul><ul><li>mainly dest. IP addr </li></ul></ul>routing table in A A B E misc fields source IP addr dest IP addr data Dest. Net. next router Nhops 223.1.1 1 223.1.2 2 223.1.3 2
    63. 63. Getting a datagram from source to dest. <ul><li>Starting at A, given IP datagram addressed to B: </li></ul><ul><li>look up net. address of B </li></ul><ul><li>find B is on same net. as A </li></ul><ul><li>link layer will send datagram directly to B inside link-layer frame </li></ul><ul><ul><li>B and A are directly connected </li></ul></ul>misc fields data A B E Dest. Net. next router Nhops 223.1.1 1 223.1.2 2 223.1.3 2
    64. 64. Getting a datagram from source to dest. <ul><li>Starting at A, dest. E: </li></ul><ul><li>look up network address of E </li></ul><ul><li>E on different network </li></ul><ul><ul><li>A, E not directly attached </li></ul></ul><ul><li>routing table: next hop router to E is </li></ul><ul><li>link layer sends datagram to router inside link-layer frame </li></ul><ul><li>datagram arrives at </li></ul><ul><li>continued….. </li></ul>misc fields data A B E Dest. Net. next router Nhops 223.1.1 1 223.1.2 2 223.1.3 2
    65. 65. Getting a datagram from source to dest. <ul><li>Arriving at 223.1.4, destined for </li></ul><ul><li>look up network address of E </li></ul><ul><li>E on same network as router’s interface </li></ul><ul><ul><li>router, E directly attached </li></ul></ul><ul><li>link layer sends datagram to inside link-layer frame via interface </li></ul><ul><li>datagram arrives at !!! (hooray!) </li></ul>misc fields data A B E network router Nhops interface 223.1.1 - 1 223.1.2 - 1 223.1.3 - 1 Dest. next
    66. 66. IP datagram format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16- bit identifier Internet checksum time to live 32 bit source IP address IP protocol version number header length (bytes) max number remaining hops (decremented at each router) for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “ type” of data flgs fragment offset upper layer 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit.
    67. 67. Routing in the Internet <ul><li>The Global Internet consists of Autonomous Systems (AS) interconnected with each other: </li></ul><ul><ul><li>Stub AS : small corporation </li></ul></ul><ul><ul><li>Multihomed AS : large corporation (no transit) </li></ul></ul><ul><ul><li>Transit AS : provider </li></ul></ul><ul><li>Two-level routing: </li></ul><ul><ul><li>Intra-AS: administrator is responsible for choice </li></ul></ul><ul><ul><li>Inter-AS: unique standard </li></ul></ul>
    68. 68. Internet AS Hierarchy Inter-AS border (exterior gateway) routers Intra-AS interior (gateway) routers
    69. 69. Intra-AS Routing <ul><li>Also known as Interior Gateway Protocols (IGP) </li></ul><ul><li>Most common IGPs: </li></ul><ul><ul><li>RIP: Routing Information Protocol </li></ul></ul><ul><ul><li>OSPF: Open Shortest Path First </li></ul></ul><ul><ul><li>IGRP: Interior Gateway Routing Protocol (Cisco propr.) </li></ul></ul>
    70. 70. RIP ( Routing Information Protocol) <ul><li>Distance vector algorithm </li></ul><ul><li>Included in BSD-UNIX Distribution in 1982 </li></ul><ul><li>Distance metric: # of hops (max = 15 hops) </li></ul><ul><ul><li>why? </li></ul></ul><ul><li>Distance vectors: exchanged every 30 sec via Response Message (also called advertisement ) </li></ul><ul><li>Each advertisement: route to up to 25 destination nets </li></ul>
    71. 71. RIP (Routing Information Protocol) Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B 7 x -- 1 … . …. .... w x y z A C D B Routing table in D
    72. 72. RIP: Link Failure and Recovery <ul><li>If no advertisement heard after 180 sec --> neighbor/link declared dead </li></ul><ul><ul><li>routes via neighbor invalidated </li></ul></ul><ul><ul><li>new advertisements sent to neighbors </li></ul></ul><ul><ul><li>neighbors in turn send out new advertisements (if tables changed) </li></ul></ul><ul><ul><li>link failure info quickly propagates to entire net </li></ul></ul><ul><ul><li>poison reverse used to prevent ping-pong loops (infinite distance = 16 hops) </li></ul></ul>
    73. 73. OSPF (Open Shortest Path First) <ul><li>“ open”: publicly available </li></ul><ul><li>Uses Link State algorithm </li></ul><ul><ul><li>LS packet dissemination </li></ul></ul><ul><ul><li>Topology map at each node </li></ul></ul><ul><ul><li>Route computation using Dijkstra’s algorithm </li></ul></ul><ul><li>OSPF advertisement carries one entry per neighbor router </li></ul><ul><li>Advertisements disseminated to entire AS (via flooding) </li></ul>
    74. 74. OSPF “advanced” features (not in RIP) <ul><li>Security: all OSPF messages authenticated (to prevent malicious intrusion); TCP connections used </li></ul><ul><li>Multiple same-cost path s allowed </li></ul><ul><ul><li>only one path in RIP </li></ul></ul><ul><li>For each link, multiple cost metrics for different ToS (eg, satellite link cost set “low” for best effort; high for real time) </li></ul><ul><li>Integrated uni- and multicast support: </li></ul><ul><ul><li>Multicast OSPF (MOSPF) uses same topology data base as OSPF </li></ul></ul><ul><li>Hierarchical OSPF in large domains. </li></ul>
    75. 75. Hierarchical OSPF
    76. 76. Hierarchical OSPF <ul><li>Two-level hierarchy: local area, backbone. </li></ul><ul><ul><li>Link-state advertisements only in area </li></ul></ul><ul><ul><li>each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. </li></ul></ul><ul><li>Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. </li></ul><ul><li>Backbone routers: run OSPF routing limited to backbone. </li></ul><ul><li>Boundary routers: connect to other ASs. </li></ul>
    77. 77. IGRP (Interior Gateway Routing Protocol) <ul><li>CISCO proprietary; successor of RIP (mid 80s) </li></ul><ul><li>Distance Vector, like RIP </li></ul><ul><li>several cost metrics (delay, bandwidth, reliability, load etc) </li></ul><ul><li>uses TCP to exchange routing updates </li></ul><ul><li>Loop-free routing via Distributed Updating Alg. (DUAL) based on diffused computation </li></ul>
    78. 78. Inter-AS routing
    79. 79. Internet inter-AS routing: BGP <ul><li>BGP (Border Gateway Protocol): the de facto standard </li></ul><ul><li>Path Vector protocol: </li></ul><ul><ul><li>similar to Distance Vector protocol </li></ul></ul><ul><ul><li>each Border Gateway broadcast to neighbors (peers) entire path (I.e, sequence of ASs) to destination </li></ul></ul><ul><ul><li>E.g., Gateway X may send its path to dest. Z: </li></ul></ul><ul><li>Path (X,Z) = X,Y1,Y2,Y3,…,Z </li></ul>
    80. 80. Internet inter-AS routing: BGP <ul><li>Suppose: gateway X send its path to peer gateway W </li></ul><ul><li>W may or may not select path offered by X </li></ul><ul><ul><li>cost, policy (don’t route via competitors AS), loop prevention reasons . </li></ul></ul><ul><li>If W selects path advertised by X, then: </li></ul><ul><li>Path (W,Z) = W, Path (X,Z) </li></ul><ul><li>Note: X can control incoming traffic by controlling its route advertisements to peers: </li></ul><ul><ul><li>e.g., don’t want to route traffic to Z -> don’t advertise any routes to Z </li></ul></ul>
    81. 81. Internet inter-AS routing: BGP <ul><li>BGP messages exchanged using TCP. </li></ul><ul><li>BGP messages: </li></ul><ul><ul><li>OPEN: opens TCP connection to peer and authenticates sender </li></ul></ul><ul><ul><li>UPDATE: advertises new path (or withdraws old) </li></ul></ul><ul><ul><li>KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request </li></ul></ul><ul><ul><li>NOTIFICATION: reports errors in previous msg; also used to close connection </li></ul></ul>
    82. 82. Why different Intra- and Inter-AS routing ? <ul><li>Policy: </li></ul><ul><li>Inter-AS: admin wants control over how its traffic routed, who routes through its net. </li></ul><ul><li>Intra-AS: single admin, so no policy decisions needed </li></ul><ul><li>Scale: </li></ul><ul><li>hierarchical routing saves table size, reduced update traffic </li></ul><ul><li>Performance : </li></ul><ul><li>Intra-AS: can focus on performance </li></ul><ul><li>Inter-AS: policy may dominate over performance </li></ul>