1 / 53

Computer Networks

Computer Networks. Network Layer (Part 1). Last classes. Data-link layer Functions Specific implementations, devices. Next classes. Network layer Functions Addressing Security Fragmentation Delivery semantics Quality of service Routing Demux to upper layer Error detection

reece-bruce
Download Presentation

Computer Networks

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. Computer Networks Network Layer (Part 1)

  2. Last classes • Data-link layer • Functions • Specific implementations, devices

  3. Next classes • Network layer • Functions • Addressing • Security • Fragmentation • Delivery semantics • Quality of service • Routing • Demux to upper layer • Error detection • Specific implementations • IP • Router devices, implementations

  4. Transport packet from sending to receiving hosts Network layer protocols in every host, router Important functions: Addressing: address assignment Security: provide privacy, authentication, etc. at the network layer Fragmentation: break-up packets based on data-link layer properties Delivery semantics: unicast, multicast, anycast, broadcast, ordering Quality-of-service: provide predictable performance Routing: path selection and packet forwarding network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical application transport network data link physical Network layer functions

  5. NL: Addressing • Hierarchical vs. flat • Routing table size • Global vs. local • Applications (NAT) • Processing speed • Variable-length vs. fixed-length • Flexibility • Processing costs • Header size

  6. NL: Security • Secrecy • No eavesdropping • Integrity • No man-in-the-middle attacks • Authenticity • Ensure identity of source • If time permits, we will look at network security at the end of course…..

  7. NL: Fragmentation • Different link-layers have different MTUs • Split packets into multiple fragments • Where to do reassembly? • End nodes – avoids unnecessary work • Dangerous to do at intermediate nodes • Buffer space • Must assume single path through network • May be re-fragmented later on in the route again • Path MTU Discovery • Network layer does no fragmentation • Host does Path MTU discovery

  8. NL: Fragmentation is Harmful • Uses resources poorly • Forwarding costs per packet • Best if we can send large chunks of data • Worst case: packet just bigger than MTU • Poor end-to-end performance • Loss of a fragment • Reassembly is hard • Buffering constraints

  9. NL: Fragmentation • References • Characteristics of Fragmented IP Traffic on Internet Links. Colleen Shannon, David Moore, and k claffy -- CAIDA, UC San Diego. ACM SIGCOMM Internet Measurement Workshop 2001. http://www.aciri.org/vern/sigcomm-imeas-2001.program.html • C. A. Kent and J. C. Mogul, "Fragmentation considered harmful," in Proceedings of the ACM Workshop on Frontiers in Computer Communications Technology, pp. 390--401, Aug. 1988.http://www.research.compaq.com/wrl/techreports/abstracts/87.3.html

  10. NL: Delivery semantics • Communication modes • Unicast (One source to one destination) • Anycast (One source to any of a set of destinations) • Multicast (One or more sources to a set of destinations) • Broadcast (One source to all destinations) • Ordering • In-order vs. out-of-order delivery • If time permits, we will look at multicast at the end of the course.

  11. 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? NL: Quality-of-Service The most important abstraction provided by network layer: ? ? virtual circuit or datagram? ? service abstraction

  12. call setup, teardown for each call before data can flow each packet carries VC identifier (not destination host OD) every router on source-dest path s maintain “state” for each passing connection transport-layer connection only involved two end systems link, router resources (bandwidth, buffers) may be allocated to VC to get circuit-like perf. “source-to-dest path behaves much like telephone circuit” performance-wise network actions along source-to-dest path NL: Virtual circuits

  13. used to setup, maintain teardown VC used in ATM, frame-relay, X.25 not used in today’s Internet on an end-to-end basis application transport network data link physical application transport network data link physical NL: Virtual circuits: signaling protocols 6. Receive data 5. Data flow begins 4. Call connected 3. Accept call 1. Initiate call 2. incoming call

  14. 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 NL: Datagram networks: the Internet model 1. Send data 2. Receive data

  15. NL: Network layer service models: Guarantees ? Network Architecture Internet ATM ATM ATM ATM Service Model best effort CBR VBR ABR UBR Congestion feedback no (inferred via loss) 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 • Chapter 6

  16. Internet 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 evolved from telephony human conversation: strict timing, reliability requirements need for guaranteed service “dumb” end systems telephones complexity inside network NL: Datagram or VC network: why?

  17. NL: Routing • Routing algorithms and architectures • Link state algorithms • Distance vector algorithms • Routing hierarchies • Area routing • Landmark routing

  18. Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links link cost: delay, $ cost, or congestion level 5 3 5 2 2 1 3 1 2 1 A D E B F C Routing protocol NL: Routing algorithms Goal: determine “good” path (sequence of routers) thru network from source to dest. • “good” path: • typically means minimum cost path • other def’s possible

  19. 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 NL: Routing algorithms

  20. NL: What to look for in routing algorithms • Communication costs • Processing costs • Optimality • Stability • Convergence time • Loop freedom • Oscillation damping

  21. NL: Link state routing algorithms • Used in OSPF (intra-domain routing protocol) • Basic steps • Start condition • Each node assumed to know state of links to its neighbors • Step 1 • Each node broadcasts its state to all other nodes • Reliable flooding mechanism • Step 2 • Each node locally computes shortest paths to all other nodes from global state • Dijkstra’s shortest path tree (SPT) algorithm

  22. NL: Step 1 • Link State Packets (LSPs) to broadcast state to all nodes • Periodically, each node creates a link state packet containing: • Node ID • List of neighbors and link cost • Sequence number • Time to live (TTL) • Node outputs LSP on all its links

  23. NL: Step 1 • Reliable Flooding • When node J receives LSP from node K • If LSP is the most recent LSP from K that J has seen so far, J saves it in database and forwards a copy on all links except link LSP was received on • Otherwise, discard LSP • How to tell more recent • Use sequence numbers • Same method as sliding window protocols • Needed to avoid stale information from flood • Sequence number wrap-around • Lollipop sequence space

  24. NL: Step 1 and wrapped sequence numbers • Wrapped sequence numbers • 0-N where N is large • If difference between numbers is large, assume a wrap • A is older than B if…. • A < B and |A-B| < N/2 or… • A > B and |A-B| > N/2 • What about new nodes out of sync with sequence number space? • Lollipop sequence (Perlman 1983)

  25. NL: Step 1 and lollipop sequence numbers • Divide sequence number space • Special negative sequence for recovering from reboot • When receiving an old number, nodes inform new node of current sequence number • A older than B if • A < 0 and A < B • A > 0, A < B and (B – A) < N/4 • A > 0, A > B and (A – B) > N/4 -N/2 0 N/2 - 1

  26. Dijkstra’s algorithm all link costs on the network are known 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 destinations 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 NL: Step 2 A Link-state routing algorithm

  27. NL: Step 2 (Dijkstra’s algorithm example) 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) = infinity 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

  28. NL: Step 2 (Dijkstra’s algorithm example) 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  29. NL: Step 2 (Dijkstra’s algorithm example) 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  30. NL: Step 2 (Dijkstra’s algorithm example) 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  31. NL: Step 2 (Dijkstra’s algorithm example) 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  32. NL: Step 2 (Dijkstra’s algorithm example) 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  33. NL: Step 2 (Dijkstra’s algorithm example) 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  34. NL: Link State Characteristics • With consistent LSDBs, all nodes compute consistent loop-free paths • Limited by Dijkstra computation overhead, space requirements • Can still have transient loops B 1 1 X 3 A C 5 2 D Packet from CA may loop around BDC if B knows about failure and C & D do not

  35. Algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n*(n+1)/2 comparisons: O(n**2) 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 e 0 0 NL: 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

  36. NL: Distance vector routing algorithms • Variants used in • Early ARPAnet • RIP (intra-domain routing protocol) • BGP (inter-domain routing protocol) • Distributed next hop computation • Unit of information exchange • Vector of distances to destinations

  37. distance from X to Y, via Z as next hop X X = D (Y,Z) D (Y,*) Z c(X,Z) + min {D (Y,w)} = w NL: Distance vector routing algorithms • Exchange known distance information iteratively • Example (Bellman 1957) • Start with link table (as with Dijkstra), calculate distance table iteratively through table exchanges with adjacent nodes • Distance table data structure • table of known distances and next hops kept per node • row for each possible destination • column for each directly-attached neighbor to node • example: in node X, for dest. Y via neighbor Z: Minimum known distance from X to Y = X Next hop node from X to Y H (Y) =

  38. 1 7 2 8 1 2 A D E B C E E E D (C,D) D (A,D) D (A,B) D D B c(E,D) + min {D (A,w)} c(E,D) + min {D (C,w)} c(E,B) + min {D (A,w)} = = = w w w = = = 2+3 = 5 8+6 = 14 2+2 = 4 NL: Distance Table: example 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 loop! X H (Y) = loop!

  39. 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 NL: Distance table gives routing table X H (Y) Outgoing link to use, cost A B C D A,1 D,5 D,4 D,4 destination Routing table Distance table

  40. NL: Bellman algorithm while there is a change in D { for all k not neighbor of i { for each j neighbor of i { Di(k,j) = c(i,j) + Dj(k,*) if Di(k,j) < Di(k,*) { Di(k,*) = Di(k,j) Hi(k) = j } } } } Dj(k,*) k c(i,j) Di(k,*) i j c(i,j’) j’ k’ Dj’(k,*)

  41. NL: Distributed Bellman-Ford • Make Bellman algorithm distributed (Ford-Fulkerson 1962) • Each node i knows part of link table • Iterative • Each node sends around and recalculates D[i,*] • continues until no nodes exchange info. • self-terminating: no “signal” to stop • Asynchronous • nodes need not exchange info/iterate in lock step! • “triggered updates” • Distributed • each node communicates only with directly-attached neighbors

  42. 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 NL: Distributed Bellman-Ford overview Each node:

  43. NL: Distributed Bellman-Ford algorithm At all nodes, X: 1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infinity /* the * operator means "for all rows" */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all X's neighbors */ X X X w

  44. NL: Distributed Bellman-Ford algorithm (cont.): 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 */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D (y,V) = D (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 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 we have a new min D (Y,w)for any destination Y 24 send new value of min D (Y,w) to all neighbors 25 26 forever X X w X X w X w

  45. NL: DBF example Initial Distance Vectors 1 Distance to Node B C Info at Node A B C D E 7 0 7 ~ ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 E D E 1 8 ~ 2 0

  46. NL: DBF example E Receives D’s Routes; Updates Cost 1 Distance to Node B C Info at Node A B C D E 7 0 7 ~ ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 4 2 0

  47. NL: DBF example A receives B’s; Updates Cost 1 Distance to Node B C Info at Node A B C D E 7 0 7 8 ~ 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 4 2 0

  48. NL: DBF example A receives E’s routes; Updates Costs 1 Distance to Node B C Info at Node A B C D E 7 0 7 5 3 1 A 8 2 B A 7 0 1 ~ 8 C ~ 1 0 2 ~ 1 2 D ~ ~ 2 0 2 D E E 1 8 4 2 0

  49. NL: DBF example Final Distances 1 Distance to Node B C Info at Node A B C D E 7 0 6 5 3 1 A 8 2 B A 6 0 1 3 5 C 5 1 0 2 4 1 2 D 3 3 2 0 2 D E E 1 5 4 2 0

  50. NL: DBF example E’s routing table 1 E’s routing table B C Next hop 7 dest A B D 8 2 A 1 14 5 A B 7 8 5 1 2 C 6 9 4 E D D 4 11 2

More Related