Chapter 4 Network Layerusers.cis.fiu.edu/~pand/tcn5030/lec09.pdf4.7 broadcast and multicast routing...

Post on 05-Dec-2020

4 views 0 download

Transcript of Chapter 4 Network Layerusers.cis.fiu.edu/~pand/tcn5030/lec09.pdf4.7 broadcast and multicast routing...

Chapter 4Network Layer

Computer Networking: A Top Down Approach

6th edition Jim Kurose, Keith Ross

Addison-WesleyMarch 2012

Network Layer 4-1

Slides adopted from original ones provided by the textbook authors.

Network Layer 4-2

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Network Layer 4-3

Router architecture overviewtwo key router functions:v run routing algorithms/protocol (RIP, OSPF, BGP)v forwarding datagrams from incoming to outgoing link

high-seed switching

fabric

routing processor

router input ports router output ports

forwarding data plane (hardware)

routing, managementcontrol plane (software)

forwarding tables computed,pushed to input ports

Network Layer 4-4

Switching fabricsv transfer packet from input buffer to appropriate

output bufferv switching rate: rate at which packets can be

transfer from inputs to outputs§ often measured as multiple of input/output line rate§ N inputs: switching rate N times line rate desirable

v three types of switching fabrics

memory

memory

bus crossbar

Network Layer 4-5

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Network Layer 4-6

ver length

32 bits

data (variable length,typically a TCP

or UDP segment)

16-bit identifierheader

checksumtime to

live

32 bit source IP address

head.len

type ofservice

flgs fragmentoffset

upperlayer

32 bit destination IP address

options (if any)

IP datagram formatIP protocol version

numberheader length

(bytes)

upper layer protocolto deliver payload to

total datagramlength (bytes)

“type” of data forfragmentation/reassemblymax number

remaining hops(decremented at

each router)

e.g. timestamp,record routetaken, specifylist of routers to visit.

how much overhead?v 20 bytes of TCPv 20 bytes of IPv = 40 bytes + app

layer overhead

Network Layer 4-7

IP fragmentation, reassembly

v network links have MTU (max.transfer size) -largest possible link-level frame§ different link types,

different MTUs v large IP datagram divided

(“fragmented”) within net§ one datagram becomes

several datagrams§ “reassembled” only at

final destination§ IP header bits used to

identify, order related fragments

fragmentation:in: one large datagramout: 3 smaller datagrams

reassembly

Network Layer 4-8

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

IPv4 Addressing

v Classful addressing§ Fixed subnet/host address length§ Inflexible

v CIDR: Classless InterDomain Routing§ subnet portion of address of arbitrary length§ address format: a.b.c.d/x, where x is # bits in

subnet portion of address

9

Network Layer 4-10

DHCP: Dynamic Host Configuration Protocol

goal: allow host to dynamically obtain its IP address from network server when it joins network§ can renew its lease on address in use§ allows reuse of addresses (only hold address while

connected/“on”)§ support for mobile users who want to join network (more

shortly)DHCP overview:

§ host broadcasts “DHCP discover” msg [optional]§ DHCP server responds with “DHCP offer” msg [optional]§ host requests IP address: “DHCP request” msg§ DHCP server sends address: “DHCP ack” msg

Network Layer 4-11

implementation: NAT router must:

§ outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #). . . remote clients/servers will respond using (NAT IP

address, new port #) as destination addr

§ remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair

§ incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table

NAT: network address translation

Network Layer 4-12

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Network Layer 4-13

ICMP: internet control message protocol

v used by hosts & routers to communicate network-level information§ error reporting: unreachable host, network, port, protocol§ echo request/reply (used by ping)

v ICMP message: type, code plus first 8 bytes of IP datagram causing error

v Case study: traceroute implementation§ source sends series of UDP segments to dest with TTL set to n§ nth router sends source ICMP messages (type 11, code 0)

Network Layer 4-14

IPv6 datagram formatv initial motivation: 32-bit address space soon to be

completely allocated. v additional motivation:

§ header format helps speed processing/forwarding§ header changes to facilitate QoS

data

destination address(128 bits)

source address(128 bits)

payload len next hdr hop limitflow labelpriver

