[fixed] Client : Connetion to server problem with multiple network interfaces (3 Viewers)

Smeulf

Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: Client can't find Server

    Hi everybody,

    I'm just collecting my first MP2 experience and I must say, I'm really impressed! Congratulations to this excellent piece of software!

    But I have one problem and I hope somone can help me with it: When I run the Client and the Server on the same machine, everything works without problems. When I start the client on a different machine, it doesn't find the server. What I did is:

    Start MP2-Client
    Go to: Settings -> General -> Home Server -> Search for Servers
    It tells me "Currently, there is no MediaPortal 2 Server available in the network"

    (ClientLog attached, Client Error.log is empty)

    But there is! None of the machines is running a firewall or the like, I can ping them with IPv4 and IPv6. Can I somehow manually enter the Server address? I can't find a configuration file to do this (maybe "MediaPortal.UI.ServerCommunication.Settings.ServerConnectionSettings"? But I don't know what to put into that file...).

    Any help appreciated and keep up the good work!
    Michael

    Hi MJGraf,

    If I well reads your logs, you have multiples network interfaces on your client (Maybe you have something like some Virtuals Machines on your computer ?). This is an issue we already have seen before : https://forum.team-mediaportal.com/submit-bug-reports-532/client-connetion-server-problem-92816/

    If you have 2 physical different computers, can you try to disable the unneeded network interfaces ?

    If you use Virtual Machines, can you try to used "Network Bridge Mode" with your physical network card only and disable all unneeded interfaces ?

    If this is the same issue, I may merge your post in the bug section into mentionned post.

    Cheers.

    Smeulf.
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Re: Client can't find Server

    Hi Smeulf,

    you're right! I used two physical machines, but on both of them was some kind of vmware installed. The old VMWare Server 2 on the MP2-Server-Side and VMWare Player on the MP2-Client-Side. I had to disable vmnet1 and vmnet 8 on both sides and since then it works!

    Thanks a lot,
    Michael
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: Client can't find Server

    Hi Smeulf,

    you're right! I used two physical machines, but on both of them was some kind of vmware installed. The old VMWare Server 2 on the MP2-Server-Side and VMWare Player on the MP2-Client-Side. I had to disable vmnet1 and vmnet 8 on both sides and since then it works!

    Thanks a lot,
    Michael

    Ok, thanks for the confirmation, and for the report. I'll do some research to try finding out where the problem is, bacause it's definitely an issue.

    In the meantime, you are 100% allowed to continue testing and report bugs :)

    I'll merge both threads later.

    Cheers.

    Smeulf.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: AW: Re: AW: Client : Connetion to server problem

    Hi,

    I made some progress about this issue, by adding some extra log messages. (tests are done with both client and server on the same computer, the computer have 3 network interfaces, the real one have the address 192.168.0.10)

    I can see the client requesting for UPNP devices for all interfaces :

    Code:
    [2011-10-02 20:27:04,126] [5248   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint fe80::f0a3:19ec:8381:3b86%25:63196 to Multicast address:port ff02::c:1900
    [2011-10-02 20:27:04,641] [5763   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint fe80::287b:3381:a742:fe36%12:63197 to Multicast address:port ff02::c:1900
    [2011-10-02 20:27:05,156] [6278   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint fe80::9885:38:5d8c:7a54%10:63198 to Multicast address:port ff02::c:1900
    [2011-10-02 20:27:05,671] [6793   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint fe80::b1cf:9556:49ee:7f3c%24:63199 to Multicast address:port ff02::c:1900
    [2011-10-02 20:27:06,186] [7308   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint 192.168.20.1:63200 to Multicast address:port 239.255.255.250:1900
    [2011-10-02 20:27:06,700] [7822   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint 2001:0:5ef5:79fd:287b:3381:a742:fe36:63201 to Multicast address:port ff05::c:1900
    [2011-10-02 20:27:07,215] [8337   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint 192.168.0.10:63202 to Multicast address:port 239.255.255.250:1900
    [2011-10-02 20:27:07,730] [8852   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint 192.168.235.1:63203 to Multicast address:port 239.255.255.250:1900
    [2011-10-02 20:27:08,245] [9367   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint fe80::f0a3:19ec:8381:3b86%25:63196 to Multicast address:port ff02::c:1900
    [2011-10-02 20:27:08,760] [9882   ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint fe80::287b:3381:a742:fe36%12:63197 to Multicast address:port ff02::c:1900
    [2011-10-02 20:27:09,274] [10396  ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint fe80::9885:38:5d8c:7a54%10:63198 to Multicast address:port ff02::c:1900
    [2011-10-02 20:27:09,789] [10911  ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint fe80::b1cf:9556:49ee:7f3c%24:63199 to Multicast address:port ff02::c:1900
    [2011-10-02 20:27:10,304] [11426  ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint 192.168.20.1:63200 to Multicast address:port 239.255.255.250:1900
    [2011-10-02 20:27:10,819] [11941  ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint 2001:0:5ef5:79fd:287b:3381:a742:fe36:63201 to Multicast address:port ff05::c:1900
    [2011-10-02 20:27:11,334] [12456  ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint 192.168.0.10:63202 to Multicast address:port 239.255.255.250:1900
    [2011-10-02 20:27:11,848] [12970  ] [Main     ] [DEBUG] - SSDPClientController: Send Multicast request from local endpoint 192.168.235.1:63203 to Multicast address:port 239.255.255.250:1900

    But the server see only those requests :

    Code:
    2011-10-02 20:28:25,802] [93695  ] [11       ] [DEBUG] - SSDPServerController: SearchResponse delayed from remote fe80::f0a3:19ec:8381:3b86%25, local address used for response is fe80::f0a3:19ec:8381:3b86%25
    [2011-10-02 20:27:25,283] [33176  ] [13       ] [DEBUG] - SSDPServerController: SearchResponse delayed from remote 192.168.235.1, local address used for response is 192.168.235.1

    I tried to delay the client's requests by 500ms between eatch, but it has no effect. I wonder if the problem is because the port is buzy or if it's because the broadcast address used is the same...

    Any idea from a network specialist is welcome.

    Cheers.

    Smeulf.
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Re: Client can't find Server

    Thanks for your efforts Smeulf,
    wour work is much appreciated. Will continue to test around as time permits and report. If there'r anything I can help with, let me know.
    Best,
    Michael
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: AW: Client : Connetion to server problem with multiple network interfaces

    What network interfaces are on your test machine?

    After a normal installation of VMWare, the interfaces are (I would say the * marked address are the ones saw by the server)

    Physical Connection :
    IPv4 = 192.168.0.10
    IPv6 = fe80::9885:38:5d8c:7a54%10

    VMware Virtual Ethernet Adapter for VMnet1 :
    IPv4 = 192.168.235.1 (*)
    IPv6 = fe80::b1cf:9556:49ee:7f3c%17

    VMware Virtual Ethernet Adapter for VMnet8 :
    IPv4 = 192.168.20.1
    IPv6 = fe80::f0a3:19ec:8381:3b86%19 (*)

    As always, disable the interface solve the problem.

    I also tried to add multiples IP address to the same interface : no problem in this case if VMWare interfaces are down.

    This evening, I'll try with 2 physical interfaces to see how it works.

    I'l keep you posted.

    Cheers.

    Smeulf.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: AW: Client : Connetion to server problem with multiple network interfaces

    Hi,

    Test done : With 2 physical network interface on the same computer (Wired + WLAN, on the same subnet or not), only one receive the search request from the client.

    From what I see, everything is ok with the creation of the sockets.

    I'm a bit surprised with this result, I was more thinking about a specific problem with virtual interfaces... I'll keep trying to understand what is happening, but I must admit for now, I don't have ideas.

    You can get the modified sources here if you want to try by yourself or to check my code : https://github.com/Smeulf/MediaPortal-2/tree/20111002_MultiNetworkInterfaceIssue

    Cheers.

    Smeulf.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: AW: Client : Connetion to server problem with multiple network interfaces

    Well, finally it seems I got it !

    It's definitely a bug : When you multicast a packet from a socket, unless you select the network interface to use in the socket options, Windows will use the 1st interface witch is multicast enable. It result all the multicast request are always sent with the same interface, and if the interface is a virtual one, not really connected, the request may not be send to the remote host.

    To solve this, it's enought to set the interface address (for IPv4) or address.scopeId (for IPv6) in the sockets options used with the binded socket.

    Before my fix, there was only 2 links in rootEntry.AllLinks (in SSDPClientControler / line 680), after my fix I can now see 6 links (3 for IPv4 and 3 for IPv6), witch now makes sence.

    See my attached patch.

    Further test are welcome, but on my side it works nicely. I just hope there is no more bugs hidden in this library :p...

    MJGraf, is it possible for you to test it on your side too, with all virtual interfaces enabled on both client and server ? And BTW, thanks again for pointing out this issue too :)

    Cheers.

    Smeulf.
     

    Attachments

    • 0001-UPnP-library-Force-address-for-outgoing-multicast-re.patch
      2.6 KB

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    46
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: Client : Connetion to server problem with multiple network interfaces

    Thanks very much, Smeulf! You're the best! We had that problem for years now! :)
    I've just pushed your change to Github. I've also applied your change to the GENA socket config method.

    :D
     

    Users who are viewing this thread

    Top Bottom