Hacker News new | past | comments | ask | show | jobs | submit login

I don't think multicast significantly reduces bandwidth usage. Traffic needs to go everywhere anyways. It will probably reduce CPU usage since switches (even dumb ones) can just broadcast the packet at line speed, since it's all in the hardware. There's no need for whatever server is distributing the stream to maintain multiple sockets and copy buffers multiple times.



With unicast, the node originating the stream would have n times the traffic, where n is the number of devices pulling the stream. Further from the originating node in the network topology, each edge would transport as many times the traffic as there are listeners whose traffic travels along that edge. That seems very significant.

With broadcast, all the nodes and edges transport the stream only once, but you can only distribute the stream in the same (L3) network, and within that network you transport the stream even through L2 nodes and edges (i.e. network switches, cables, Wi-Fi channels) where there are no listeners at all. You could in theory repeat those broadcast packets into other networks, but you need to set that up more explicitly, and then every node and edge in that network gets the traffic, too.

With multicast, devices and effectively segments can subscribe to the stream, and all nodes and edges transport the stream at most once, and they can do so across network boundaries while retaining the same property, and using a standardized mechanism that is designed to make the traffic only go where it needs to go as much as the topology allows.


anyfoo is correct but it might help to explain the implementation. Multicast IP works in cooperation with IGMP, a protocol that manages "groups" at the IP layer. In a unicast model, a device that wants a stream asks the server for the stream, and the server starts sending the stream to that device. The server maintains n outgoing connections sending n copies of the stream, one for each subscriber.

With multicast, a device that wants to receive the stream uses IGMP to join the group. The IGMP communication is not with the server, but actually with the router serving the subnetwork. Additionally, larger commercial switches usually implement "IGMP snooping" in which the switch "listens in" on IGMP sessions between its clients and the upstream router. The server maintains only one connection and sends only one copy of the stream, to a multicast group address---there are IP ranges reserved for this purpose. The router, and switches which implement IGMP snooping (or layer 3 switches, there are some variations), forward traffic to the multicast group address on any interface on which a client has used IGMP to join the group. Switches without IGMP support will just forward it on all interfaces. The result is that, at each point in the network, only one copy of the stream is handled. This has significant performance benefits for both the server and the network devices.

As the name implies, multicast is much like broadcast except that devices can opt in or out of receiving the broadcast, and network devices can use knowledge of those IGMP sessions to avoid sending multicast traffic on interfaces where no one cares to receive it. That said, multicast traffic going to network segments where it's not used is not especially harmful besides wasting some capacity on that network segment.

Unfortunately multicast is not workable over the internet for reasons which are difficult to overcome, or IPTV and other synchronous media streaming services would be far less costly to run. On an institutional network, though, multicast can be used to great effect. It's a fairly old method as well. In my first IT job we used to install the operating system on workstations by PXE booting them to an imaging tool and then multicasting the disk image across the network... this way we could do hundreds of machines at once at just about disk saturation rate. This kind of thing isn't readily achievable without the use of multicast or broadcast traffic. The tool was Norton Ghost, which has apparently supported this mode of operation since 1998!


Switches can do IGMP snooping so only clients that ask for a specific stream gets it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: