COMS/CSEE 4140 Networking Laboratory Lecture 11 Salman Abdul Baset Spring 2008 Announcements Prelab 10 and Lab report 9 due next week before your lab slot  Weekly.

Download Report

Transcript COMS/CSEE 4140 Networking Laboratory Lecture 11 Salman Abdul Baset Spring 2008 Announcements Prelab 10 and Lab report 9 due next week before your lab slot  Weekly.

COMS/CSEE 4140
Networking Laboratory
Lecture 11
Salman Abdul Baset
Spring 2008
Announcements
Prelab 10 and Lab report 9 due next week before
your lab slot
 Weekly project reports due before Friday 5pm

2
Agenda

Multicast








why multicast?
multicast groups
terminology
(S,G) notation
Addressing
IGMP
Source and core-based trees
PIM


PIM-DM
PIM-SM
3
Applications with Multiple Receivers

Many applications transmit the same data at one
time to multiple receivers




Broadcasts of radio or video (streaming)
Video conferencing (interactive video)
Shared applications (data, file transfer)
A network “must” have mechanisms to support
such applications in an efficient manner
4
Multicasting

Multicast communications refers to one-to-many
or many-to-many communications.
Unicast
Broadcast
Multicast
IP Multicasting refers to the implementation of multicast
communication in the Internet
Multicast is driven by receivers: Receivers indicate interest in
receiving data
5
Multicasting over a Packet Network

Without support for multicast at the network
layer:
Multiple copies
of the same
message is
transmitted on
the same link
6
Multicasting over a Packet Network

With support for multicast at the network
layer:
• Requires a set of mechanisms:
(1) Packet forwarding can send multiple
copies of same packet
(2) Multicast routing algorithm which builds
a spanning tree (dynamically)
7
Why IP Multicast?
Cost-efficient distribution of data
 Timely distribution of data
 Robust distribution of data

“Data” here could be


Files
Streamed Audio or Video
Source: Internet2 workshop
Cost Efficient Data Distribution

This is the core of the streaming case.
Unicast streaming is just too expensive.
 This is true either on the commodity Internet or
on the Intranet.
 Multicast is especially compelling for video.


Question: Is multicast a good model for


YouTube?
Live video streaming?
Source: Internet2 workshop
Timely Distribution of Data

An argument for multicast in financial services.


Though reliability is an issue.
In unicast, it takes time to send packets
separately to each receiver.


Even if cost is not a problem, time may be.
100 Mb/s link, takes 22 hours to distribute a 100 MB
file t0 10,000 machines. With multicast, it will take
eight seconds.

Alternate solution is to have huge upstream bw
 But…

Multicasting is compelling here if timely distribution
is important.
Source: Internet2 workshop
Robust Distribution of Data

Handle sudden large increases in load



streaming
data distribution
Multicast was designed to handle sudden large
increases in load.
Source: Internet2 workshop
Multicast Groups

The set of receivers for a multicast transmission is
called a multicast group



A multicast group is identified by a multicast address
A user that wants to receive multicast transmissions joins
the corresponding multicast group, and becomes a
member of that group
After a user joins, the network builds the necessary
routing paths so that the user receives the data sent
to the multicast group
12
IP Multicasting: Key questions
What IP address / Ethernet address to send
multicast packets to?
 How to manage groups?
 How to route multicast packets?

13
The IP Protocol Stack
IP Multicasting only supports UDP as higher
layer
 There is no multicast TCP !

User Layer
Socket Layer
Stream Sockets
Datagram Sockets
TCP
Multicast Sockets
UDP
IP
Network Interface
IP Multicast
14
Essential Multicast Terminology
IP source = IP unicast addr
Ethernet source = MAC addr
source
IP destination = IP multicast addr
Ethernet dest = MAC addr
receivers
e.g., video server
Multicast stream
source = origin of multicast stream
multicast address = an IP address in the Class D range (224.0.0.0 – 239.255.255.255),
used to refer to multiple recipients. A multicast address is also called a multicast
group or channel.
multicast stream = stream of IP packets with multicast address for IP destination
address. All multicast uses UDP packets.
receiver(s) = recipient(s) of multicast stream
tree = the path taken by multicast data. Routing loops are not allowed, so there is always
a unique series of branches between the root of the tree and the receivers.
Source: Internet2 workshop
(S,G) notation
 For
