part iv network layer protocols n.
Skip this Video
Loading SlideShow in 5 Seconds..
Part IV Network Layer Protocols PowerPoint Presentation
Download Presentation
Part IV Network Layer Protocols

play fullscreen
1 / 50
Download Presentation

Part IV Network Layer Protocols - PowerPoint PPT Presentation

Download Presentation

Part IV Network Layer Protocols

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

  1. Part IVNetwork Layer Protocols Routing IP Protocol Router Architectures

  2. Network Layer Functions • Determine the routes to be taken by datagrams using routing algorithms such as Link State, Distance Vector, Hierarchical Routing, multicast routing • Switch packets arriving on an input port to the output port specified by the routing algorithms • In case of connection oriented services (ATM), implement Call Setup and Virtual Circuit mechanisms and maintain information related to set-up VCs

  3. Network Layer Functions

  4. Virtual Circuit (VC) Service common route followed by all packets of a connection, thus providing in-order packet delivery to a destination VC phases: VC Set-up: source to destination route is selected, tables entries are inserted indicating the VC numbers and incoming/outgoing ports; resources may be reserved for this connection (eg buffer space) Data Transfer: data packets flow over the selected route, headers indicate the VC numbers VC tear-down: either side can request tear-down, other side is informed, and resources are released Signaling Messages and Signaling Protocol: used to set-up and tear-down VCs

  5. Datagram Service • No connection set-up and tear-down, thus routers do not have to maintain any connection state information • Packets carry source and destination addresses and are switched in a router based on the destination address • packets may follow different end-to-end routes, and thus may arrive out of order

  6. Virtual Circuit Vs. Datagram

  7. Internet Service Model • Internet uses datagram service, while ATM uses VC service • Internet provides only one type of datagram service, sometimes called best effort; ie no guarantees regarding in-order delivery, throughput, end to end average delay, jitter, or just plain delivery! • Researchers are currently working to add QoS services (IntServ and DiffServ)

  8. ATM Service Models • 4 service classes for a user connection: • Constant Bit Rate (CBR): connection looks like a dedicated wire; guarantees bdw and upper bounds on loss rate, delay, jitter; suitable for real-time applications (digitized voice) • Unspecified Bit Rate (UBR): guarantees only in-order delivery; suited for interactive traffic (email, newsgroups) • Available Bit Rate (ABR): guarantees a minimum transmission rate, but if bandwidth is available, user may exceed that rate up to some peak cell rate (suitable for Web browsing) • Variable Bit Rate (VBR): provides guarantees as in CBR, but user can vary cell rate; suitable for compressed video applications

  9. Routing Principles • Routing: delivering a packet to its destination on the best possible path • Routing steps: (a) determine destination’s network address (b) compute/construct the path (c) forward the packet to destination Here, we will focus on (b) - routing algorithms for path computation

  10. Routing Alg Requirements • Find path with min delay, cost or other metric • dynamic reconfiguration after failures/changes • adaptive load balancing

  11. Routing Alg Classification • Global routing (eg, Link State): each node knows the “global” topology (connectivity, link costs etc); it individually computes all routes (“centralized” computation); • Centralized routing: a single node computes all routes • Distributed (decentralized) routing (eg, Distance Vector): no node has global topology knowledge. Totally distributed route computation. Gradual computation of routes via exchange of route tables among neighbors • Static routing (manually edited routing tables) vs dynamic routing (automatically updated tables)

  12. Link State Routing • Each router measures the “costs” (eg, delay, bdw, pkt loss etc.) of its attached links • Periodically (or upon link change/failure) it packs the link costs in a Link State (LS) pkt, and broadcasts the LS pkt to its neighbors • The neighbors will in turn broadcast the LS pkt to their neighbors and so on until all nodes have heard the pkt (propagation via flooding) • Duplicate pkts are detected and dropped based on source ID and unique sequence number

  13. Link State Routing (cont) • At steady state, each router has received the LS updates from all other routers • It can build a complete network topology and link cost map (identical for all routers) • Next, it computes routes from itself to all other nodes in the network (using, for example, Dijkstra’s Alg). It creates a routing table with such routes • Routing tables at different nodes are all consistent since they are based on the same topology/cost data base • LS routing protocol used in OSPF intradomain routing

  14. Dijkstra Shortest Path Alg Notation: • c(i,j) be cost of link (i,j); • D(v) cost of path from source A to v; • p(v) previous node on shortest path from A to v

  15. Dijkstra’s Alg (cont) 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

  16. step N D(B),p(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),p(F) 0 A 2,A 5,A 1,A infty infty 1 AD 2,A 4,D 2,D infty 2 ADE 2,A 3,E 4,E 3 ADEB 3E 4E 4 ADEBC 4E 5 ADEBCF

  17. Dijkstra’s Alg Complexity • Assume the set of nodes is stored as a linear array • To find the node not in N, with min distance from A, it requires O(n) operations • The above step is repeated n times, thus total complexity is O(n^2) • Using sorted heap instead of linear array, the complexity is reduced to O(n lgn)

  18. Link State oscillatory behavior • Route oscillations may occur if link cost depends on flow and thus on routes (in example below, cost=flow) Solutions: flow independent costs; or, multipath routing

  19. Distance Vector routing alg • Distance Vector (DV): vector of distances to all dests • Periodic DV exchange between neighbors • Each node updates own DV using the min distance (via “best” neighbor) to destination

  20. DV code At each node X: 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 minwD(y,w) to each neighbor /* w over all X's neighbors */ 7 8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I 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 */

  21. DV code (cont’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: DX(Y,V) = c(X,V) + newval 22 23 if we have 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

  22. Bellman Ford Alg • The algorithm used to compute DVs is the Bellman Ford (B-F) Algorithm • For DV computation, we have used a “decentralized” version of the B-F algorithm • The B-F based DV routing algorithm is used in many network routing protocols: BGP, ISO IDRP, RIP, Novell IPX, original ARPANET, Packet Radio net, etc.

  23. DV table example

  24. DV convergence example

  25. Link cost change: good news

  26. Count-to-infinity problem

  27. Poison Reverse • If node Z uses next node Y to get to X, Z will advertises D(X) = 00 to Y

  28. Poison Reverse (cont) • Note:loops with 3 or more nodes (instead of ping-pong) not detected by Poison Reverse • Solution? Path Vector: advertise not only the distance to destination, but the entire path to destination • Path vector used in internet BGP (interdomain routing)

  29. Link State vs Distance Vector • Message transmission complexity: For each cycle, O(nE) total mssgs sent for both LS and DV, where E = # of links; n=#of nodes However, LS propagates change to ALL nodes; DV only to nodes affected by change • Speed of Convergence: LS updates propagate much faster than DV updates; this is one of the reasons why ARPANET dumped DV for LS in 1979

  30. Link State vs Distance Vector (cont) • Robustness: both LS and DV tolerant of changes/failure; LS better protected against router mulfunctions (wrong path computation); the error remains local in LS; it affects the entire network in DV • QoS support: in LS, complete topology map allows router to compute paths with QoS constraints (Q-OSPF) • Implementation cost: LS requires more memory and more processing

  31. Hierarchical Routing Routing hierarchy needed for: • Scaling: “flat” routing tables (DV) and topology maps (LS) grow too large. Message and computation O/H excessive • Local autonomy: different organizations (eg, Campus, company, ISP) wish to operate own network and “hide” internal organization structure

  32. Hierarchical Routing (cont) • Internet hierarchical routing: Autonomous Systems (AS) interconnected by gateway routers • Intra-AS routing scheme: varies from AS to AS • Inter-AS routing scheme: same for the entire Internet; it is run by Border Gateways

  33. Intra and inter-AS routing

  34. Gateway router

  35. Intra and inter-AS path

  36. Internet Protocol (IP) • Connectionless datagram service (like US Post Service) • No performance guarantees, not even delivery guarantee • No guarantee of in-order delivery of datagrams • Components of network layer: • IP Protocol • Routing Protocols

  37. Addressing In IP • A host is typically connected via one link/interface to the network • A router is typically connected by more than one link to the network • Machines on the network will have as many addresses as there are links that connect them to the network, thus routers have more than one IP address, while hosts typically have one IP address • IP Address is 32 bit long, expressed (for convenience to humans) in dot-decimal notation; eg

  38. Addressing In IP (cont) • Address space is managed by IANA (Internet Assigned Number Authority), and its regional registries: ARIN (American Registry for Internet Addresses: North and South America and Parts of Africa!), RIPE (Reseaux IP Europeans), APNIC (Asia Pacific Net Info Center) • Address is either entered manually or by a protocol: BOOTP and more recently Dynamic Host Configuration Protocol (DHCP) • Open issue: IP address for mobile host

  39. Hosts And Router Addresses • Three LANs, with different addresses • Router has three IP addresses • Hosts/router on same LAN share the first three bytes in the address

  40. Addresses In Interconnected Networks This example has three LANs with IP addresses: 223.1.1, 223.1.2, 223.1.3; and three other networks (or subnets) with addresses: 223.1.7, 223.1.8, 223.1.9

  41. Address Classes Or Host/Router Interface

  42. Routing Table In Host A Next Router Dest Net #Hops 223.1.1 223.1.2 223.1.3 -- 1 2 2 IP Datagram Forwarding • Every IP datagram has an IP header including source and destination IP addresses; Hosts/Routers have routing tables; for example: Routing Table In Router Dest Net Next Router #Hops Interface -- -- -- 1 1 1 1 2 3 223.1.1 223.1.2 223.1.3

  43. IP Datagram Format (Cont.)

  44. IP Datagram Format • Version Number: allows coexistence of more than one version; router forwards the arriving datagram for processing to the appropriate version of IP • Header Length: to accommodate a variable number of Option fields • TOS: type of service, various interpretations • Length: header + data in bytes, 16 bits • Identifier, Flags, Fragmentation Offset: used in Fragmentation, TBD

  45. IP Datagram Format (cont) • Time-to-live: to avoid delayed datagrams; count decremented by one after each hop; when it reaches zero, datagram is dropped • Protocol: indicates the Transport Layer protocol to which the datagram belongs, at the destination, the appropriate protocol software • Checksum: for header only, if error detected, the datagram is dropped, recomputed at each router • Options: extend IP header when needed (eg, source routing); more processing time variance

  46. IP Datagram Fragmentation • Links along a route may use different link layer protocols, possibly with differing maximum frame size (called Maximum Transfer Unit, or MTU) • A router which receives a datagram on one link, and has to forward on another link with smaller MTU ‘fragments’ the datagram • Each fragment travels to the destination separately, • The original datagram is reassembled at the destination, and its payload passed to the transport layer

  47. IP Datagram Fragmentation • Header fields used to support fragmentation: • Identification number: along with source and destination IP addresses, uniquely identifies a datagram • Fragmentation Offset: specifies the position (in the original datagram) of the first character in the fragment • Flag: 1 => not the last fragment

  48. Fragmentation Example 1st fragment 1480 bytes in the data field of the IP datagram. identification = 777 offset = 0 (meaning the data should be inserted beginning at byte 0) flag = 1 (meaning there is more) 2nd fragment 1480 byte information field identification = 777 offset = 1,480 (meaning the data should be inserted beginning at byte 1,480 flag = 1 (meaning there is more) 3rd fragment 1020 byte (=3980-1480-1480) information field identification = 777 offset = 2,960 (meaning the data should be inserted beginning at byte 2,960) flag = 0 (meaning this is the last fragment)

  49. Internet Control Message Protocol (ICMP) • Used by network nodes to exchange control information such as error messages, and for simple testing operations (eg, ping) • ICMP messages are carried in IP datagrams • Traceroute utility uses ICMP messages: send IP datagrams with specific TTL, thus forcing ICMP messages to be returned to sender host

  50. ICMP: more examples • Other ICMP messages: • Echo request (ping) • Echo reply (response to ping) • Destination host unreachable • Destination network unreachable • Source quench (congestion control) • TTL expired (sent to source of datagram which was dropped due to TTL) • IP header bad