32 bits

Network Layer 4-15

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Network Layer 4-16

u

yx

wv

z2

21

3

1

1

2

53

5

graph: G = (N,E)

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

Graph abstraction

Network Layer 4-17

Graph abstraction: costs

u

yx

wv

z2

21

3

1

1

2

53

5 c(x,x’) = cost of link (x,x’)e.g., c(w,z) = 5

cost could always be 1, or inversely related to bandwidth,or inversely related to 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-18

Routing algorithm classification

Q: global or decentralized information?

global:v all routers have complete

topology, link cost infov “link state” algorithmsdecentralized: v router knows physically-

connected neighbors, link costs to neighbors

v iterative process of computation, exchange of info with neighbors

v “distance vector” algorithms

Q: static or dynamic?static:v routes change slowly over

timedynamic: v routes change more

quickly§ periodic update§ in response to link

cost changes

Network Layer 4-19

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Network Layer 4-20

A Link-State Routing Algorithm

Dijkstra’s algorithmv net topology, link costs

known to all nodes§ accomplished via “link state

broadcastӤ all nodes have same info

v computes least cost paths from one node (‘source”) to all other nodes§ gives forwarding table for

that nodev iterative: after k

iterations, know least cost path to k dest.’s

notation:v c(x,y): link cost from

node x to y; = ∞ if not direct neighbors

v D(v): current value of cost of path from source to dest. v

v p(v): predecessor node along path from source to v

v N': set of nodes whose least cost path definitively known

Network Layer 4-21

w3

4

v

x

u

5

37 4

y

8

z2

7

9

Dijkstra’s algorithm: example

Step N'D(v)

p(v)012345

D(w)p(w)

D(x)p(x)

D(y)p(y)

D(z)p(z)

u ∞ ∞ 7,u 3,u 5,uuw ∞ 11,w6,w 5,u

14,x 11,w 6,wuwxuwxv 14,x 10,v

uwxvy 12,y

notes:v construct shortest path tree by

tracing predecessor nodesv ties can exist (can be broken

arbitrarily)

uwxvyz

Network Layer 4-22

Dijsktra’s Algorithm1 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 Loop9 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-23

Dijkstra’s algorithm: another example

Step012345

N'u

uxuxy

uxyvuxyvw

uxyvwz

D(v),p(v)2,u2,u2,u

D(w),p(w)5,u4,x3,y3,y

D(x),p(x)1,u

D(y),p(y)∞

2,x

D(z),p(z)∞ ∞

4,y4,y4,y

u

yx

wv

z2

21

3

1

1

2

53

5

Network Layer 4-24

Dijkstra’s algorithm: example (2)

u

yx

wv

z

resulting shortest-path tree from u:

vxywz

(u,v)(u,x)

(u,x)(u,x)(u,x)

destination link

resulting forwarding table in u:

Network Layer 4-25

Dijkstra’s algorithm, discussionalgorithm complexity: n nodesv each iteration: need to check all nodes, w, not in Nv 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:

AD

C

B1 1+e

e0

e1 1

0 0

initially

AD

C

B

given these costs,find new routing….

resulting in new costs

2+e 0

001+e 1

AD

C

B

given these costs,find new routing….

resulting in new costs

0 2+e

1+e10 0

AD

C

B

given these costs,find new routing….

resulting in new costs

2+e 0

001+e 1

Network Layer 4-26

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Network Layer 4-27

Distance vector algorithm

Bellman-Ford equation (dynamic programming)

letdx(y) := cost of least-cost path from x to y

thendx(y) = min {c(x,v) + dv(y) }

v

cost to neighbor v

min taken over all neighbors v of x

cost from neighbor v to destination y

Network Layer 4-28

Bellman-Ford example

u

yx

wv

z2

21

3

1

1

2

53

5clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3

du(z) = min { c(u,v) + dv(z),c(u,x) + dx(z),c(u,w) + dw(z) }

= min {2 + 5,1 + 3,5 + 3} = 4

node achieving minimum is nexthop in shortest path, used in forwarding table

B-F equation says:

Network Layer 4-29

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-30

key idea:v from time-to-time, each node sends its own

distance vector estimate to neighborsv 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)

