Chapter 5 The Network Layer Network service model

  • Slides: 49
Download presentation
Chapter 5 The Network Layer

Chapter 5 The Network Layer

Network service model service abstraction Q: What service model for “channel” transporting packets from

Network service model service abstraction Q: What service model for “channel” transporting packets from sender to receiver? a) guaranteed bandwidth? b) preservation of inter-packet timing (no jitter)? c) loss-free delivery? d) in-order delivery? e) congestion feedback to sender? The most important abstraction provided by network layer: ? ? ? virtual circuit or datagram?

CO Service: Virtual circuits “source-to-dest path behaves much like telephone circuit” – – performance-wise

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

Virtual circuits: signaling protocols a) used to setup, maintain teardown VC b) used in

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

CL Service: Datagram (Internet) a) no call setup at network layer b) routers: no

CL Service: Datagram (Internet) a) no call setup at network layer b) routers: no state about end-to-end connections – no network-level concept of “connection” c) packets forwarded using destination host address – packets between same source-dest pair may take different paths application transport network data link 1. Send data physical application transport 2. Receive data network data link physical

Datagram or VC network: why? Internet ATM a) data exchange among computers a) evolved

Datagram or VC network: why? Internet ATM a) data exchange among computers a) evolved from telephony b) human conversation: – “elastic” service, no strict timing req. – b) “smart” end systems (computers) – – can adapt, perform control, error recovery simple inside network, complexity at “edge” – strict timing, reliability requirements need for guaranteed service c) “dumb” end systems – – telephones complexity inside network

Comparison of Virtual-Circuit and Datagram Subnets 5 -4

Comparison of Virtual-Circuit and Datagram Subnets 5 -4

Network Functions • • • Routing Congestion Control Internetworking

Network Functions • • • Routing Congestion Control Internetworking

Routing protocol 5 Goal: determine “good” path (sequence of routers) thru network from source

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

Routing Algorithm? • Routing? • Route discovery: source => destination • Data delivery: forwarding

Routing Algorithm? • Routing? • Route discovery: source => destination • Data delivery: forwarding • Routing Factors: routing decision • • Where? source, each node, centralized node How? static vs. dynamic (adaptive) When? virtual circuit vs. datagram Criteria? hop count, delay, cost, load, bandwidth

Routing Algorithm classification Global or decentralized information? Global: a) all routers have complete topology,

Routing Algorithm classification Global or decentralized information? Global: a) all routers have complete topology, link cost info b) “link state” algorithms Decentralized: a) router knows physically-connected neighbors, link costs to neighbors b) iterative process of computation, exchange of info with neighbors c) “distance vector” algorithms Static or dynamic? Static: a) routes change slowly over time Dynamic: a) routes change more quickly – periodic update – in response to link cost changes

The Optimality Principle (a) A subnet. (b) A sink tree for router B.

The Optimality Principle (a) A subnet. (b) A sink tree for router B.

Distance Vector Routing iterative: Distance Table data structure a) continues until no nodes exchange

Distance Vector Routing iterative: Distance Table data structure a) continues until no nodes exchange info. b) self-terminating: no “signal” to stop a) each node has its own b) row for each possible destination c) column for each directly-attached neighbor to node d) example: in node X, for dest. Y via neighbor Z: asynchronous: a) nodes need not exchange info/iterate in lock step! distributed: a) each node communicates only with directly-attached neighbors X D (Y, Z) distance from X to = Y, via Z as next hop Z = c(X, Z) + minw{D (Y, w)}

Distance Table: example A E D (C, D) D (A, D) E C E

Distance Table: example A E D (C, D) D (A, D) E C E cost to destination via D () A B D A 1 14 5 B 7 8 5 C 6 9 4 D 4 11 2 2 8 1 E B E 2 D D = c(E, D) + minw {D (C, w)} = 2+2 = 4 D = c(E, D) + minw {D (A, w)} = 2+3 = 5 loop! B D (A, B) = c(E, B) + minw{D (A, w)} = 8+6 = 14 loop! destination 7 1

Distance table gives routing table E cost to destination via Outgoing link to use,

Distance table gives routing table E cost to destination via Outgoing link to use, cost B D A 1 14 5 A A, 1 B 7 8 5 B D, 5 C 6 9 4 C D, 4 D 4 11 2 D D, 2 Distance table destination A destination D () Routing table

Distance Vector Routing: overview Iterative, asynchronous: each local iteration caused by: a) local link

Distance Vector Routing: overview Iterative, asynchronous: each local iteration caused by: a) local link cost change b) message from neighbor: its least cost path change from neighbor Distributed: a) each node notifies neighbors only when its least cost path to any destination changes – neighbors then notify their neighbors if necessary 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

Distance Vector Algorithm: At all nodes, X: 1 Initialization: 2 for all adjacent nodes

