2

When joining a multicast group, what effect does the IP_MULTICAST_TTL have when receiving datagrams?

Multicast in Python has one of the answers with a TTL as 32 on the receiving side (and IP_MULTICAST_LOOP as 1), but I'm having a hard time figuring out why.

I was reading Multicast Programming and I don't understand why TTL and LOOP are necessary for the receiver.

When you receive a multicast, I thought you just tell the kernel to join a multicast group and it will then bind the port the data is being sent to.

As a receiver, do you also send data out when receiving a multicast? Is this why IP_MULTICAST_TTL and IP_MULTICAST_LOOP are set when receiving? Can you influence a network by just joining a multicast group?

Thanks

1 Answer 1

2

It won't prevent you from receiving multicast messages per se, but it may influence the reach of the IGMP message that gets sent out when you join the mcast group (which is sent as a result of calling setsockopt with the IP_ADD_MEMBERSHIP flag).

So if there's an upstream router that is participating in the multicast network, it may not receive your join request if the TTL is too low. Subsequent incoming multicast messages to your joined address may not get routed to you if the intermediate router doesn't know you've joined the group.

The LOOP option isn't relevant if you don't send anything.

2
  • Thanks for your answer. So I started looking into IGMP messages, and Sniffing IGMP messages on the local network says that the TTL is always one for IGMP. Does that include the join request? Will the IP_MULTICAST_TTL value actually affect the IGMP message's TTL? Also, can there possibly be a router/network configuration where a TTL of 1 (the default here) when joining can cause the network to go down/get super congested? Jul 22, 2014 at 14:07
  • Maybe each upstream router is supposed to forward the request? I don't know. Read up on IGMP - I'm sure its well defined how its supposed to work.
    – selbie
    Jul 22, 2014 at 19:59

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.