Chapter 4

A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). Computer They’re in PowerPoint form so you see the animations; and can add, modify, and delete slides (including this one) and slide content to suit your needs. Networking: A Top They obviously represent a lot of work on our part. In return for use, we only ask the following: Down Approach v If you use these slides (e.g., in a class) that you mention their source th (after all, we’d like people to use our book!) 6 edition v If you post any slides on a www site, that you note that they are adapted Jim Kurose, Keith Ross from (or perhaps identical to) our slides, and note our copyright of this Addison-Wesley material. March 2012 Thanks and enjoy! JFK/KWR

All material copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights Reserved

Network Layer 4-1 Chapter 4: outline

4.1 introduction 4.5 algorithms 4.2 and § link state datagram networks § distance vector 4.3 what’s inside a § hierarchical routing 4.4 IP: Protocol 4.6 routing in the Internet § datagram format § RIP § IPv4 addressing § OSPF § BGP § ICMP § IPv6 4.7 broadcast and routing

Network Layer 4-2 Interplay between routing, forwarding

routing algorithm determines routing algorithm end-end-path through network forwarding table determines local forwarding table local forwarding at this router dest address output link address-range 1 3 address-range 2 2 address-range 3 2 address-range 4 1

IP destination address in arriving packet’s header 1

3 2

Network Layer 4-3 Graph abstraction

5 v 3 w 2 5 u 2 1 z 3 1 x y 2 graph: G = (N,E) 1

N = set of routers = { u, v, w, x, y, z }

E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

aside: graph abstraction is useful in other network contexts, e.g., P2P, where N is set of peers and E is set of TCP connections

Network Layer 4-4 Graph abstraction: costs

5 c(x,x’) = cost of link (x,x’) v 3 w e.g., c(w,z) = 5 2 5 u cost could always be 1, or 2 1 z 3 inversely related to bandwidth, 1 x y 2 or inversely related to 1 congestion

cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)

key question: what is the least-cost path between u and z ? routing algorithm: algorithm that finds that least cost path

Network Layer 4-5 Routing algorithm classification

Q: global or decentralized Q: static or dynamic? information? static: global: v routes change slowly over v all routers have complete time topology, link cost info dynamic: v “ ” link state algorithms v routes change more decentralized: quickly v router knows physically- § periodic update connected neighbors, link § in response to link costs to neighbors cost changes v iterative process of computation, exchange of info with neighbors v “distance vector” algorithms

Network Layer 4-6 Chapter 4: outline

4.1 introduction 4.5 routing algorithms 4.2 virtual circuit and § link state datagram networks § distance vector 4.3 what’s inside a router § hierarchical routing 4.4 IP: 4.6 routing in the Internet § datagram format § RIP § IPv4 addressing § OSPF § BGP § ICMP § IPv6 4.7 broadcast and

Network Layer 4-7 A Link-State Routing Algorithm

Dijkstra’s algorithm notation: v net topology, link costs v c(x,y): link cost from known to all nodes node x to y; = ∞ if not § accomplished via “link state direct neighbors broadcast” v D(v): current value of § all nodes have same info cost of path from source v computes least cost paths to dest. v from one node (‘source”) v p(v): predecessor node to all other nodes along path from source to § gives forwarding table for v that node v N': set of nodes whose v iterative: after k least cost path definitively iterations, know least cost known path to k dest.’s

Network Layer 4-8 Dijsktra’s Algorithm

1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = ∞ 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'

Network Layer 4-9 Dijkstra’s algorithm: example D(v) D(w) D(x) D(y) D(z) Step N' p(v) p(w) p(x) p(y) p(z) 0 u 7,u 3,u 5,u ∞ ∞ 1 uw 6,w 5,u 11,w ∞ 2 uwx 6,w 11,w 14,x 3 uwxv 10,v 14,x 4 uwxvy 12,y 5 uwxvyz x 9 notes: 5 7 v construct shortest path tree by 4 tracing predecessor nodes 8 v ties can exist (can be broken u 3 w y z arbitrarily) 2 3 7 4 v Network Layer 4-10 Dijkstra’s algorithm: another example

Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z) 0 u 2,u 5,u 1,u ∞ ∞ 1 ux 2,u 4,x 2,x ∞ 2 uxy 2,u 3,y 4,y 3 uxyv 3,y 4,y 4 uxyvw 4,y 5 uxyvwz