Distance vector algorithm

Network Layer 4-31

x y zxyz

0 2 7∞ ∞ ∞∞ ∞ ∞

from

cost to

from

from

x y zxyz

0

x y zxyz

∞ ∞

∞ ∞ ∞

cost to

x y zxyz

∞ ∞ ∞7 1 0

cost to

∞2 0 1

∞ ∞ ∞

2 0 17 1 0

time

x z12

7

y

node xtable

Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}= min{2+0 , 7+1} = 2

Dx(z) = min{c(x,y) +Dy(z), c(x,z) + Dz(z)}

= min{2+1 , 7+0} = 3

32

node ytable

node ztable

cost to

from

Network Layer 4-32

x y zxyz

0 2 3

from

cost to

x y zxyz

0 2 7

from

cost tox y z

xyz

0 2 3

from

cost to

x y zxyz

0 2 3fro

mcost to

x y zxyz

0 2 7

from

cost to

2 0 17 1 0

2 0 13 1 0

2 0 13 1 0

2 0 1

3 1 02 0 1

3 1 0

time

x y zxyz

0 2 7∞ ∞ ∞∞ ∞ ∞

from

cost to

from

from

x y zxyz

0

x y zxyz

∞ ∞

∞ ∞ ∞

cost to

x y zxyz

∞ ∞ ∞7 1 0

cost to

∞2 0 1

∞ ∞ ∞

2 0 17 1 0

time

x z12

7

y

node xtable

Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}= min{2+0 , 7+1} = 2

Dx(z) = min{c(x,y) +Dy(z), c(x,z) + Dz(z)}

= min{2+1 , 7+0} = 3

32

node ytable

node ztable

cost to

from

Network Layer 4-33

iterative, asynchronous:each local iteration caused by:

v local link cost change v DV update message from

neighbordistributed:v each node notifies

neighbors only when its DV changes§ neighbors then notify their

neighbors if necessary

wait for (change in local link cost or msg from neighbor)

recompute estimates

if DV to any dest has changed, notify neighbors

each node:

Distance vector algorithm

Network Layer 4-34

Distance vector: link cost changes

link cost changes:v node detects local link cost change v updates routing info, recalculates

distance vectorv if DV changes, notify neighbors

“goodnews travelsfast”

x z14

50

y1

t0 : y detects link-cost change, updates its DV, informs its neighbors.

t1 : z receives update from y, updates its table, computes new 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-35

Distance vector: link cost changes

link cost changes:v node detects local link cost change v bad news travels slow - “count to

infinity” problem!v 44 iterations before algorithm

stabilizes: see text

x z14

50

y60

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)

Network Layer 4-36

Comparison of LS and DV algorithms

message complexityv LS: with n nodes, E links, O(nE)

msgs sent v DV: exchange between neighbors

only§ convergence time varies

speed of convergencev LS: O(n2) algorithm requires

O(nE) msgs§ may have oscillations

v DV: convergence time varies§ may be routing loops§ count-to-infinity problem

robustness: what happens if router malfunctions?

LS:§ node can advertise incorrect

link cost§ each node computes only its

own tableDV:

§ DV node can advertise incorrect path cost

§ each node’s table used by others

• error propagate thru network

Network Layer 4-37

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Network Layer 4-38

Hierarchical routing

scale: with 600 million destinations:

v can’t store all dest’s in routing tables!

v routing table exchange would swamp links!

administrative autonomyv internet = network of

networksv each network admin may

want to control routing in its own network

our routing study thus far - idealization v all routers identicalv network “flat”… not true in practice

Network Layer 4-39

v aggregate routers into regions, “autonomous systems” (AS)

v routers in same AS run same routing protocol§ “intra-AS” routing

protocol§ routers in different AS

can run different intra-AS routing protocol

gateway router:v at “edge” of its own ASv has link to router in

another AS

Hierarchical routing

Network Layer 4-40

3b

1d

3a

1c2aAS3

AS1AS2

1a

2c2b

1b

Intra-ASRouting algorithm

Inter-ASRouting algorithm

Forwardingtable

3c

Interconnected ASes

v forwarding table configured by both intra-and inter-AS routing algorithm§ intra-AS sets entries