every multicast source there must be two
pieces of information: the source IP address,
S, and the group address, G.



These correspond to the sender and receiver
addresses in unicast.
This is generally expressed as (S,G).
Also commonly used is (*,G) - every source for a
particular group.
Source: Internet2 workshop
Multicast Protocols
Receivers
Delivery tree
Senders
Multicast Routing
Protocol (e.g. PIM-SM)


Group Management
Protocol (e.g. IGMP)
Group Management Protocol - enables hosts to dynamically
join/leave multicast groups. Receivers send group membership
reports to the nearest router.
Multicast Routing Protocol - enables routers to build a delivery tree 17
between the sender(s) and receivers of a multicast group.
Agenda

Multicast








why multicast?
multicast groups
terminology
(S,G) notation
Addressing
IGMP
Source and core-based trees
PIM


PIM-DM
PIM-SM
18
Multicast Addressing

Multicast address



Every host (interface) can join and leave a
multicast group dynamically


no access control
Every IP datagram send to a multicast group is
transmitted to all members of the group



IP addresses in the range 224.0.0.0 - 239.255.255.255
(class D address)
Multicast group: same as multicast address
no security, no “floor control”
Sender does not need to be a member of the group
The IP Multicast service is unreliable
19
Multicast Addressing
• All Class D addresses are multicast addresses:
Class D
1 1 1 0
multicast group id
28 bits
Class
From
To
D
224.0.0.0
239.255.255.255
• Multicast addresses are dynamically assigned.
• An IP datagram sent to a multicast address is forwarded to everyone
who has joined the multicast group
• If an application is terminated, the multicast address is (implicitly)
released.
20
Types of Multicast Addresses

RFC 3171


http://www.iana.org/assignments/multicast-addresses
Examples:

224.0.0.0 - 224.0.0.255 (224.0.0/24) - reserved & not forwarded










224.0.0.1 - All local hosts
224.0.0.2 - All local routers
224.0.0.4 - DVMRP
224.0.0.5 - OSPF
224.0.0.9 - RIP2
224.0.0.13 – PIM
224.0.0.22 – IGMP
232.0.0.0 - 232.255.255.255 (232/8) - SSM
239.0.0.0 - 239.255.255.255 (239/8) - Administrative Scoping
(RFC 2365)
 Site-local scope: 239.253.0.0/16
 Organization-local scope: 239.192.0.0/14
“Ordinary” multicasts don’t have to request a multicast address
from IANA.
21
Multicast Address Translation

In Ethernet MAC addresses, a multicast address
is identified by setting the lowest bit of the “most
left byte”
-------1 ----------------------------------------
Not all Ethernet cards can filter multicast addresses in hardware
- Then: Filtering is done in
software by device driver.
22
Multicast Address Mapping
Identifes
Class D
Ethernet Addresses
with 01:00:5e in the
first 3 bytes are
reserved for IP
multicast
Ignored
23-bit
address
1110xxxx x-----------------------
00000001 00000000010111100-----------------------
Clas s D
IP Addre s s
Ethe rne t
Addre s s
23
Agenda

Multicast








why multicast?
multicast groups
terminology
(S,G) notation
Addressing
IGMP
Source and core-based trees
PIM


PIM-DM
PIM-SM
24
Multicast Protocols
Receivers
Delivery tree
Senders
Multicast Routing
Protocol (e.g. PIM-SM)


