Chapter 4: Network Layer* Virtual circuits Chapter goals: Chapter Overview: “source-to-dest path behaves much like telephone � understand principles � network layer services circuit” behind network layer � routing principle: path o performance-wise services: selection o network actions along source-to-dest path routing (path selection) o � hierarchical routing dealing with scale o � IP how a router works � call setup, teardown for each call before data can flow o � Internet routing protocols advanced topics: IPv6, o � each packet carries VC identifier (not destination host OD) reliable transfer multicast � every router on source-dest path maintains “state” for intra-domain o � instantiation and each passing connection inter-domain o implementation in the transport-layer connection only involved two end systems o � what’s inside a router? Internet � link, router resources (bandwidth, buffers) may be � IPv6 allocated to VC � multicast routing to get circuit-like perf. o * Kurose and Ross, “Computer Networking” Danny Dolev 4: Network Layer Danny Dolev 4: Network Layer 4a-1 4a-4 Virtual circuits: signaling protocols Network layer functions � transport packet from application sending to receiving hosts � used to setup, maintain teardown VC transport network � network layer protocols in data link network � used in ATM, frame-relay, X.25 physical every host, router network data link network physical data link data link physical � not used in today’s Internet physical three important functions: network data link � path determination: route physical network data link taken by packets from source physical to dest. Routing algorithms network application network data link � switching: move packets from data link application physical 6. Receive data 5. Data flow begins transport physical router’s input to appropriate transport network 4. Call connected 3. Accept call network application router output data link network physical transport 1. Initiate call data link 2. incoming call network � call setup: some network data link data link physical physical architectures require router physical call setup along path before data flows Danny Dolev 4: Network Layer Danny Dolev 4: Network Layer 4a-2 4a-5 Network service model Datagram networks: the Internet model � no call setup at network layer Q: What service model � routers: no state about end-to-end connections for “channel” o no network-level concept of “connection” The most important transporting packets � packets typically routed using destination host ID abstraction provided from sender to o packets between same source-dest pair may take by network layer: receiver? different paths ? ? � guaranteed bandwidth? virtual circuit n o � preservation of inter-packet i t or c ? application a timing (no jitter)? application r datagram? transport t s � loss-free delivery? transport b network a network � in-order delivery? 1. Send data e 2. Receive data data link c i data link v � congestion feedback to physical r e physical s sender? Danny Dolev 4: Network Layer Danny Dolev 4: Network Layer 4a-3 4a-6 1
Network layer service models: Routing Algorithm classification Global or decentralized Static or dynamic? Guarantees ? Network Service Congestion information? Static: Architecture Model Bandwidth Loss Order Timing feedback Global: � routes change slowly over � all routers have complete Internet best effort none no no no time no (inferred topology, link cost info via loss) Dynamic: � “link state” algorithms ATM CBR constant yes yes yes no � routes change more quickly Decentralized: rate congestion o periodic update � router knows physically- ATM VBR guaranteed yes yes yes no connected neighbors, link o in response to link cost rate congestion costs to neighbors changes guaranteed no ATM ABR yes no yes � iterative process of minimum computation, exchange of ATM UBR none no yes no no info with neighbors Constant BR, Variable BR, Available BR, Unspecified BR � “distance vector” algorithms � Internet model being extented: Intserv, Diffserv (later) Danny Dolev 4: Network Layer Danny Dolev 4: Network Layer 4a-10 4a-7 A Link-State Routing Algorithm Datagram or VC network: why? Internet ATM Dijkstra’s algorithm Notation: � data exchange among � evolved from telephony � net topology, link costs � c(i,j): link cost from node i computers known to all nodes � human conversation: to j. cost infinite if not o “elastic” service, no strict o accomplished via “link o strict timing, reliability direct neighbors timing req. state broadcast” requirements � “smart” end systems � D(v): current value of cost o all nodes have same info (computers) o need for guaranteed of path from source to � computes least cost paths o can adapt, perform service from one node (‘source”) to dest. V control, error recovery � “dumb” end systems all other nodes � p(v): predecessor node o simple inside network, o telephones o gives routing table for along path from source to complexity at “edge” that node o complexity inside v, that is next v � many link types � iterative: after k network o different characteristics � N: set of nodes whose iterations, know least cost o uniform service difficult path to k dest.’s least cost path definitively known Danny Dolev 4: Network Layer Danny Dolev 4: Network Layer 4a-11 4a-8 Routing Dijsktra’s Algorithm Routing protocol 1 Initialization: Goal: determine “good” path 5 2 N = {A} (sequence of routers) thru 3 for all nodes v 3 B C network from source to dest. 5 4 if v adjacent to A 2 5 then D(v) = c(A,v) A 2 1 F 3 6 else D(v) = infty Graph abstraction for 1 2 7 D E routing algorithms: 1 8 Loop � graph nodes are 9 find w not in N such that D(w) is a minimum routers 10 add w to N � “good” path: 11 update D(v) for all v adjacent to w and not in N: � graph edges are o typically means minimum 12 D(v) = min( D(v), D(w) + c(w,v) ) physical links cost path 13 /* new cost to v is either old cost to v or known o other def’s possible o link cost: delay, $ cost, 14 shortest path cost to w plus cost from w to v */ or congestion level 15 until all nodes in N Danny Dolev 4: Network Layer Danny Dolev 4: Network Layer 4a-12 4a-9 2
Dijkstra’s algorithm: example Distance Table: example Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) cost to destination via 1 B C E 0 2,A 5,A 1,A infinity A infinity D () A B D 7 1 AD 2,A 4,D 2,D infinity A 8 2 2 2,A 3,E ADE 4,E A 1 1 14 5 3 ADEB 3,E 4,E E D 2 4 ADEBC 4,E 5 B 8 ADEBCF 8 5 n E o D i D (C,D) t = c(E,D) + min {D (C,w)} a n w 5 i C 6 9 t 4 = 2+2 = 4 s e E d 3 D B C D (A,D) c(E,D) + min {D (A,w)} 5 = 2 D w 4 11 2 A = 2+3 = 5 2 F loop! 1 3 E B 1 D (A,B) c(E,B) + min {D (A,w)} = 2 D E w 1 = 8+6 = 14 loop! Danny Dolev 4: Network Layer 4a-13 Danny Dolev 4: Network Layer 4a-16 Dijkstra’s algorithm, discussion Distance table gives routing table Algorithm complexity: n nodes cost to destination via � each iteration: need to check all nodes, w, not in N E Outgoing link D () A B D � n*(n+1)/2 comparisons: O(n**2) to use, cost � more efficient implementations possible: O(nlogn) A 1 14 5 A A,1 Oscillations possible: � e.g., link cost = amount of carried traffic (in the example: the B 7 8 5 B D,5 injected traffic toward A) n n o o i i t a t a n n i C 6 i t 9 4 C D,4 s t s e e A A A d A d 1 1+e 2+e 0 0 2+e 2+e 0 D B D B D B D D 4 11 2 0 B D D,2 0 1+e 1 0 0 1+e 1 e 0 0 0 1 e 1+e 0 C C C C 1 1 Routing table Distance table e … recompute … recompute … recompute initially routing Danny Dolev 4: Network Layer 4a-14 Danny Dolev 4: Network Layer 4a-17 Distance Vector Routing Algorithm Distance Vector Routing: overview iterative: Iterative, asynchronous: Each node: Distance Table data structure each local iteration caused � continues until no by: nodes exchange info. � each node has its own � local link cost change � self-terminating : no � row for each possible destination wait for (change in local link “signal” to stop � message from neighbor: its � column for each directly- cost of msg from neighbor) least cost path change asynchronous: attached neighbor to node from neighbor � nodes need not � example: in node X, for dest. Y Distributed: exchange info/iterate via neighbor Z: recompute distance table � each node notifies in lock step! neighbors only when its distributed: least cost path to any � each node distance from X to if least cost path to any dest destination changes = communicates only with X Y, via Z as next hop has changed, notify neighbors then notify D (Y,Z) o directly-attached their neighbors if Z neighbors neighbors c(X,Z) + min {D (Y,w)} = necessary w Danny Dolev 4: Network Layer 4a-15 Danny Dolev 4: Network Layer 4a-18 3
Recommend
More recommend