5 v 3 w 2 5 u 2 1 z 3 1 x y 2 1

Network Layer 4-11 Dijkstra’s algorithm: example (2) resulting shortest-path tree from u:

v w u z

x y resulting forwarding table in u: destination link v (u,v) x (u,x) y (u,x) w (u,x) z (u,x) Network Layer 4-12 Dijkstra’s algorithm, discussion

algorithm complexity: n nodes v each iteration: need to check all nodes, w, not in N v n(n+1)/2 comparisons: O(n2) v more efficient implementations possible: O(nlogn) oscillations possible: v e.g., support link cost equals amount of carried traffic:

A 1 1+e A A A 2+e 0 0 2+e 2+e 0 D B D B D B D B 0 0 1+e 1 0 0 1+e 1 0 e 0 0 C C 0 1 C 1+e C 0 1 1 e given these costs, given these costs, given these costs, initially find new routing…. find new routing…. find new routing…. resulting in new costs resulting in new costs resulting in new costs Network Layer 4-13 Chapter 4: outline

4.1 introduction 4.5 routing algorithms 4.2 virtual circuit and § link state datagram networks § distance vector 4.3 what’s inside a router § hierarchical routing 4.4 IP: Internet Protocol 4.6 routing in the Internet § datagram format § RIP § IPv4 addressing § OSPF § BGP § ICMP § IPv6 4.7 broadcast and multicast routing

Network Layer 4-14 Distance vector algorithm

Bellman-Ford equation (dynamic programming)

let

dx(y) := cost of least-cost path from x to y then d (y) = min {c(x,v) + d (y) } x v v

cost from neighbor v to destination y cost to neighbor v

min taken over all neighbors v of x

Network Layer 4-15 Bellman-Ford example

