1 IP Multicast G53ACC Chris Greenhalgh School of Computer Science.

Post on 17-Jan-2018

217 views 0 download

description

3 What is Multicasting? l Defines “multicast groups”… –like a host (destination) address –but identifies a logical destination or group l Any number of hosts can –sends packets to a multicast group –join a multicast group l => receive packets sent to that group l Plus: –each packet crosses any network at most once –packets are filtered in the network and host NICs for interest (joined)

Transcript of 1 IP Multicast G53ACC Chris Greenhalgh School of Computer Science.

1

IP Multicast IP Multicast

G53ACCG53ACC

Chris GreenhalghSchool of Computer Science

2

ContentsContents

What is MulticastingWhat is Multicasting ApplicationsApplications Application SemanticsApplication Semantics ImplementationImplementation Multicast addresses and scopesMulticast addresses and scopes Research IssuesResearch Issues Example: DIVEExample: DIVE

Book: COMER, ch 9.6, 9.7, 18.5, 27.15Book: COMER, ch 9.6, 9.7, 18.5, 27.15

3

What is Multicasting?What is Multicasting? Defines “multicast groups”…Defines “multicast groups”…

– like a host (destination) addresslike a host (destination) address– but identifies a but identifies a logicallogical destination or destination or groupgroup

Any number of hosts canAny number of hosts can– sends packets to a multicast groupsends packets to a multicast group– join a multicast groupjoin a multicast group

=> receive packets sent to that group=> receive packets sent to that group Plus:Plus:

– each packet crosses any network at most onceeach packet crosses any network at most once– packets are filtered in the network and host NICs for packets are filtered in the network and host NICs for

interest (joined)interest (joined)

4

Multicasting exampleMulticasting example

Host

RouterLAN LANHost

Host Host

Host

Host

Host

Host

Sends P to multicast group G

P

ForwardsP if required

joined G,sees P

Joined G,sees P

P

PP

P

P

P

P

P

P

Network interfaceignores P

5

Multicast ApplicationsMulticast Applications One-to-manyOne-to-many

– A/V distribution, push media, file distribution, A/V distribution, push media, file distribution, cacheing, announcements, monitoring (e.g. stocks).cacheing, announcements, monitoring (e.g. stocks).

Many-to-manyMany-to-many– A/V conferencing, synchronized resources (e.g. A/V conferencing, synchronized resources (e.g.

distributed database), concurrent processing, distributed database), concurrent processing, collaboration, distance learning, chat groups, collaboration, distance learning, chat groups, Distributed Interaction Simulation (DIS), multi-Distributed Interaction Simulation (DIS), multi-played games, jam sessions.played games, jam sessions.

One-to-any / many-to-one (“any-cast”)One-to-any / many-to-one (“any-cast”)– resource discovery, data collection, auctionsresource discovery, data collection, auctions

6

Application SemanticsApplication Semantics For UDP only (unreliable datagrams).For UDP only (unreliable datagrams). Uses socket interface: java.net.MulticastSocketUses socket interface: java.net.MulticastSocket

– See overSee over Send multicast packets from a normal (unicast) UDP Send multicast packets from a normal (unicast) UDP

socket, just give a class D destination IP addresssocket, just give a class D destination IP address– or use a multicast socket, if TTL must be specified.or use a multicast socket, if TTL must be specified.

Receive multicast packets only on a MulticastSocket.Receive multicast packets only on a MulticastSocket.– joinGroup(addr) performs a JOIN operation,joinGroup(addr) performs a JOIN operation,– leaveGroup(addr) or destroying a socket performs leaveGroup(addr) or destroying a socket performs

a LEAVE operation.a LEAVE operation.– (More complex options with multi-homed (More complex options with multi-homed

machines, using java.net.NetworkInterface)machines, using java.net.NetworkInterface)

7

Java API: java.net.MulticastSocketJava API: java.net.MulticastSocket public class MulticastSocket public class MulticastSocket extends java.net.DatagramSocket extends java.net.DatagramSocket {{ public public MulticastSocketMulticastSocket() () throws IOException; throws IOException; public public MulticastSocketMulticastSocket(int port) (int port) throws IOException; throws IOException; public void public void joinGroupjoinGroup(InetAddress mcastaddr)(InetAddress mcastaddr) throws IOException; throws IOException; public void public void leaveGroupleaveGroup(InetAddress mcastaddr) (InetAddress mcastaddr)

throws IOException; throws IOException; public void public void setTimeToLivesetTimeToLive(int ttl) (int ttl) throws IOException; throws IOException;}}

