none
Problem with receiving of the UDP multicasting on multiple interfaces in the W2K12 cluster RRS feed

  • Question

  • Hi,

    I have my .NET application which receives the UDP multicasting communication. It works fine until it is deployed on a W2K12 cluster. Some multicast groups are still available and some are not in the cluster. The problem is caused by the cluster which creates a virtual interface for a inter-node communication. When the cluster is on and my app is trying to subscibe to the affected group then IGMP packets are routed to the cluster's virtual interface where the multicast communication is not available. When the cluster (cluster service) is off all groups are available and IGMP is routed to a right interface.

    I also have a different application which is not based on .NET and it receives all multicast groups in any deployment (same W2K12 clustered server). So, I guess that in my app I have to tell to the socket somehow, which local interface should be used for a particular multicast group. In my app I use code below for a group subscribtion, but I still can't manage routing of IGMP to a right local interface. Can you help me?

    As you can see in the code example I try to mapp a group to a local interface using its IP and index using MulticastOption class, but it has no effect. Different interface (cluster's virtual interface) is used for a IGMP subscribtion. I also tried to bind\set local interface to Any, but without success.

    It seems that there is some OS logic which overrides my setup. But, it must be possible to do the socket setup correctlly because non .NET application works fine.

    Thanks.

    Regards,

    Marek

    		public void Start(string[] args)
    		{
    			//args[0] - multicast group
    			//args[1] - multicast port
    			//args[2] - local interface IP
    			//args[3] - local interface index
    
    			UdpClient udp = new UdpClient();
    			udp.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
    			udp.Client.Bind(new IPEndPoint(IPAddress.Parse(args[2]), Convert.ToInt32(args[1])));
    				
    			MulticastOption mcastOption = new MulticastOption(IPAddress.Parse(args[0]));
    			mcastOption.LocalAddress = IPAddress.Parse(args[2]); 
    			mcastOption.InterfaceIndex = int.Parse(args[3]);		
    			udp.Client.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, mcastOption);
    
    			udp.BeginReceive(new AsyncCallback(Receive), udp);
    		}


    • Moved by Shawn Zhao Tuesday, October 14, 2014 5:26 AM
    • Edited by Marek Cvrk Tuesday, October 14, 2014 10:33 AM Update
    • Moved by Caillen Tuesday, October 28, 2014 5:49 AM
    Monday, October 13, 2014 3:43 PM

Answers

All replies

  • Hello mcvrk,

    Have you tried join the group with the UdpClient.JoinMulticastGroup method?

    UdpClient.JoinMulticastGroup Method (IPAddress)


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 17, 2014 2:40 AM
  • Hi Caillen,

    yes, I have tried it. It was my original implementation of the multicast group subscribtion but it doesn't work (in the cluster environment). Than I turned to the implementation with the MulticastOption class as described in my example. It seems as a wider interface where a multicast group can be mapped to some local interface. I guess that JoinMulticastGroup method involves some similar implementation as in my example.

    Regards.

    Marek

    Friday, October 17, 2014 6:58 AM
  • I don’t know if it will help you but I can illustrate my problem on the following prints from netsh and route tools. First print from netsh shows that the affected group 224.0.46.232 is assigned to interface 20. Second print shows that interface 20 is Microsoft Failover Cluster Virtual Adapter where multicast communication is not available.

    When the test app, which works fine, is used than these prints show that group 224.0.46.232 is assigned to interface 19 - Microsoft Network Adapter Multiplexor Driver, where multicast communication is available.

    So, the question is how to manage these „prints“ to requested setup in .NET.

    Regards,

    Marek

    C:\Windows\system32>netsh interface ip show joins

    Interface 1: Loopback Pseudo-Interface 1
    Scope       References  Last  Address
    ----------  ----------  ----  ---------------------------------
    0                    0  Yes   239.255.255.250

    Interface 20: Local Area Connection* 12
    Scope       References  Last  Address
    ----------  ----------  ----  ---------------------------------
    0                    0  Yes   224.0.0.1
    0                    1  Yes   224.0.0.252
    0                    1  Yes   224.0.46.232

    Interface 19: Public
    Scope       References  Last  Address
    ----------  ----------  ----  ---------------------------------
    0                    0  No    224.0.0.1
    0                    1  No    224.0.0.252
    0                    0  Yes   239.255.255.250

    C:\Windows\system32>route print
    ===========================================================================
    Interface List
    19...3c d9 2b ef 8a ec ......Microsoft Network Adapter Multiplexor Driver
    20...02 91 08 09 1a ae ......Microsoft Failover Cluster Virtual Adapter
      1...........................Software Loopback Interface 1
    16...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
    21...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
    ===========================================================================

    Friday, October 17, 2014 7:32 AM
  • Sorry, but I don't know much about networking, I think you could check how the application that is not in .net works, by checking the source code of it or the configuration files.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    • Edited by Caillen Monday, October 27, 2014 9:29 AM
    Monday, October 27, 2014 9:28 AM
  • Hi Caillen,

    I checked non .NET application. It is written in C++, so it is not fully comparable with my .NET application. It seems to me that multicast subscribtion is done in the same fasion as in my .NET application but it works differently.

    BTW: Is this forum suitable for solving of this sort of problem (network issues)?

    Best regards,

    Marek

    Monday, October 27, 2014 10:16 AM
  •  

    This forum is for questions about Visual C# language, it's not a suitable place for network questions. There was a Network Class Library (System.Net) forum, but it's archived. So I'm not sure which one is the best.

    I'm moving your question to [where is the forum for...] forum where moderators there may give you better ideas.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Caillen Tuesday, October 28, 2014 5:49 AM
    Tuesday, October 28, 2014 5:48 AM
  • According to the announcement in that retired forum they suggest posting here now.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wcf

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Tuesday, October 28, 2014 9:38 AM
    Moderator