2

So I am having a hard time finding materials online that explains how multicast address are set. I understand what unicast is: Basically one to one communication. In this scenario, an address identifies one unique host. So setting the address for this, is simple. You assign that unique address. I understand what the broadcast: basically one to many/all. In this scenario, the broadcast address is basically an address you send to, that ensures that your message is sent to all hosts on the link. So setting or using this address is simple, in layer 2, you just send to FF:FF:FF:FF:FF:FF or the last IP address of a subnet. I understand what multicast communication is: Basically instead of flooding all the host, you send message to a selected host. So, a one to selected model, where only hosts that have "subscribed" to the message. I also understand that there are addresses designated for this kind of communication. For example with IPv4, multicast address has most-significant bit pattern of 1110 (i understand similar categorization exist in IPv6). For Ethernet, Ethernet frames with a value of 1 in the least-significant bit of the first octet of the destination MAC address are treated as multicast frames.

My question is, how does a host subscribe to be part of a multicast? Most of the material I see explaining this concept leaves this part out!

Also is it possible to have multiple multicast on a single switch/link. If so how are these different multicast groups managed and kept isolated etc.

1
  • There are lots of pieces to multicast, and multicast routing is very different than unicast routing. Basically, unicast routing is designed to get packets to the destination, while multicast routing is designed to prevent packets from going where they are not wanted.
    – Ron Maupin
    Commented Mar 17, 2020 at 12:53

2 Answers 2

5

An IP multicast router (usually that's a switch) announces available groups using membership queries. A host subscribes to some of these groups by sending a membership report. Unsubscribing works by sending a leave group or when the subscriber doesn't refresh its membership and the router's timer kept for each host runs out (after max response time).

IGMPv2 is defined in RFC 2236.

3

The internal mechanisms depend on the specific OS, but in general, the application binds a socket to a specific multicast address, just as it would for unicast. The OS then:

  • keeps track of this -- it'll need it later
  • sets the NIC multicast address filter
  • sends a "JOIN" message immediately, and subsequently sends membership reports when it receives a group membership query
  • and finally sends a "LEAVE" message when the socket closes

Some lesser NICs have no multicast address filter; they can either block or allow all multicast traffic. All NICs have a limited number of address slots (the aforementioned 0, 4, 12, 16, etc.), so attempting to listen to too many groups can result in the filter being turned off.

Switches use a feature call IGMP Snooping to know what traffic needs to go where. If a host doesn't include a group in its membership report, the upstream switch(es) can prune any unnecessary multicast traffic. This is very useful to reduce traffic on inter-switch links.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.