for internal dests§ inter-AS & intra-AS

sets entries for external dests

Network Layer 4-41

Inter-AS tasksv suppose router in AS1

receives datagram destined outside of AS1:§ router should forward

packet to gateway router, but which one?

AS1 must:1. learn which dests are

reachable through AS2, which through AS3

2. propagate this reachability info to all routers in AS1

job of inter-AS routing!

AS3

AS2

3b

3c3a

AS1

1c1a

1d1b

2a2c

2bothernetworks

othernetworks

Network Layer 4-42

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Network Layer 4-43

Intra-AS Routing

v also known as interior gateway protocols (IGP)v most common intra-AS routing protocols:

§ RIP: Routing Information Protocol§ OSPF: Open Shortest Path First§ IGRP: Interior Gateway Routing Protocol

(Cisco proprietary)

Network Layer 4-44

RIP ( Routing Information Protocol)

v included in BSD-UNIX distribution in 1982v 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)

DC

BAu v

w

x

yz

subnet hopsu 1v 2w 2x 3y 3z 2

from router A to destination subnets:

Network Layer 4-45

RIP: example

destination subnet next router # hops to destw A 2y B 2z B 7x -- 1…. …. ....

routing table in router D

w x yz

A

C

D B

Network Layer 4-46

w x yz

A

C

D B

destination subnet next router # hops to destw A 2y B 2z B 7x -- 1…. …. ....

routing table in router D

A 5

dest next hopsw - 1x - 1z C 4…. … ...

A-to-D advertisement

RIP: example

Network Layer 4-47

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

Network Layer 4-48

OSPF “advanced” features (not in RIP)

v security: all OSPF messages authenticated (to prevent malicious intrusion)

v ECMP: equal cost multiple 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 OSPFv hierarchical OSPF in large domains.

Network Layer 4-49

Hierarchical OSPFboundary router

backbone router

area 1area 2

area 3

backboneareaborderrouters

internalrouters

Network Layer 4-50

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.

Hierarchical OSPF

Network Layer 4-51

Internet inter-AS routing: BGP

v BGP (Border Gateway Protocol): 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 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-52

BGP basics

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

AS3

AS2

3b

3c3a

AS1

1c1a

1d1b

2a2c

2bothernetworks

othernetworks

v BGP session: two BGP routers (“peers”) exchange BGP messages:§ advertising paths to different destination network prefixes (“path

vector” protocol)

BGP message

Network Layer 4-53

BGP basics: distributing path information

AS3

AS2

3b3a

AS1

1c1a

1d1b

2a2c

2bothernetworks

othernetworks

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 boundary

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

iBGP session

Network Layer 4-54

Path attributes and BGP routesv 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-55

BGP route selectionv router may learn about more than 1 route to

destination AS, selects route based on:1. local preference value attribute: policy decision2. shortest AS-PATH 3. closest NEXT-HOP router: hot potato routing4. additional criteria

Example

v Consider the network shown below. Suppose AS3 and AS2 are running OSPF for their intra-AS routing protocol. Suppose AS1 and AS4 are running RIP for their intra-AS routing protocol. Suppose E-BGP and I-BGP are used for the inter-AS routing protocol. Initially suppose there is no physical link between AS2 and AS4.

v a. Router 3c learns about prefix x from which routing protocol: OSPF, RIP, E-BGP, or I-BGP?

v b. How about 3a, 1c, and 1d.

56

Example

v Referring to the previous network, once router 1d learns about x it will put an entry (x, I) in its forwarding table.

v a. Will I be equal to I1 or I2 for this entry? v b. Now suppose that there is a physical link between AS2

and AS4, shown by the dotted line. Suppose router 1d learns that x is accessible via AS2 as well as via AS3. Will…?

v c. Now suppose there is another AS, called AS5, which lies on the path between AS2 and AS4. Suppose router 1d learns that x is accessible via AS2 AS5 AS4 as well as via AS3 AS4. Will…?

57

Network Layer 4-58

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format§ IPv4 addressing§ ICMP§ IPv6

4.5 routing algorithms§ link state§ distance vector§ hierarchical routing

4.6 routing in the Internet§ RIP§ OSPF§ BGP

