The way an IP packet delivered from server to client or vice versa is mostly known as unicast delivery. A server will need to know the client’s IP Address and assign this client’s IP address to the IP packet to be delivered. The more clients the server has, the more packets should be created and more bandwidth consumed.
Multicast works by sending an IP packet to a multicast IP address and client will listen to this multicast IP address to receive the IP packet. There is no need for the server to create multiple IP packets as the multicast IP address will send this packet to all of the clients.
Think of multicast like a radio broadcast. The radio station will send its program to particular radio channel and the receiver just need to tune-in to the radio channel to get the message.
Multicast was introduced by Steve Deering in RFC 1112 titled Host Extensions for IP Multicasting in 1989.
The multicast IP addresses range is 188.8.131.52 – 184.108.40.206. Below are few of multicast IP addresses that are commonly known:
220.127.116.11 - All multicast hosts. 18.104.22.168 - All multicast routers. 22.214.171.124 - All OSPF Routers. 126.96.36.199 - All OSPF DR Routers. 188.8.131.52 - All RIPv2 routers. 184.108.40.206 - All EIGRP routers. 220.127.116.11 - PIMv2. 18.104.22.168 - VRRP. 22.214.171.124 - IGMPv3 (SSM). 126.96.36.199 - HSRPv2 / GLBP. 188.8.131.52 - Cisco multicast AUTO-RP-ANNOUNCE. 184.108.40.206 - Cisco multicast AUTO-RP-DISCOVERY.
Interestingly, unicast routing protocol (OSPF, EIGRP, and RIP) utilizes multicast to communicate between their peers. It really make sense to use multicast to talk to relevant peer rather than using unicast (or even broadcast) which rather inefficient. Using multicast will make the communication exclusive and avoid sending the packet to non-relevant end.
Multicast is used commonly in an area where traffic is exclusive to its member and unidirectional. For example video stream, using multicast will only require the source to generate 1 stream and send it to the multicast address and the client will just need to join the multicast address to view the video content. No multiple streams required for many clients. Similar approach is used for TV broadcast and stock ticker application.
The traffic flows from Sender (S) or we usually call it Server and it is unidirectional (with the exception PIM-Bidir), Client will never send multicast packet to the Group (G) as the client will only join the Group and listen.
There is also a specific MAC address to be used in relevant to the IP address. For example, a Sender is sending a packet to a multicast group 220.127.116.11, in Layer 2 domain, this will be translated to 01-00-5E-81-01-01. The first 25 bits are always 0000 0001 . 0000 0000 . 0101 1110 . 0 and the rest of the bits are the translation of the last 23 bits of the IP address. Look at the break down below.
First 25 bits multicast MAC address = 0000 0001 . 0000 0000 . 0101 1110 . 0 18.104.22.168 (dec) = 1110 0000 . 0000 0001 . 0000 0001 . 0000 0001 (binary) Take last 23 bits = XXXX XXXX . X000 0001 . 0000 0001 . 0000 0001 Combined (bin) = 0000 0001 . 0000 0000 . 0101 1110 . 0000 0001 . 0000 0001 . 0000 0001 Combined (hex) = 0 1 . 0 0 . 5 E . 0 1 . 0 1 . 0 1
Let’s do another example for 22.214.171.124.
First 25 bits multicast MAC address = 0000 0001 . 0000 0000 . 0101 1110 . 0 126.96.36.199 (dec) = 1110 0000 . 1000 0001 . 1000 0001 . 1000 0001 (binary) Take last 23 bits = XXXX XXXX . X000 0001 . 1000 0001 . 1000 0001 Combined (bin) = 0000 0001 . 0000 0000 . 0101 1110 . 0000 0001 . 0000 0001 . 0000 0001 Combined (hex) = 0 1 . 0 0 . 5 E . 0 1 . 0 1 . 0 1
It appears that both 188.8.131.52 and 184.108.40.206 have exactly the same MAC address! So does anything on the first octet of the IP Address will not be translated and will also have the same MAC address. This is something to keep in mind when designing the multicast network or creating multicast application.
Since the MAC address is now predictable, there are two benefits implied:
- Multicast source or sender has to deliver only a single frame to the multicast MAC address group for the members to receive.
- Since the MAC address is always known, ARP is not required. In the same subnet, There is no other protocol required to deliver the multicast message.