5 clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3 v 3 w 2 5 u B-F equation says: 2 1 z 3 1 d (z) = min { c(u,v) + d (z), x y 2 u v 1 c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 node achieving minimum is next in shortest path, used in forwarding table

Network Layer 4-16 Distance vector algorithm v Dx(y) = estimate of least cost from x to y § x maintains distance vector Dx = [Dx(y): y є N ] v node x: § knows cost to each neighbor v: c(x,v) § maintains its neighbors’ distance vectors. For each neighbor v, x maintains Dv = [Dv(y): y є N ]

Network Layer 4-17 Distance vector algorithm

key idea: v from time-to-time, each node sends its own distance vector estimate to neighbors v when x receives new DV estimate from neighbor, it updates its own DV using B-F equation:

Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N v under minor, natural conditions, the estimate Dx(y) converge to the actual least cost dx(y)

Network Layer 4-18 Distance vector algorithm iterative, asynchronous: each node: each local iteration caused by: wait for (change in local link v local link cost change cost or msg from neighbor) v DV update message from neighbor distributed: recompute estimates v each node notifies neighbors only when its DV changes if DV to any dest has § neighbors then notify their changed, notify neighbors neighbors if necessary

Network Layer 4-19 Dx(z) = min{c(x,y) + Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3 node x cost to cost to table x y z x y z x 0 2 7 x 0 2 3 y y 2 0 1

∞ ∞ ∞ from from z ∞ ∞ ∞ z 7 1 0

node y cost to table x y z y 2 1 x ∞ ∞ ∞ x z y 2 0 1 7 from z ∞ ∞ ∞

node z cost to table x y z x ∞ ∞ ∞ y

from ∞ ∞ ∞ z 7 1 0 time Network Layer 4-20 Dx(z) = min{c(x,y) + Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3 node x cost to cost to cost to table x y z x y z x y z x 0 2 7 x 0 2 3 x 0 2 3 y y 2 0 1

∞ ∞ ∞ from y

from 2 0 1 z z from ∞ ∞ ∞ 7 1 0 z 3 1 0 node y cost to cost to cost to table x y z x y z x y z y 2 1 x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z y 2 0 1 y 2 0 1 y 7

from 2 0 1 from z ∞ ∞ ∞ z 7 1 0 from z 3 1 0

node z cost to cost to cost to table x y z x y z x y z x ∞ ∞ ∞ x 0 2 7 x 0 2 3 y y 2 0 1

y from 2 0 1 from

from ∞ ∞ ∞ z z z 7 1 0 3 1 0 3 1 0 time Network Layer 4-21 Distance vector: link cost changes

link cost changes: 1 v node detects local link cost change y 4 1 v updates routing info, recalculates x z distance vector 50 v if DV changes, notify neighbors

“good t0 : y detects link-cost change, updates its DV, informs its news neighbors. travels t1 : z receives update from y, updates its table, computes new fast” least cost to x , sends its neighbors its DV.

t2 : y receives z’s update, updates its distance table. y’s least costs do not change, so y does not send a message to z.

Network Layer 4-22 Distance vector: link cost changes link cost changes: 60 v node detects local link cost change y 4 1 v “ bad news travels slow - count to x z infinity” problem! 50 v 44 iterations before algorithm stabilizes: see text poisoned reverse: v If Z routes through Y to get to X : § Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) v will this completely solve count to infinity problem?

Network Layer 4-23 Comparison of LS and DV algorithms message complexity robustness: what happens if v LS: with n nodes, E links, O(nE) router malfunctions? msgs sent LS: v DV: exchange between neighbors § node can advertise incorrect only link cost § time varies § each node computes only its speed of convergence own table DV: v LS: O(n2) algorithm requires O(nE) msgs § DV node can advertise incorrect path cost § may have oscillations § each node’s table used by v DV: convergence time varies others § may be routing loops • error propagate thru § count-to-infinity problem network

Network Layer 4-24 Chapter 4: outline

4.1 introduction 4.5 routing algorithms 4.2 virtual circuit and § link state datagram networks § distance vector 4.3 what’s inside a router § hierarchical routing 4.4 IP: Internet Protocol 4.6 routing in the Internet § datagram format § RIP § IPv4 addressing § OSPF § BGP § ICMP § IPv6 4.7 broadcast and multicast routing

Network Layer 4-25 Hierarchical routing our routing study thus far - idealization v all routers identical v network “flat” … not true in practice scale: with 600 million administrative autonomy destinations: v internet = network of v can’t store all dest’s in networks routing tables! v each network admin may v exchange want to control routing in would swamp links! its own network

Network Layer 4-26 Hierarchical routing v aggregate routers into gateway router: regions, “autonomous v at “edge” of its own AS systems” (AS) v has link to router in v routers in same AS another AS run same § “intra-AS” routing protocol § routers in different AS can run different intra- AS routing protocol

Network Layer 4-27 Interconnected ASes

3c 3a 2c 3b 2a AS3 2b 1c AS2 1a 1b 1d AS1 v forwarding table configured by both intra- and inter-AS routing Intra-AS Inter-AS algorithm Routing Routing algorithm algorithm § intra-AS sets entries for internal dests Forwarding table § inter-AS & intra-AS sets entries for external dests

Network Layer 4-28 Inter-AS tasks

v suppose router in AS1 AS1 must: receives datagram 1. learn which dests are destined outside of AS1: reachable through AS2, § router should forward which through AS3 packet to gateway 2. propagate this router, but which one? reachability info to all routers in AS1 job of inter-AS routing!

3c 3a 3b AS3 2c other 1c 2a networks other 1a 2b networks 1b AS1 1d AS2

Network Layer 4-29 Example: setting forwarding table in router 1d

v suppose AS1 learns (via inter-AS protocol) that subnet x reachable via AS3 (gateway 1c), but not via AS2 § inter-AS protocol propagates reachability info to all internal routers v router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c § installs forwarding table entry (x,I)

3c … x 3a 3b AS3 2c other 1c 2a networks other 1a 2b networks 1b AS1 1d AS2

Network Layer 4-30 Example: choosing among multiple ASes v now suppose AS1 learns from inter-AS protocol that subnet x is reachable from AS3 and from AS2. v to configure forwarding table, router 1d must determine which gateway it should forward packets towards for dest x § this is also job of inter-AS routing protocol!

x 3c … …… 3a 3b AS3 2c other 1c 2a networks other 1a 2b networks 1b AS1 1d AS2 ? Network Layer 4-31 Example: choosing among multiple ASes

v now suppose AS1 learns from inter-AS protocol that subnet x is reachable from AS3 and from AS2. v to configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x § this is also job of inter-AS routing protocol! v hot potato routing: send packet towards closest of two routers.

use routing info determine from learn from inter-AS from intra-AS hot potato routing: forwarding table the protocol that subnet choose the gateway protocol to determine interface I that leads x is reachable via that has the costs of least-cost to least-cost gateway. multiple gateways smallest least cost paths to each Enter (x,I) in of the gateways forwarding table

Network Layer 4-32 Chapter 4: outline

4.1 introduction 4.5 routing algorithms 4.2 virtual circuit and § link state datagram networks § distance vector 4.3 what’s inside a router § hierarchical routing 4.4 IP: Internet Protocol 4.6 routing in the Internet § datagram format § RIP § IPv4 addressing § OSPF § BGP § ICMP § IPv6 4.7 broadcast and multicast routing

Network Layer 4-33 Intra-AS Routing v also known as interior gateway protocols (IGP) v most common intra-AS routing protocols: § RIP: Routing Information Protocol § OSPF: § IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

Network Layer 4-34 RIP ( Routing Information Protocol) v included in BSD-UNIX distribution in 1982 v distance vector algorithm § distance metric: # hops (max = 15 hops), each link has cost 1 § DVs exchanged with neighbors every 30 sec in response message (aka advertisement) § each advertisement: list of up to 25 destination subnets (in IP addressing sense)

from router A to destination subnets: u v subnet hops A B w u 1 v 2 w 2 x x 3 z C D y 3 y z 2

Network Layer 4-35 RIP: example

z w x y A D B

C

routing table in router D destination subnet next router # hops to dest w A 2 y B 2 z B 7 x -- 1 …. …. ....

Network Layer 4-36 RIP: example A-to-D advertisement dest next hops w - 1 x - 1 z C 4 …. … ... z w x y A D B

C routing table in router D destination subnet next router # hops to dest w A 2 y B 2 A 5 z B 7 x -- 1 …. …. ....

Network Layer 4-37 RIP: link failure, recovery if no advertisement heard after 180 sec --> neighbor/link declared dead § routes via neighbor invalidated § new advertisements sent to neighbors § neighbors in turn send out new advertisements (if tables changed) § link failure info quickly (?) propagates to entire net § poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)

Network Layer 4-38 RIP table processing v RIP routing tables managed by application-level process called route-d (daemon) v advertisements sent in UDP packets, periodically repeated

routed routed

transport transprt (UDP) (UDP) network forwarding forwarding network (IP) table table (IP) link link physical physical

Network Layer 4-39 OSPF (Open Shortest Path First) v “open”: publicly available v uses link state algorithm § LS packet dissemination § topology map at each node § route computation using Dijkstra’s algorithm v OSPF advertisement carries one entry per neighbor v advertisements flooded to entire AS § carried in OSPF messages directly over IP (rather than TCP or UDP v IS-IS routing protocol: nearly identical to OSPF

Network Layer 4-40 OSPF “advanced” features (not in RIP) v security: all OSPF messages authenticated (to prevent malicious intrusion) v multiple same-cost paths allowed (only one path in RIP) v for each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort ToS; high for real time ToS) v integrated uni- and multicast support: § Multicast OSPF (MOSPF) uses same topology data base as OSPF v hierarchical OSPF in large domains.

Network Layer 4-41 Hierarchical OSPF

boundary router backbone router

backbone area border routers

area 3

internal routers area 1 area 2

Network Layer 4-42 Hierarchical OSPF v two-level hierarchy: local area, backbone. § link-state advertisements only in area § each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. v area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. v backbone routers: run OSPF routing limited to backbone. v boundary routers: connect to other AS’s.

Network Layer 4-43 Internet inter-AS routing: BGP v BGP (): the de facto inter-domain routing protocol § “glue that holds the Internet together” v BGP provides each AS a means to: § eBGP: obtain subnet reachability information from neighboring ASs. § iBGP: propagate reachability information to all AS- internal routers. § determine “good” routes to other networks based on reachability information and policy. v allows subnet to advertise its existence to rest of Internet: “I am here”

Network Layer 4-44 BGP basics

v BGP session: two BGP routers (“peers”) exchange BGP messages: § advertising paths to different destination network prefixes (“path vector” protocol) § exchanged over semi-permanent TCP connections

v when AS3 advertises a prefix to AS1: § AS3 promises it will forward datagrams towards that prefix § AS3 can aggregate prefixes in its advertisement

3c 3a BGP 3b message AS3 2c other 1c 2a networks other 1a 2b networks 1b AS1 1d AS2

Network Layer 4-45 BGP basics: distributing path information

v using eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. § 1c can then use iBGP do distribute new prefix info to all routers in AS1 § 1b can then re-advertise new reachability info to AS2 over 1b-to- 2a eBGP session v when router learns of new prefix, it creates entry for prefix in its forwarding table.

eBGP session 3a 3b iBGP session AS3 2c other 1c 2a networks other 1a 2b networks 1b AS1 1d AS2

Network Layer 4-46 Path attributes and BGP routes

v advertised prefix includes BGP attributes § prefix + attributes = “route” v two important attributes: § AS-PATH: contains ASs through which prefix advertisement has passed: e.g., AS 67, AS 17 § NEXT-HOP: indicates specific internal-AS router to next- hop AS. (may be multiple links from current AS to next- hop-AS) v gateway router receiving route advertisement uses import policy to accept/decline § e.g., never route through AS x § policy-based routing

Network Layer 4-47 BGP route selection v router may learn about more than 1 route to destination AS, selects route based on: 1. local preference value attribute: policy decision 2. shortest AS-PATH 3. closest NEXT-HOP router: hot potato routing 4. additional criteria

Network Layer 4-48 BGP messages v BGP messages exchanged between peers over TCP connection v BGP messages: § OPEN: opens TCP connection to peer and authenticates sender § UPDATE: advertises new path (or withdraws old) § KEEPALIVE: keeps connection alive in absence of UPDATES; also ACKs OPEN request § NOTIFICATION: reports errors in previous msg; also used to close connection

Network Layer 4-49 BGP routing policy

legend: provider B network X W A customer C network:

Y v A,B,C are provider networks v X,W,Y are customer (of provider networks) v X is dual-homed: attached to two networks § X does not want to route from B via X to C § .. so X will not advertise to B a route to C

Network Layer 4-50 BGP routing policy (2)

legend: provider B network X W A customer C network:

Y v A advertises path AW to B v B advertises path BAW to X v Should B advertise path BAW to C? § 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!

Network Layer 4-51 Why different Intra-, Inter-AS routing ? policy: v inter-AS: admin wants control over how its traffic routed, who routes through its net. v intra-AS: single admin, so no policy decisions needed scale: v hierarchical routing saves table size, reduced update traffic performance: v intra-AS: can focus on performance v inter-AS: policy may dominate over performance

Network Layer 4-52 Chapter 4: outline

4.1 introduction 4.5 routing algorithms 4.2 virtual circuit and § link state datagram networks § distance vector 4.3 what’s inside a router § hierarchical routing 4.4 IP: Internet Protocol 4.6 routing in the Internet § datagram format § RIP § IPv4 addressing § OSPF § BGP § ICMP § IPv6 4.7 broadcast and multicast routing

Network Layer 4-53 Broadcast routing v deliver packets from source to all other nodes v source duplication is inefficient:

duplicate duplicate R1 creation/transmission R1

duplicate R2 R2

R3 R4 R3 R4

source in-network duplication duplication v source duplication: how does source determine recipient addresses?

Network Layer 4-54 In-network duplication v flooding: when node receives broadcast packet, sends copy to all neighbors § problems: cycles & broadcast storm v controlled flooding: node only broadcasts pkt if it hasn’t broadcast same packet before § node keeps track of packet ids already broadacsted § or reverse path forwarding (RPF): only forward packet if it arrived on shortest path between node and source v spanning tree: § no redundant packets received by any node

Network Layer 4-55 Spanning tree v first construct a spanning tree v nodes then forward/make copies only along spanning tree

A A

B B c c

D D F E F E

G G (a) broadcast initiated at A (b) broadcast initiated at D

Network Layer 4-56 Spanning tree: creation v center node v each node sends join message to center node § message forwarded until it arrives at a node already belonging to spanning tree

A A 3 B B c c 4 2 D D F E F E 1 5 G G (a) stepwise construction of (b) constructed spanning spanning tree (center: E) tree

Network Layer 4-57 Multicast routing: problem statement goal: find a tree (or trees) connecting routers having local mcast group members legend v tree: not all paths between routers used group member v shared-tree: same tree used by all group members not group v source-based: different tree from each sender to rcvrs member router with a group member router without group member

shared tree source-based trees

Network Layer 4-58 Approaches for building mcast trees approaches: v source-based tree: one tree per source § shortest path trees § reverse path forwarding v group-shared tree: group uses one tree § minimal spanning (Steiner) § center-based trees

…we first look at basic approaches, then specific protocols adopting these approaches

Network Layer 4-59 Shortest path tree v mcast forwarding tree: tree of shortest path routes from source to all receivers § Dijkstra’s algorithm

s: source LEGEND R1 2 router with attached R4 1 group member

R2 5 router with no attached 3 4 group member R5 link used for forwarding, 6 i R3 i indicates order link R6 R7 added by algorithm

Network Layer 4-60 Reverse path forwarding

v rely on router’s knowledge of unicast shortest path from it to sender v each router has simple forwarding behavior:

if (mcast datagram received on incoming link on shortest path back to center) then flood datagram onto all outgoing links else ignore datagram

Network Layer 4-61 Reverse path forwarding: example

s: source LEGEND R1 R4 router with attached group member R2 router with no attached R5 group member R3 datagram will be forwarded R6 R7 datagram will not be forwarded

v result is a source-specific reverse SPT § may be a bad choice with asymmetric links

Network Layer 4-62 Reverse path forwarding: pruning v forwarding tree contains subtrees with no mcast group members § no need to forward datagrams down subtree § “prune” msgs sent upstream by router with no downstream group members s: source LEGEND R1 R4 router with attached group member R2 P router with no attached R5 group member P R3 P prune message R6 links with multicast R7 forwarding

Network Layer 4-63 Shared-tree: steiner tree v steiner tree: minimum cost tree connecting all routers with attached group members v problem is NP-complete v excellent heuristics exists v not used in practice: § computational complexity § information about entire network needed § monolithic: rerun whenever a router needs to join/leave

Network Layer 4-64 Center-based trees v single delivery tree shared by all v one router identified as “center” of tree v to join: § edge router sends unicast join-msg addressed to center router § join-msg “processed” by intermediate routers and forwarded towards center § join-msg either hits existing tree branch for this center, or arrives at center § path taken by join-msg becomes new branch of tree for this router

Network Layer 4-65 Center-based trees: example suppose R6 chosen as center:

LEGEND

R1 router with attached R4 3 group member R2 router with no attached 2 group member 1 R5 path order in which join messages generated R3 1 R6 R7

Network Layer 4-66 Internet Multicasting Routing: DVMRP v DVMRP: distance vector multicast routing protocol, RFC1075 v flood and prune: reverse path forwarding, source- based tree § RPF tree based on DVMRP’s own routing tables constructed by communicating DVMRP routers § no assumptions about underlying unicast § initial datagram to mcast group flooded everywhere via RPF § routers not wanting group: send upstream prune msgs

Network Layer 4-67 DVMRP: continued… v soft state: DVMRP router periodically (1 min.) “forgets” branches are pruned: § mcast data again flows down unpruned branch § downstream router: reprune or else continue to receive data v routers can quickly regraft to tree § following IGMP join at leaf v odds and ends § commonly implemented in commercial router

Network Layer 4-68 Tunneling

Q: how to connect “islands” of multicast routers in a “sea” of unicast routers?

physical topology logical topology v mcast datagram encapsulated inside “normal” (non- multicast-addressed) datagram v normal IP datagram sent thru “tunnel” via regular IP unicast to receiving mcast router (recall IPv6 inside IPv4 tunneling) v receiving mcast router unencapsulates to get mcast datagram Network Layer 4-69 PIM: Protocol Independent Multicast v not dependent on any specific underlying unicast routing algorithm (works with all) v two different multicast distribution scenarios :

dense: sparse: v group members densely v # networks with group packed, in “close” members small wrt # proximity. interconnected networks v bandwidth more plentiful v group members “widely dispersed” v bandwidth not plentiful

Network Layer 4-70 Consequences of sparse-dense dichotomy:

dense sparse: v group membership by v no membership until routers routers assumed until explicitly join routers explicitly prune v receiver- driven construction v data-driven construction on of mcast tree (e.g., center- mcast tree (e.g., RPF) based) v bandwidth and non-group- v bandwidth and non-group- router processing profligate router processing conservative

Network Layer 4-71 PIM- dense mode flood-and-prune RPF: similar to DVMRP but… v underlying unicast protocol provides RPF info for incoming datagram v less complicated (less efficient) downstream flood than DVMRP reduces reliance on underlying routing algorithm v has protocol mechanism for router to detect it is a leaf-node router

Network Layer 4-72 PIM - sparse mode v center-based approach v router sends join msg to R1 R4 rendezvous point (RP) join § intermediate routers R2 update state and join forward join R5 join v after joining via RP, router R3 can switch to source- R6 specific tree all data multicast R7 § increased rendezvous from rendezvous point performance: less point concentration, shorter paths

Network Layer 4-73 PIM - sparse mode sender(s): R1 v unicast data to RP, R4 which distributes join R2 down RP-rooted tree join v RP can extend mcast R5 join tree upstream to R3 source R6 R7 v RP can send stop msg all data multicast rendezvous if no attached from rendezvous point receivers point § “no one is listening!”

Network Layer 4-74 Chapter 4: done!

4.1 introduction 4.5 routing algorithms 4.2 virtual circuit and § link state, distance vector, datagram networks hierarchical routing 4.3 what’s inside a router 4.6 routing in the Internet § RIP, OSPF, BGP 4.4 IP: Internet Protocol § datagram format, IPv4 4.7 broadcast and multicast addressing, ICMP, IPv6 routing

v understand principles behind network layer services: § network layer service models, forwarding versus routing how a router works, routing (path selection), broadcast, multicast v instantiation, implementation in the Internet

Network Layer 4-75