4.7 broadcast and multicast routing

Chapter 4: outline

Multicast and broadcast

Network Layer 4-59

R1

R2

R3 R4

sourceduplication

R1

R2

R3 R4

in-networkduplication

duplicatecreation/transmissionduplicate

duplicate

v Multicast - one to many transmission§ Special case: broadcast - one to all transmission§ Solutions to both are similar

v source duplication is inefficient:

Network Layer 4-60

Broadcast: 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 sourcev spanning tree:

§ no redundant packets received by any node

61

B

A

S EF

H

J

D

C

G

IK

M

N

L

Node S is the broadcast source.

Broadcast: controlled flooding

62

B

A

S EF

H

J

D

C

G

IK

M

N

L

To avoid forwarding the same packet multiple times(forming a loop), each node remembers the received packet id.- Second copy received by E from C is discarded- Second copy received by C from E is discarded as well - Node H receives two copies from two neighbors, and will discard one of them

Broadcast: controlled flooding

Network Layer 4-63

A

B

G

DE

c

F

A

B

G

DE

c

F

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

Broadcast: spanning tree

v first construct a spanning treev nodes then forward/make copies only along

spanning tree

Broadcast: spanning tree: creation

Network Layer 4-64

A

B

G

DE

c

F1

2

3

4

5

(a) stepwise construction of spanning tree (center: E)

A

B

G

DE

c

F

(b) constructed spanning tree

v center nodev each node sends unicast join message to center

node§ message forwarded until it arrives at a node already

belonging to spanning tree

Network Layer 4-65

Multicast routing: problem statementgoal: find a tree (or trees) connecting routers having

local mcast group members v tree: not all paths between routers usedv shared-tree: same tree used by all group members

shared tree source-based trees

group membernot group member

routerwith agroup member

routerwithoutgroup member

legend

v source-based: different tree from each sender to rcvrs

Network Layer 4-66

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-67

Shortest path tree

v mcast forwarding tree: tree of shortest path routes from source to all receivers§ Dijkstra’s algorithm

i

router with attachedgroup member

router with no attachedgroup member

link used for forwarding,i indicates order linkadded by algorithm

LEGEND

R1

R2

R3

R4

R5

R6 R7

21

6

3 45

s: source

Network Layer 4-68

Reverse path forwarding

if (mcast datagram received on incoming link on shortest path back to center)

then flood datagram onto all outgoing linkselse ignore datagram

v rely on router’s knowledge of unicast shortest path from it to sender

v each router has simple forwarding behavior:

Network Layer 4-69

Reverse path forwarding: example

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

router with attachedgroup member

router with no attachedgroup member

datagram will be forwarded

LEGENDR1

R2

R3

R4

R5

R6 R7

s: source

datagram will not be forwarded

Network Layer 4-70

Reverse path forwarding: pruningv 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

router with attachedgroup member

router with no attachedgroup member

prune message

LEGEND

links with multicastforwarding

P

R1

R2

R3

R4

R5

R6R7

s: source

P

P

Network Layer 4-71

Center-based trees

v single delivery tree shared by allv one router identified as “center” of treev 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-72

Center-based trees: example

suppose R6 chosen as center:

router with attachedgroup member

router with no attachedgroup member

path order in which join messages generated

LEGEND

21

3

1

R1

R2

R3

R4

R5

R6R7

Network Layer 4-73

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-74

PIM: Protocol Independent Multicast

v not dependent on any specific underlying unicast routing algorithm (works with all)

v two different multicast distribution scenarios :

dense:v group members densely

packed, in “close”proximity.

v group membership by routers assumed until explicitly prune

v flood-and-prune RPF

sparse:v group members “widely

dispersed”v no membership until routers

explicitly joinv center-based approach

Network Layer 4-75

4.1 introduction4.2 virtual circuit and

datagram networks4.3 what’s inside a router4.4 IP: Internet Protocol

§ datagram format, IPv4 addressing, ICMP, IPv6

4.5 routing algorithms§ link state, distance vector,

hierarchical routing4.6 routing in the Internet

§ RIP, OSPF, BGP4.7 broadcast and multicast

routing

Chapter 4: done!

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