Wednesday, July 24, 2013

Why IP Multicast - My take

When I started my career, I did an initiative on IP multicast and since then I have been working on this technology. There are various articles and blogs in the net that defines IP multicast. I decided to attempt to provide simple explanation. I hope you will let me know if I have succeeded or not. So here we go.

When a PC wants to communicate with a specific PC, it uses Unicast. This is similar to you writing a letter and posting it to your father.

When a PC wants to communicate with all the PCs in a network, it uses Broadcast. This is similar to you writing a letter and a copy is sent to all the people.

Multicast is somewhat in the middle. When a PC wants to communicate with a specific set of PCs in a network, it uses Multicast. This set may contain all the PCs in the network.This is similar to you writing a letter and a copy is sent to only sepecific set of people who want to receive your letter.

I am sure after reading this, the next question is why do we need Multicast? Why not use Broadcast itself? I completely agree. We can use Broadcast instead of Multicast. But is not there a catch? Yes, there surely is. Otherwise people would not have spent time, energy and lots of Rupees in creating Multicast. Here are the two which I could think of:
  1. To receive Multicast traffic, a receiver specifically indicates that it wants to receive the traffic. So CPU of a receiver will not see the Multicast traffic if it has not wished to receive it. While in case of Broadcast traffic, receivers of all CPU
  2. There are only two broadcast addresses and only one can be routed. While there are 2^28 or 268,435,456 Multicast addresses to choose from and except 255 ( 224.0.0.0 to 224.0.0.255) multicast addresses, all others can be routed. So applications can choose from a wider range of addresses in case of Multicast.
Now we know Broadcast cannot be used and we need something special like Multicast. To start with, Multicast was designed to help in one-to-many communication. Later it was extended to support many-to-many communication. In multicast, sender sends out one single packet and routers forward them towards the receiver. A router replicates a packet if it has receiver on multiple interfaces and send one packet towards each receiver. I will talk about Protocols used in IP multicast in future posts.

So how actually Multicast helps in a network? Here are the most visible aspects:
  1. A server needs to send out only one copy of the packet if Multicast is used. If unicast would have been used instead, server would have to send out as many copies as the number of receiver. Right.
  2. Network bandwidth is saved. Because server sends only one copy out instead of as many as the number of receiver.
  3. As the overall number of packets in the network is reduced, it also helps in avoiding network congestion.
I did not use any network topology to put across my points. It could be a problem but I feel that it will be more satisfactory if you can visualize the whole thing with your strong visualizing capabilities.

I shall be talking more about IP multicast in upcoming posts so stay tuned.

4 comments:

  1. Very nicely written bog Bharat. You have explained the the concept of multicast in a very simple to understand manner. Thank you. Looking forward for more. .

    ReplyDelete
  2. Just curious to know, what is the broadcast address which can be routed? Until now, I was thinking that packets to broadcast addresses will not be forwarded by the routers. Thanks.

    ReplyDelete
    Replies
    1. There are two types of broadcast address. Limited broadcast address which is 255.255.255.255 and directed broadcast address which is 10.0.0.255 for a subnet 10.0.0.0/8. Routers drop packet destined to limited broadcast address while they can forward the packets destined to directed broadcast address.

      Delete