P - School of Computer Science
Download
Report
Transcript P - School of Computer Science
IP Multicast
G53ACC
Chris Greenhalgh
School of Computer Science
1
Contents
What is Multicasting
Applications
Application Semantics
Implementation
Multicast addresses and scopes
Research Issues
Example: DIVE
Book: COMER, ch 9.6, 9.7, 18.5, 27.15
2
What is Multicasting?
Defines “multicast groups”…
– like a host (destination) address
– but identifies a logical destination or group
Any number of hosts can
– sends packets to a multicast group
– join a multicast group
=> receive packets sent to that group
Plus:
– each packet crosses any network at most once
– packets are filtered in the network and host
NICs for interest (joined)
3
Multicasting example
Host
Host
Host
P
P
Host
P
P
joined G,
sees P
Router
LAN
P
P
Host
P
P
LAN
Forwards
P if required
P
P
Host
Sends P to
multicast group G
Host
Host
Joined G,
sees P
Network interface
ignores P
4
Multicast Applications
One-to-many
– A/V distribution, push media, file distribution,
cacheing, announcements, monitoring (e.g.
stocks).
Many-to-many
– A/V conferencing, synchronized resources (e.g.
distributed database), concurrent processing,
collaboration, distance learning, chat groups,
Distributed Interaction Simulation (DIS), multiplayed games, jam sessions.
One-to-any / many-to-one (“any-cast”)
– resource discovery, data collection, auctions 5
Application Semantics
For UDP only (unreliable datagrams).
Uses socket interface: java.net.MulticastSocket
– See over
Send multicast packets from a normal (unicast) UDP
socket, just give a class D destination IP address
– or use a multicast socket, if TTL must be specified.
Receive multicast packets only on a MulticastSocket.
– joinGroup(addr) performs a JOIN operation,
– leaveGroup(addr) or destroying a socket performs
a LEAVE operation.
– (More complex options with multi-homed
machines, using java.net.NetworkInterface)
6
Java API: java.net.MulticastSocket
public class MulticastSocket
extends java.net.DatagramSocket
{
public MulticastSocket()
throws IOException;
public MulticastSocket(int port)
throws IOException;
public void joinGroup(InetAddress mcastaddr)
throws IOException;
public void leaveGroup(InetAddress mcastaddr)
throws IOException;
public void setTimeToLive(int ttl)
throws IOException;
}
7
ReverseServerMulticast.java excerpts
...
int port = Integer.parseInt(args[1]);
InetAddress group =
InetAddress.getByName(args[0]);
MulticastSocket socket =
new MulticastSocket(port);
socket.joinGroup(group);
…
socket.receive(request);
…
// as per unicast server
8
Defining Packets/Protocols
E.g. Real-Time Protocol (RTP) (RFC-1889, etc.)
Or make them up…
– Remember UDP semantics
Unreliable
Packet-preserving
Unordered
– Also consider
Time to join a group (start-up delay)
Time to leave a group (extra traffic)
Locally available number of groups (router state)
– Tens rather than thousands!
Scope (see later slides...)
9
Implementation (1)
Multicast group =
Class D destination IP address
– starts 11102
= 224.0.0.0/4
= 224.0.0.0 with netmask 240.0.0.0
= 111000000000000000000000000000002 mask
111100000000000000000000000000002
Mapped to underlying multicast
– not ARP!
– (LAN) Ethernet multicast addresses
– Takes bits from IP address, use in Ether. addr.
But not all 28 variable bits! (24 bits only)
10
Implementation (2)
Hosts use Internet Group Management Protocol
(IGMP) (v.2 RFC-2236, v.3 RFC-3376)
– tells network router(s) about groups joined/left
Routers use multicast routing protocol(s) (e.g.
DVMRP, MOSPF)
– forward a single packet on multiple interfaces
– Many routers do NOT do multicast routing and
will drop packets
– Routers may “tunnel” multicast packets in
unicast packets across non-multicast regions
E.g. MBone = Multicast BackBone (historical)
– = Multicast “overlay” network, using unicast wide-area
11
Choosing Multicast Addresses (1):
Statically allocated Global addresses
RFC-1700 / IANA (www.iana.org)
– e.g. 224.2.0.0-224.2.127.253 Multimedia
Conference Calls
– Apply to IANA for an allocation
Allocate locally within Autonomous Unit
(RFC-3180, “GLOP addressing in 233/8”)
12
Choosing Multicast Addresses (2):
Administrative Scoped Multicast
Addresses (RFC-2365)
Configured in network
Link-local scope (i.e. LAN)
– 224.0.0.0/24
i.e. first 24 bits count, like a netmask
255.255.255.0
Local scope (e.g. department)
– 239.255.0.0/16
Organisation-local scope (e.g. UoN)
– 239.192.0.0/14
13
Choosing Multicast Addresses (3):
choosing an address in a range
Make one up and hope (check w. RFCs & scopes)
See also
http://www.29west.com/docs/THPM/multicast-addressassignment.html
Hash to an address range and hope
Optionally augment with a monitoring process
which detects duplicate use and negotiates a
change to a new address
– As in the SDR MBone tool
14
Choosing Multicast Addresses (4)
Source-specific multicast address (if supported)
– RFC-4607 [1-to-many applications only]
Dynamically allocated using Multicast Address
Allocation Service
– E.g. SDR MBone tool for MM conferences or
IETF malloc working group outputs???
15
TTL Scope (How Far do Packets Travel?)
Use IP packet TTL (Time To Live) to determine
scope of sending:
– TTL 0 = on the same machine
iff “loopback” is on for sending socket and (on
Windows) an Ethernet interface is “up”.
– TTL 1 = on the same LAN (esp. Ethernet)
– TTL >1 = internetwork
on a multicast-capable WAN;
on the MBone (Multicast Backbone).
– E.g.
31 = campus? 63 = country?
127 = continent? 255 = whole world?
16
Multicast Research & Deployment Issues
Reliable delivery
– N.B. only a subset of receivers may have
missed a packet.
Flow and congestion control
– N.B. only a subset (one?) of receivers may be
experiencing congestion or buffer overflow.
=> lowest common denominator??
Deployment
– MBone, PIM, native (ISPs??)
– Application-specific bridges and reflectors
17
Example: DIVE System Outline
(Swedish Institute of Computer Science,
www.sics.se/dive)
Process (Agent)
World X
Process (Agent)
Join: TCP state transfer World X
World Y
World multicast group:
updates, audio, video.
Data uses Scalable Reliable Multicast (shared NAcks).
18
Example: DIVE System Bootstrapping
DIVE mgmt.
multicast group
First Agent
Diveserver
World
multicast group
(1)
HTTP Server
(3)
(5)
World X
multicast group
(2) Diveserver finds
World X’s
multicast group.
(3) Agent pings
multicast group.
(2)
World X...
(1) Agent locates
diveserver (m/c).
World X definition
(files)
(4) Agent downloads
world definition.
(5) Agent creates
world locally.
(4) HTTP transfer
(c.f. state transfer)
19