UdpClient JoinMulticastGroup TTL > 1?

Alex 1 Reputation point
2021-03-23T20:54:41.063+00:00

Hi all,

I have a couple questions about the TTL parameter for JoinMulticastGroup. The documentation says the TTL parameter is measured in router hops. I set the parameter to 10, but when I examine the IGMPv2 join packet in Wireshark, I see the "Time to live" = 1, and from my research, I believe the TTL for IGMP join packet can only be 1 as designed.

The response in this archived post also confirms TTL can only be 1: https://social.msdn.microsoft.com/Forums/en-US/adff7ed7-5c93-4dc4-92a4-6dff78108418/udpclientjoinmulticastgroup-ignores-ttl-value?forum=ncl

If my belief is true that the TTL of the join packet is always 1, then what is the TTL parameter of the JoinMulticastGroup really for?

Here is my code so far

 UdpClient udpClient = new UdpClient();  
        // Creates an IPAddress to use to join and drop the multicast group.  
        IPAddress multicastIpAddress = IPAddress.Parse("239.192.16.107");  
        udpClient.Client.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.IpTimeToLive, 10);  
        udpClient.Client.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 10);  
        udpClient.Ttl = 10;  
        // The packet dies after 10 router hops.  
        udpClient.JoinMulticastGroup(multicastIpAddress, 10);  

 

80813-image.png

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,279 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.