Distance Vector Algorithm: At all nodes, X: 1 Initialization: 2 for all adjacent nodes v: 3 DX(*, v) = infinity /* the * operator means "for all rows" */ X 4 D (v, v) = c(X, v) 5 for all destinations, y X 6 send min D (y, w) to each neighbor /* w over all X's neighbors */ w

Distance Vector Algorithm (cont. ): 8 loop 9 wait (until I see a link

Distance Vector 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: 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 min w DX(Y, w) to all neighbors 25 26 forever

Distance Vector Algorithm: example X 2 Y 7 1 Z

Distance Vector Algorithm: example X 2 Y 7 1 Z

Distance Vector Algorithm: example X 2 Y 7 1 Z Z X D (Y,

Distance Vector Algorithm: example X 2 Y 7 1 Z Z X D (Y, Z) = c(X, Z) + minw{D (Y, w)} = 7+1 = 8 Y X D (Z, Y) = c(X, Y) + minw {D (Z, w)} = 2+1 = 3

Distance Vector: link cost changes Link cost changes: a) node detects local link cost

Distance Vector: link cost changes Link cost changes: a) node detects local link cost change b) updates distance table (line 15) c) if cost change in least cost path, notify neighbors (lines 23, 24) “good news travels fast” 1 X 4 Y 50 1 Z algorithm terminates

Distance Vector: link cost changes Link cost changes: a) good news travels fast b)

Distance Vector: link cost changes Link cost changes: a) good news travels fast b) bad news travels slow - “count to infinity” problem! 60 X 4 Y 50 1 Z algorithm continues on!

Link State Routing Each router must do the following: a) Discover its neighbors, learn

Link State Routing Each router must do the following: a) Discover its neighbors, learn their network address. b) Measure the delay or cost to each of its neighbors. c) Construct a packet telling all it has just learned. d) Send this packet to all other routers. e) Compute the shortest path to every other router using Dijkstra’s Shortest Path Algorithm.

Dijkstra’s SPA Dijkstra’s algorithm a) net topology, link costs known to all nodes –

Dijkstra’s SPA Dijkstra’s algorithm a) net topology, link costs known to all nodes – – accomplished via “link state broadcast” all nodes have same info b) computes least cost paths from one node (‘source”) to all other nodes – gives routing table for that node c) iterative: after k iterations, know least cost path to k dest. ’s Notation: a) c(i, j): link cost from node i to j. cost infinite if not direct neighbors b) D(v): current value of cost of path from source to destination v c) p(v): predecessor node along path from source to v, that is next v d) N: set of nodes whose least cost path definitively known (permanent node set)

Dijsktra’s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v 4

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) = 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

Dijkstra’s algorithm: example Step 0 1 2 3 4 5 start N A AD

Dijkstra’s algorithm: example Step 0 1 2 3 4 5 start N A AD ADEBCF D(B), p(B) D(C), p(C) D(D), p(D) D(E), p(E) D(F), p(F) 2, A 1, A 5, A infinity 2, A 4, D 2, D infinity 2, A 3, E 4, E 5 2 A B 2 1 D 3 C 3 1 5 F 1 E 2

Dijkstra’s algorithm: discussion Algorithm complexity: n nodes a) each iteration: need to check all

Dijkstra’s algorithm: discussion Algorithm complexity: n nodes a) each iteration: need to check all nodes, w, not in N b) n*(n+1)/2 comparisons: O(n**2) c) more efficient implementations possible: O(nlogn) Oscillations possible: a) e. g. , link cost = amount of carried traffic D 1 1 0 A 0 0 C e 1+e e initially B 1 2+e A 0 D 1+e 1 B 0 0 C … recompute routing 0 D 1 A 0 0 C 2+e B 1+e … recompute 2+e A 0 D 1+e 1 B e 0 C … recompute

C Program 5 -8 top Dijkstra's algorithm to compute the shortest path through a

C Program 5 -8 top Dijkstra's algorithm to compute the shortest path through a graph.

C Program (2) 5 -8 bottom Dijkstra's algorithm to compute the shortest path through

C Program (2) 5 -8 bottom Dijkstra's algorithm to compute the shortest path through a graph.

Learning about the Neighbors (a) Nine routers and a LAN. (b) A graph model

Learning about the Neighbors (a) Nine routers and a LAN. (b) A graph model of (a).

Measuring Line Cost A subnet in which the East and West parts are connected

Measuring Line Cost A subnet in which the East and West parts are connected by two lines.

Building Link State Packets (a) A subnet. (b) The link state packets for this

Building Link State Packets (a) A subnet. (b) The link state packets for this subnet.

Distributing the Link State Packets The packet buffer for router B in the previous

Distributing the Link State Packets The packet buffer for router B in the previous slide (Fig. 5 -13).

Comparison of LS and DV algorithms Message complexity a) LS: with n nodes, E