8

ReverseServerMulticast.java excerptsReverseServerMulticast.java excerpts

......int port = Integer.parseInt(args[1]);int port = Integer.parseInt(args[1]);InetAddress group = InetAddress group = InetAddress.getByName(args[0]); InetAddress.getByName(args[0]); MulticastSocket socket = MulticastSocket socket = new MulticastSocket(port); new MulticastSocket(port);socket.joinGroup(group);socket.joinGroup(group);……socket.receive(request);socket.receive(request); … … // as per unicast server// as per unicast server

9

Defining Packets/ProtocolsDefining Packets/Protocols

E.g. Real-Time Protocol (RTP) (RFC-1889, etc.)E.g. Real-Time Protocol (RTP) (RFC-1889, etc.) Or make them up…Or make them up…

– Remember UDP semanticsRemember UDP semantics UnreliableUnreliable Packet-preservingPacket-preserving UnorderedUnordered

– Also considerAlso consider Time to join a group (start-up delay)Time to join a group (start-up delay) Time to leave a group (extra traffic)Time to leave a group (extra traffic) Locally available number of groups (router state)Locally available number of groups (router state)

– Tens rather than thousands!Tens rather than thousands! Scope (see later slides...)Scope (see later slides...)

10

Implementation (1)Implementation (1) Multicast group = Multicast group =

Class D destination IP address Class D destination IP address – starts 1110starts 111022

= 224.0.0.0/4= 224.0.0.0/4 = 224.0.0.0 with netmask 240.0.0.0= 224.0.0.0 with netmask 240.0.0.0 = 11100000000000000000000000000000= 1110000000000000000000000000000022 mask mask

11110000000000000000000000000000 1111000000000000000000000000000022

Mapped to underlying multicast Mapped to underlying multicast – not ARP!not ARP!– (LAN) Ethernet multicast addresses (LAN) Ethernet multicast addresses – Takes bits from IP address, use in Ether. addr.Takes bits from IP address, use in Ether. addr.

But not all 28 variable bits! (24 bits only)But not all 28 variable bits! (24 bits only)

11

Implementation (2)Implementation (2) Hosts use Internet Group Management Protocol Hosts use Internet Group Management Protocol

(IGMP) (v.2 RFC-2236, v.3 RFC-3376)(IGMP) (v.2 RFC-2236, v.3 RFC-3376)– tells network router(s) about groups joined/lefttells network router(s) about groups joined/left

Routers use multicast routing protocol(s) (e.g. Routers use multicast routing protocol(s) (e.g. DVMRP, MOSPF)DVMRP, MOSPF)– forward a single packet on multiple interfacesforward a single packet on multiple interfaces– Many routers do NOT do multicast routing and Many routers do NOT do multicast routing and

will drop packetswill drop packets– Routers may “tunnel” multicast packets in Routers may “tunnel” multicast packets in

unicast packets across non-multicast regionsunicast packets across non-multicast regions E.g. MBone = Multicast BackBone (historical)E.g. MBone = Multicast BackBone (historical)

– = Multicast “overlay” network, using unicast wide-area= Multicast “overlay” network, using unicast wide-area

12

Choosing Multicast Addresses (1): Choosing Multicast Addresses (1): Statically allocated Global addresses Statically allocated Global addresses

RFC-1700 / IANA (www.iana.org) RFC-1700 / IANA (www.iana.org) – e.g. e.g. 224.2.0.0-224.2.127.253 Multimedia

Conference Calls – Apply to IANA for an allocationApply to IANA for an allocation

Allocate locally within Autonomous Unit Allocate locally within Autonomous Unit (RFC-3180, “GLOP addressing in 233/8”)(RFC-3180, “GLOP addressing in 233/8”)

13

Choosing Multicast Addresses (2): Choosing Multicast Addresses (2): Administrative Scoped Multicast Administrative Scoped Multicast

Addresses (RFC-2365)Addresses (RFC-2365) Configured in network Configured in network Link-local scope (i.e. LAN)Link-local scope (i.e. LAN)

