Spanning trees

23
Network Layer 4-1 Spanning trees Suppose you have a connected undirected graph Connected: every node is reachable from every other node Undirected: edges do not have an associated direction ...then a spanning tree of the graph is a connected subgraph in which there are no cycles A connected, undirected graph Four of the spanning trees of the graph

description

A connected, undirected graph. Four of the spanning trees of the graph. Spanning trees. Suppose you have a connected undirected graph Connected: every node is reachable from every other node Undirected: edges do not have an associated direction - PowerPoint PPT Presentation

Transcript of Spanning trees

Page 1: Spanning trees

Network Layer 4-1

Spanning trees Suppose you have a connected undirected graph

Connected: every node is reachable from every other node

Undirected: edges do not have an associated direction

...then a spanning tree of the graph is a connected subgraph in which there are no cycles

A connected,undirected graph

Four of the spanning trees of the graph

Page 2: Spanning trees

Network Layer 4-2

Finding a spanning tree To find a spanning tree of a graph,

pick an initial node and call it part of the spanning tree do a search from the initial node:

each time you find a node that is not in the spanning tree, add to the spanning tree both the new node and the edge you followed to get to it

An undirected graph One possible result of a BFSstarting from top

One possible result of a DFSstarting from top

Page 3: Spanning trees

Network Layer 4-3

Minimizing costs Suppose you want to supply a set of houses (say,

in a new subdivision) with: electric power water sewage lines telephone lines

To keep costs down, you could connect these houses with a spanning tree (of, for example, power lines) However, the houses are not all equal distances

apart To reduce costs even further, you could connect

the houses with a minimum-cost spanning tree

Page 4: Spanning trees

Network Layer 4-4

Minimum-cost spanning trees Suppose you have a connected undirected graph

with a weight (or cost) associated with each edge The cost of a spanning tree would be the sum of

the costs of its edges A minimum-cost spanning tree is a spanning tree

that has the lowest cost

A B

E D

F C

16

19

21 11

33 14

1810

6

5

A connected, undirected graph

A B

E D

F C

1611

18

6

5

A minimum-cost spanning tree

Page 5: Spanning trees

Network Layer 4-5

Small Example

Page 6: Spanning trees

Network Layer 4-6

Why Multicast

When sending same data to multiple receivers better bandwidth utilization less host/router processing quicker participation

Application Video/Audio broadcast (One sender) Video conferencing (Many senders) Real time news distribution Interactive gaming

Page 7: Spanning trees

Network Layer 4-7

Unicast/Multicast

128.146.222.0/24 128.146.226.0/24

128.146.116.0/24128.146.199.0/24

Page 8: Spanning trees

Network Layer 4-8

Unicast

128.146.222.0/24 128.146.226.0/24

128.146.116.0/24

Receivers

128.146.199.0/24

Receiver

ReceiverSender

Page 9: Spanning trees

Network Layer 4-9

Multicast

128.146.222.0/24 128.146.226.0/24

128.146.116.0/24

Receivers

128.146.199.0/24

Receiver

ReceiverSender

Page 10: Spanning trees

Network Layer 4-10

Two Major Issues

Who are the multicast members

How to send the packets to the members

Page 11: Spanning trees

Network Layer 4-11

IGMP

Host informs router with IGMP report

224.2.127.254

Designated router queries LAN for group membership

224.0.0.1

Page 12: Spanning trees

Network Layer 4-12

IGMP – Joining a groupExample : R joins to Group 224.2.0.1

• R sends IGMP Membership-Reportto 224.2.0.1

• DR receives it. DR will start forwarding packets for 224.2.0.1 to Network A

• DR periodically sends IGMP Membership-Query to 224.0.0.1 (ALL-SYSTEMS.MCAST.NET)

• R answers IGMP Membership-Report to 224.2.0.1

R

R: ReceiverDR: Designated Router

Data to 224.2.0.1

IGMP Membership-Report

Network A

Network B

DR

Page 13: Spanning trees

Network Layer 4-13

IGMP – Leaving a group

Example : R leaves from a Group 224.2.0.1

• R sends IGMP Leave-Group to 224.0.0.2 (ALL-ROUTERS.MCAST.NET)

• DR receives it.

• DR stops forwarding packets for 224.2.0.1 to Network A if no more 224.2.0.1 group members on Network A.

Data to 224.2.0.1

R

DR

R: ReceiverDR: Designated Router

IGMP Leave-Group

Network A

Network B

Page 14: Spanning trees

Multicast Routing Goal: find a tree (or trees) connecting

routers having local mcast group members tree: not all paths between routers used source-based: different tree from each sender to rcvrs shared-tree: same tree used by all group members

Shared tree Source-based trees

Page 15: Spanning trees

Approaches for building mcast treesApproaches: source-based tree: one tree per source

shortest path trees reverse path forwarding

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

Page 16: Spanning trees

Shortest Path Tree

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

R1

R2

R3

R4

R5

R6 R7

21

6

3 4

5

i

router with attachedgroup member

router with no attachedgroup member

link used for forwarding,i indicates order linkadded by algorithm

LEGENDS: source

Page 17: Spanning trees

Reverse Path Forwarding

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

then flood datagram onto all outgoing links else ignore datagram

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

each router has simple forwarding behavior:

Page 18: Spanning trees

Reverse Path Forwarding: example

• result is a source-specific reverse SPT– may be a bad choice with asymmetric links

R1

R2

R3

R4

R5

R6 R7

router with attachedgroup member

router with no attachedgroup member

datagram will be forwarded

LEGENDS: source

datagram will not be forwarded

Page 19: Spanning trees

Reverse Path Forwarding: pruning 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

R1

R2

R3

R4

R5

R6 R7

router with attachedgroup member

router with no attachedgroup member

prune message

LEGENDS: source

links with multicastforwarding

P

P

P

Page 20: Spanning trees

Shared-Tree: Steiner Tree

Steiner Tree: minimum cost tree connecting all routers with attached group members

problem is NP-complete excellent heuristics exists not used in practice:

computational complexity information about entire network needed monolithic: rerun whenever a router needs

to join/leave

Page 21: Spanning trees

Center-based trees

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

Page 22: Spanning trees

Center-based trees: an example

Suppose R6 chosen as center:

R1

R2

R3

R4

R5

R6 R7

router with attachedgroup member

router with no attachedgroup member

path order in which join messages generated

LEGEND

21

3

1

Page 23: Spanning trees

Network Layer 4-23

Overlay Multicast

Constructs Overlay Multicast Data Delivery Tree among Group Members

Intermediate Receiver can act as a Multicast Forwarder Data is delivered by Unicast Tunneling Mechanisms,

hop-by-hop basis