none
UDP Multicast with two network interfaces. RRS feed

  • Question

  • Hi,

    I'm working on a UPD Lan Messenger. I trying to do a part where I can multicast to all the clients. Our machines are connected to a VPN most of the time. When I try to send and receive a message to the multicast IP. The receiving application does not get it. If I try  to disconnect all the machines from the VPN and try the application it works. When we are connected to the VPN, the machines have two interfaces. I did a bit of researching and got a code to find the local interface(one bound to local ip) and tried to send the message through that interface. But my attempt was a fiasco. Could you guide me. I post the part of code soon.

    Saturday, March 16, 2013 5:56 PM

Answers

  • Can you run the following in a cmd.exe window and post the results

    IPCONFIG /ALL > c:\temp\ipconfig.txt

    The results will be sored in a file ipconfig.txt

    1) first solution

    There is probably an issue with the masks that you are using on the two network cards.  The interface card you are using as a backbone should have a mask of 0.0.0.0.  The 2nd netwrok card should have a mask more restrictive like 192.1.1.10 with a mask 255.0.0.0.  The second interface will get on IP address starting with 192.X.X.X and all other data will go out the first interface with default mask of 0.0.0.0

    2) Second solution

    Another thing to check is your endpoint in the line below

    LocalHostIP = LocalHostIPEntry.AddressList[0];

    The address list is an array that contains the loopback address (127.0.0.1) and each of the network cards on the PC.  If you want to send multicast to one network card then you must use the correct end point to make sure it gets out the proper interface card.

    Note : If you make the mask 0.0.0.0 the mustlicast wil automatically be send out this interface.  if you don't then yo uhave to make sure you select the correct endpoint to get the multicast out the interface.  When you change the mask or IP address on the PC make sure your reboot the PC to make sure the change takes affect.


    jdweng

    Saturday, March 16, 2013 10:10 PM