– 224.0.0.0/24 224.0.0.0/24 i.e. first 24 bits count, like a netmask i.e. first 24 bits count, like a netmask

255.255.255.0255.255.255.0 Local scope (e.g. department)Local scope (e.g. department)

– 239.255.0.0/16239.255.0.0/16 Organisation-local scope (e.g. UoN)Organisation-local scope (e.g. UoN)

– 239.192.0.0/14239.192.0.0/14

14

Choosing Multicast Addresses (3): Choosing Multicast Addresses (3): choosing an address in a rangechoosing an address in a range

Make one up and hope (check w. RFCs & scopes)Make one up and hope (check w. RFCs & scopes) See also See also

http://www.29west.com/docs/THPM/multicast-address-http://www.29west.com/docs/THPM/multicast-address-assignment.htmlassignment.html

Hash to an address range and hopeHash to an address range and hope Optionally augment with a monitoring process Optionally augment with a monitoring process

which detects duplicate use and negotiates a which detects duplicate use and negotiates a change to a new addresschange to a new address– As in the SDR MBone toolAs in the SDR MBone tool

15

Choosing Multicast Addresses (4)Choosing Multicast Addresses (4)

Source-specific multicast address (if supported)Source-specific multicast address (if supported)– RFC-4607 [1-to-many applications only]RFC-4607 [1-to-many applications only]

Dynamically allocated using Multicast Address Dynamically allocated using Multicast Address Allocation ServiceAllocation Service– E.g. SDR MBone tool for MM conferences or E.g. SDR MBone tool for MM conferences or

IETF malloc working group outputs???IETF malloc working group outputs???

16

TTL Scope (How Far do Packets Travel?)TTL Scope (How Far do Packets Travel?) Use IP packet TTL (Time To Live) to determine scope Use IP packet TTL (Time To Live) to determine scope

of sending:of sending:– TTL 0 = on the same machine TTL 0 = on the same machine

iff “loopback” is on for sending socket and (on Windows) iff “loopback” is on for sending socket and (on Windows) an Ethernet interface is “up”.an Ethernet interface is “up”.

– TTL 1 = on the same LAN (esp. Ethernet)TTL 1 = on the same LAN (esp. Ethernet)– TTL >1 = internetworkTTL >1 = internetwork

on a multicast-capable WAN;on a multicast-capable WAN; on the MBone (Multicast Backbone).on the MBone (Multicast Backbone).

– E.g. E.g. 31 = campus? 63 = country? 31 = campus? 63 = country? 127 = continent? 255 = whole world?127 = continent? 255 = whole world?

17

Multicast Research & Deployment IssuesMulticast Research & Deployment Issues Reliable deliveryReliable delivery

– N.B. only a subset of receivers may have N.B. only a subset of receivers may have missed a packet.missed a packet.

Flow and congestion controlFlow and congestion control– N.B. only a subset (one?) of receivers may be N.B. only a subset (one?) of receivers may be

experiencing congestion or buffer overflow.experiencing congestion or buffer overflow.=> lowest common denominator??=> lowest common denominator??

Deployment Deployment – MBone, PIM, native (ISPs??)MBone, PIM, native (ISPs??)– Application-specific bridges and reflectorsApplication-specific bridges and reflectors

18

Process (Agent)World X

Join: TCP state transfer

World multicast group:updates, audio, video.

Data uses Scalable Reliable Multicast (shared NAcks).

Process (Agent)World X

World Y

Example: DIVE System OutlineExample: DIVE System Outline(Swedish Institute of Computer Science, (Swedish Institute of Computer Science,

www.sics.se/dive)www.sics.se/dive)

19

Example: DIVE System BootstrappingExample: DIVE System Bootstrapping

First Agent

World X...

HTTP transfer(c.f. state transfer)

HTTP Server

World X definition

Diveserver

World multicast group

DIVE mgmt.multicast group

World Xmulticast group

(1) Agent locates(1) Agent locates diveserver (m/c). diveserver (m/c).

(2) Diveserver finds(2) Diveserver finds World X’s World X’s multicast group. multicast group.

(3) Agent pings(3) Agent pings multicast group. multicast group.

(4) Agent downloads(4) Agent downloads world definition. world definition.

(5) Agent creates (5) Agent creates world locally. world locally.

(1)(1)(2)(2)

(3)(3)

(4)(4)

(5)(5)(files)