Comparison of LS and DV algorithms Message complexity a) LS: with n nodes, E links, O(n. E) msgs sent each b) DV: exchange between neighbors only Robustness: what happens if router malfunctions? LS: – Speed of Convergence a) LS: O(n 2) algorithm requires O(n. E) msgs – may have oscillations b) DV: convergence time varies – – may be routing loops count-to-infinity problem – 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

Hierarchical Routing Hierarchical routing.

Hierarchical Routing Hierarchical routing.

Broadcast Routing Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The

Broadcast Routing Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The tree built by reverse path forwarding.

Multicast Routing (a) A network. (b) A spanning tree for the leftmost router. (c)

Multicast Routing (a) A network. (b) A spanning tree for the leftmost router. (c) A multicast tree for group 1. (d) A multicast tree for group 2.

Routing in the Internet a) The Global Internet consists of Autonomous Systems (AS) interconnected

Routing in the Internet a) The Global Internet consists of Autonomous Systems (AS) interconnected with each other: – – – b) Stub AS: small corporation: one connection to other AS’s Multihomed AS: large corporation (no transit): multiple connections to other AS’s Transit AS: provider, hooking many AS’s together Two-level routing: – – Intra-AS: administrator responsible for choice of routing algorithm within network Inter-AS: unique standard for inter-AS routing: BGP

Internet AS Hierarchy Inter-AS border (exterior gateway) routers Intra-AS interior (gateway) routers

Internet AS Hierarchy Inter-AS border (exterior gateway) routers Intra-AS interior (gateway) routers

Intra-AS Routing a) b) Also known as Interior Gateway Protocols (IGP) Most common Intra-AS

Intra-AS Routing a) b) Also known as Interior Gateway Protocols (IGP) Most common Intra-AS routing protocols: – RIP: Routing Information Protocol – OSPF: Open Shortest Path First – IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

RIP (Routing Information Protocol) a) b) c) Distance vector algorithm Included in BSD-UNIX Distribution

RIP (Routing Information Protocol) a) b) c) Distance vector algorithm Included in BSD-UNIX Distribution in 1982 Distance metric: # of hops (max = 15 hops) – d) e) Can you guess why? Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) Each advertisement: list of up to 25 destination nets within AS

RIP Table processing a) b) RIP routing tables managed by application-level process called route-d

RIP Table processing a) b) RIP routing tables managed by application-level process called route-d (daemon) advertisements sent in UDP packets, periodically repeated routed Transprt (UDP) network (IP) link physical Transprt (UDP) routing table network (IP) link physical

OSPF (Open Shortest Path First) a) b) “open”: publicly available Uses Link State algorithm

OSPF (Open Shortest Path First) a) b) “open”: publicly available Uses Link State algorithm – – – c) d) LS packet dissemination Topology map at each node Route computation using Dijkstra’s algorithm OSPF advertisement carries one entry per neighbor router Advertisements disseminated to entire AS (via flooding) – Carried in OSPF messages directly over IP (rather than TCP or UDP

OSPF “advanced” features (not in RIP) a) b) c) d) Security: all OSPF messages

OSPF “advanced” features (not in RIP) a) b) c) d) Security: all OSPF messages authenticated (to prevent malicious intrusion) Multiple same-cost paths allowed (only one path in RIP) For each link, multiple cost metrics for different TOS (e. g. , satellite link cost set “low” for best effort; high for real time) Integrated uni- and multicast support: – Multicast OSPF (MOSPF) uses same topology data base as OSPF e) Hierarchical OSPF in large domains.

Hierarchical OSPF

Hierarchical OSPF

Inter-AS routing in the Internet: BGP

Inter-AS routing in the Internet: BGP

Internet inter-AS routing: BGP a) b) BGP (Border Gateway Protocol): the de facto standard

Internet inter-AS routing: BGP a) b) BGP (Border Gateway Protocol): the de facto standard Path Vector protocol: – similar to Distance Vector protocol – each Border Gateway broadcast to neighbors (peers) entire path (i. e. , sequence of AS’s) to destination – BGP routes to networks (ASs), not individual hosts – E. g. , Gateway X may send its path to dest. Z: Path (X, Z) = X, Y 1, Y 2, Y 3, …, Z

BGP: controlling who routes to you a) b) c) A advertises to B the

BGP: controlling who routes to you a) b) c) A advertises to B the path AW B advertises to X the path BAW Should B advertise to C the path BAW? – – – No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers B wants to force C to route to w via A B wants to route only to/from its customers!

Why different Intra- and Inter-AS routing ? Policy: a) b) Inter-AS: admin wants control

Why different Intra- and Inter-AS routing ? Policy: a) b) Inter-AS: admin wants control over how its traffic routed, who routes through its net. Intra-AS: single admin, so no policy decisions needed Scale: a) hierarchical routing saves table size, reduced update traffic Performance: a) Intra-AS: can focus on performance b) Inter-AS: policy may dominate over performance