I'm talking about IPv4. If not, does the host use 2 IP addresses, one for multicast communication and one for "regular" communication?
1 Answers
No. And, IP multicast addresses have a special range (e.g. 239.x.x.x) that would be illegal as a host address. You just do the setsockopt
with IP_ADD_MEMBERSHIP
and you're done. And, if you really think about it, changing the IP would mean that all regular traffic would stop.
What you're doing is saying that you would like the interface [via the socket] to listen for and process packets for the given multicast address, in addition to its regular interface address. It's slightly more complex than that, but close enough.
IIRC, if a system [host0] has two interfaces (e.g. NIC cards), say eth0 and eth1, and eth0 has the semi-direct connection to a given multicast, and there is a host1 connected to host0 via eth1, and host1 can only get to the multicast via host0, host0 will have to subscribe to the multicast, not for itself, but on behalf of host1, and forward the packets on eth1.
![](../../users/profiles/313565.webp)
- 524
- 2
- 5