190 likes | 225 Views
IP Multicast. G53ACC. Chris Greenhalgh School of Computer Science. 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. What is Multicasting?.
E N D
IP Multicast G53ACC Chris Greenhalgh School of Computer Science
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
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)
Multicasting example Host Host Host P Host P P P P P Router Host LAN LAN P Forwards P if required joined G, sees P Host P P P Joined G, sees P Host Host Sends P to multicast group G Network interface ignores P
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), multi-played games, jam sessions. One-to-any / many-to-one (“any-cast”) resource discovery, data collection, auctions Multicast Applications
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)
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;}
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
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...)
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)
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
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”)
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
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-address-assignment.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
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???
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?
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
World X Example: DIVE System Outline(Swedish Institute of Computer Science, www.sics.se/dive) Process (Agent) Process (Agent) World X Join: TCP state transfer World Y World multicast group: updates, audio, video. Data uses Scalable Reliable Multicast (shared NAcks).
Example: DIVE System Bootstrapping (1) Agent locates diveserver (m/c). (2) Diveserver finds World X’s multicast group. (3) Agent pings multicast group. (4) Agent downloads world definition. (5) Agent creates world locally. DIVE mgmt. multicast group Diveserver World multicast group First Agent (1) (2) World X... HTTP Server (3) World X definition (5) World X multicast group (files) (4) HTTP transfer (c.f. state transfer)