Group Management
Protocol (e.g. IGMP)
Group Management Protocol - enables hosts to dynamically
join/leave multicast groups. Receivers send group membership
reports to the nearest router.
Multicast Routing Protocol - enables routers to build a delivery tree 25
between the sender(s) and receivers of a multicast group.
IGMP (RFC 1112)
The Internet Group Management Protocol
(IGMP) is a simple protocol for the support of
IP multicast.
 IGMP operates on a physical network (e.g.,
single Ethernet Segment.
 IGMP is used by multicast routers to keep track
of membership in a multicast group.
 Support for:




Joining a multicast group
Query membership
Send membership reports
26
IGMP Protocol

A host sends an IGMP report when it joins a multicast
group


Multiple processes on a host can join.
A report is sent only for the first process.

No report is sent when a process leaves a group
A multicast router regularly multicasts an IGMP query to
all hosts (group address is set to 0.0.0.0).

A host responds to an IGMP query with an IGMP report.

Multicast router keeps a table of the multicast groups that have
joined hosts. The router only forwards a packet, if there is a host still
joined.

27
IGMP Packet Format

IGMP messages are only 8 bytes long
14 bytes
20 bytes
8 bytes
Ethernet Header
IP header
IGMP
Message
Type
Max resp. time
Checksum
Multicast group address
IGMPv2
0x11 Membership query (group addr: 0.0.0.0)
0x16 Membership report
0x17 Leave group
28
IGMP Protocol
H1
H2
R1
Ethernet
IGMP query
IGMP Report
29
IGMP Protocol
H1
H2
R1
Ethernet
IGMP general query
IGMP group address = 0.0.0.0
Destination IP address = 224.0.0.1
Source IP address = router's IP address
IGMP group-specific query
IGMP group address = group address
Destination IP address = group address
Source IP address = router's IP address
IGMP membership report
IGMP group address = group address
Destination IP address= group address
Source IP address = host's IP address
30
Networks with multiple multicast
routers

Only one router
responds to IGMP
queries (Querier)

Router with
smallest IP address
becomes the querier
on a network.
Multicast Network
Querier
Forwarder
Multicast
packet
IGMP query

One router
forwards multicast
packets to the
network
(Forwarder).
Ethernet
Host
31
Agenda

Multicast








why multicast?
multicast groups
terminology
(S,G) notation
Addressing
IGMP
Source and core-based trees
PIM


PIM-DM
PIM-SM
32
Multicast Protocols
Receivers
Delivery tree
Senders
Multicast Routing
Protocol (e.g. PIM-SM)


Group Management
Protocol (e.g. IGMP)
Group Management Protocol - enables hosts to dynamically
join/leave multicast groups. Receivers send group membership
reports to the nearest router.
Multicast Routing Protocol - enables routers to build a delivery tree 33
between the sender(s) and receivers of a multicast group.
Multicast Routing Protocols

Goal: Build a spanning tree between all
members of a multicast group
34
Multicast routing as a graph
problem

Problem: Embed a tree
such that all multicast group
members are connected by
the tree
S
35
Multicast routing as a graph
problem

Problem: Embed a tree such
that all multicast group members
are connected by the tree

Solution 1: Shortest Path
Tree or source-based tree
Build a tree that minimizes the
path cost from the source to each
receiver



Good tree if there is a single sender
If there are multiple senders, need one
tree per sender
Easy to compute
S
36
Multicast routing as a graph
problem

Problem: Embed a tree such
that all multicast group members
are connected by the tree

Solution 2: Minimum-Cost
Tree Build a tree that minimizes
the total cost of the edges


S
Good solution if there are multiple
senders
Very expensive to compute (not practical
for more than 30 nodes)
37
Multicast routing in practice

Routing Protocols implement one of two approaches:
1.
Source Based Tree:
–
–
–
2.
Essentially implements Solution 1.
Builds one shortest path tree for each sender
Tree is built from receiver to the sender  reverse shortest
path / reverse path forwarding (RPF)
Core-based Tree:
–
–
–
–
Build a single distribution tree that is shared by all senders
Does not use Solution 2 (because it is too expensive)
Selects one router as a “core” (also called “rendezvous point”)
All receivers build a shortest path to the core  reverse
shortest path / reverse path forwarding
38
Reverse Path Forwarding (RPF)



RPF builds a shortest path tree in a distributed fashion by taking advantage
of the unicast routing tables.
Main concept: Given the address of the root of the tree (e.g., the sending
host), a router selects as its upstream neighbor in the tree the router which
is the next-hop neighbor for forwarding unicast packets to the root.
This concept leads to a reverse shortest
path from any router to the sending host.
The union of reverse shortest paths builds
a reverse shortest path tree.
RPF Forwarding:
Forward a packet
only if it is receives
from an RPF neighbor
39
Multicast Routing table

Routing table entries for source-based trees and for
core-based trees are different


Source-based tree: (Source, Group) or (S, G) entry.
Core-based tree: (*, G) entry.
Source IP
address
Multicast
group
Incoming interface
(RPF interface)
Outgoing
interface
list
S1
G1
I1
I2, I3
*
G2
I2
I1, I3
40
Multicast routing in practice

Routing algorithms in practice implement one
of two approaches:
1.
Source Based Tree Tree:
–
2.
Establish a reverse path to the source
Core-based Tree:
–
Establish a reverse path to the core router
41
Building a source-based tree


Set routing
tables according
to RPF
forwarding
IGMP
Flood-andPrune
42
Building a source-based tree

H1
Set routing tables
according to RPF
forwarding
Source
R1
R3

R2
Flood-andPrune
H2
R4
R5
Flood=
Forward packets that
arrive on RPF
H3
interface on all non- joined
RPF interfaces
R6
R7
H4
joined
R8
H5
43
Building a source-based tree
H1

Set routing tables
according to RPF
forwarding
Source
R1
R3

R2
Flood-and-Prune
H2
R4
Flood=
R5
Forward packets
on all non-RPF interfaces
R6
R7
Receiver drops packets
not received on
RPF interface
R8
H3
joined
H4
joined
H5
44
Building a source-based tree

Set routing tables
according to RPF
forwarding
H1
Source
R1

Flood-andPrune
R3
R2
H2
Pru
un
Pr
Prune
ne
Pru
Prune
ne
R7 Prune
H4
joined
R6
Prune
Pru
e
Prune
ne
Prune message disables
routing table entry
ne
e
Prun
Pru
Prune=
R5
Send a prune
message when a
packet is received on
a non-RPF interface
or when there are no H3
joined
receivers
downstream
R4
e
Prun
R8
H5 45
Pruning

Prune message temporarily disables a routing table
entry

Effect: Removes a link from the multicast tree
No multicast messages are sent on a pruned link
Prune message is sent in response to a multicast packet

Question: Why is routing table only temporarily disabled?



Who sends prune messages?



A router with no group members in its local network and no connection to
other routers (sent on RPF interface)
A router with no group members in its local network which has received a
prune message on all non-RPF interfaces (sent on RPF interface)
A router with group members which has received a packet from a non-RPF
neighbor (to non-RPF neighbor)
46
Building a source-based tree

When a receiver
joins, one needs
to re-activate a
pruned routing
table entry
H1
Source
R1
R3
R2
H2
R4
Grafting
aft
Gr

R5
R6
Graft
Sending a Graft
message disables
prune, and reactivates routing
table entry.
R7
R8
H3
joined
H4
joined
H5
joined
47
Alternative method for building a
source-based tree

This only
works if the
receiver knows
the source

Explicit-Join



Receiver sends a
Join message to
RPF neighbor
Join message
creates (S,G)
routing table
entry
Join message is
passed on
48
Building a core-based tree

One route is the
core

Receiver sends a
Join message to
RPF neighbor with
respect to core
Join message
creates
(*, G) routing table
entry

49
Building a core-based tree
Source sends
data to the
core
 Core forwards
data according
to routing table
entry

50
Agenda

Multicast








why multicast?
multicast groups
terminology
(S,G) notation
Addressing
IGMP
Source and core-based trees
PIM


PIM-DM
PIM-SM
51
Multicast routing protocols in the
Internet

Distance Vector Multicast Routing Protocol (DVMRP):



Multicast Open Shortest Path First (MOSPF):



Multicast extensions to OSPF. Each router calculates a shortest-path
tree based on link state database
Not widely used
Core Based Tree (CBT):


First multicast routing protocol
Implements flood-and-prune
First core-based tree routing protocol
Protocol Independent Multicast (PIM):



Runs in two modes: PIM Dense Mode (PIM-DM) and PIM Sparse Mode
(PIM-SM).
PIM-DM builds source-based trees using flood-and-prune
PIM-SM builds core-based trees as well as source-based trees with
explicit joins.
52
PIM Messages (PIM version 2)
32 bit
Version
(= 2)
Type
Reserved
Checksum
• PIM messages can be sent as
unicast or multicast packet
Message type specific part
PIM-DM messages
• Encapsulated in IP datagrams
with protocol number 103.
• 224.0.0.13 is reserved as the
ALL-PIM-Routers group
Type
PIM-DM
PIM-SM
Hello
0


Similar to periodic keep-alive
Register
1

Sent by designated router to rendezvous point.
Register-Stop
2

Join/Prune
3
Bootstrap
4
Assert
5

Graft
6

Graft-Ack
7

Candidate-RPAdvertisement
8


Description
Creates/negates forwarding state


Reinstate a previously pruned branch

53
PIM-DM: PIM Dense Mode
S1

PIM-DM
implements floodand-prune
Source
src: S1
dest: G
R1
src: S1
dest: G
Orange packet:
Multicast packet
(=Data)
 Blue packet:
PIM message
I1

R2
src: S1
dest: G
I1
I3
src: S1
dest: G
prune (S1, G)
R3
R4
src: S1
dest: G
H2
H3
joined
54
PIM-SM: PIM Sparse Mode
S1


Core is called
rendezvous-point
(RP)
Source
R1
Receivers know RP
(statically configured
or dynamically
elected)
RP
I1
R2
I1
R3

When receiver joins, a
Join message is sent
to RP on RPF.
R5
I3
join (*, G)
R4
join (*, G)
IGMP
H2
H3
joined
(a) PIM-SM: H2 joins
55
PIM-SM: PIM Sparse Mode
S1

Host H3 joins:
Join message is
only forwarded
until the first
router that is part
of the core-based
tree.
Source
R1
RP
I1
R2
R5
I1
R3
I3
R4
join (*, G)
IGMP
H2
H3
joined
56
PIM-SM: Data transmission
Source sends
multicast packet to
RP
 Packet is attached
to an RP Register
message


When packet
reaches RP, it is
forwarded in the
tree
57
PIM-SM: Data transmission
S1

When Join
messages reaches
R1, it sends a
native multicast
packet to the RP
(in addition to the
packet attached to
the register
message)
Source
src: S1
dest: G
src: S1
dest: G
R1
register src: S1
(S1, G) dest: G
I1
R5
R2
I1
I3
src: S1
dest: G
RP
src: S1
dest: G
R3
R4
src: S1
dest: G
H2
H3
joined
58
PIM-SM: Data transmission
S1

When RP receives
native multicast
packet it sends a
register stop
message to R1.
This message stops
the transmission of
register messages
from R1.
Source
src: S1
dest: G
src: S1
dest: G
R1
register src: S1
(S1, G) dest: G
register stop (S1,G)
I1
R5
R2
I1
I3
src: S1
dest: G
RP
src: S1
dest: G
R3
R4
src: S1
dest: G
H2
H3
joined
59
PIM-SM: Switching to sourcebased tree
S1

When data to receivers
exceeds a threshold,
routers switch to a
source-based tree
Source
src: S1
dest: G
R1
src: S1
dest: G
RP
join (S1,G)

This is done by sending
an explicit join message
to the source
I1
R5
R2
I1
join (S1,G)
I3
src: S1
dest: G
src: S1
dest: G
R3

There may be duplicate
packets being sent for
some time
R4
src: S1
dest: G
H2
H3
joined
(a) PIM-SM: R3 switches to a SPT
60
PIM-SM: Switching to sourcebased tree
S1

When data arrives from
source (as opposed to
RP), a Prune message is
sent to the RPT
Source
src: S1
dest: G
R1
src: S1
dest: G
RP

Now: data is forwarded
only along the shortestpath tree
I1
R5
R2
I1
prune
(S,G,RPT)
I3
prune
(S,G,RPT)
src: S1
dest: G
R3
R4
src: S1
dest: G
H2
H3
joined
61
(b) PIM-SM: Data follows a SPT
Conclusion
Multicast
 Addressing
 IGMP
 Source and core-based trees
 PIM (SM vs. DM)

62