Chapter 21. Multicasting In the previous chapter, we discussed using broadcasting to transmit a UDP message to all hosts on the local area network. The examples in that chapter revealed two of broadcasting's greatest limitations: the fact that it cannot be routed beyond the local subnet and its inability to be targeted to selected hosts . Broadcasting is strictly an all-or-nothing affair and works only across the local subnetwork. This chapter discusses multicasting, a newer technology designed specifically for streaming video, audio, and conferencing applications. Unlike broadcasting, multicast messages are routable; that is, they can be transmitted across subnet boundaries or even across the Internet. Furthermore, multicasting gives you great flexibility in selecting which hosts will receive particular messages. A single multicast message created by a host will be cleverly replicated by routers as needed, and delivered to a single recipient, or a dozen , or thousands. This chapter describes multicasting, how it works, and how to use it in your applications. As a practical example, we use multicasting to reimplement the chat server from Chapter 19. |