Android UPnP/DLNA servers available through a TUN interface are not detected
#1
I have a MiniDLNA server running on a home workstation and listening on a TUN interface (OpenVPN).

The server is not detected by XBMC/Kodi on my tablet. But if I have it listening on a WLAN interface, it's detected.

I tested UPnPlay to make sure i didn't do anything wrong. And the app detects the server just fine.
Reply
#2
That's how it is supposed to be. Upnp/Bonjour works above udp/ip, while a VPN usually only works over tcp/ip.
Bubbleupnp has a dedicated gateway running on the server to overcome this, but AFAIK it only works with Bubbleupnp.
Reply
#3
(2014-10-21, 07:19)Koying Wrote: That's how it is supposed to be. Upnp/Bonjour works above udp/ip, while a VPN usually only works over tcp/ip.
Bubbleupnp has a dedicated gateway running on the server to overcome this, but AFAIK it only works with Bubbleupnp.

I'm not sure I understand what you mean.

OpenVPN can use both TCP and UDP for transport.

But, Isn't the transport irrelevant here?

Isn't it just a means of transferring encapsulated IP packets (or Ethernet frames) between peers?

Anyway, here is a screenshot of UPnPlay (an Android app). It shows the description of a detected MiniDLNA server listening on a TUN interface (IP: 10.8.0.1).

Image
Reply
#4
Yeah, sorry, I meant multicast packets over udp, used by upnp. See, e.g, https://forums.openvpn.net/topic7498.html for a discussion about this or just plain search for openvpn+upnp
Reply
#5
I decided to investigate this further. And with the help of tshark(Wireshark CLI), it became more clear what's going on.

I tested with three players/controllers:

1) UPnPlay (proprietary, always works)
2) Slick UPnP [uses Cling library] (open-source, rarely works)
3) Kodi (does not work)


On the workstation running the server, I ran tshark listening at interface tun0 to see what's going on.

10.8.0.1 is the IP address of the server's TUN interface (assigned by OpenVPN).
10.8.0.2 is the IP address of the tablet's TUN interface (assigned by OpenVPN).


UPnPlay

tshark output (short):
Code:
10.8.0.2 -> 224.0.0.22   IGMPv3 40 Membership Report / Join group 239.255.255.250 for any sources
.
.
10.8.0.2 -> 239.255.255.250 SSDP 129 M-SEARCH * HTTP/1.1

Broadcast search packet (length 129) works and an HTTP connection is established afterwords.


Slick UPnP

tshark output (short):
Code:
10.8.0.2 -> 224.0.0.22   IGMPv3 40 Membership Report / Join group 239.255.255.250 for any sources
10.8.0.2 -> 239.255.255.250 SSDP 122 M-SEARCH * HTTP/1.1
10.8.0.2 -> 239.255.255.250 SSDP 122 M-SEARCH * HTTP/1.1
10.8.0.2 -> 239.255.255.250 SSDP 122 M-SEARCH * HTTP/1.1

Broadcast search packet (length 122) fails at finding any UPnP server.

The difference between the two packets is the ST field. In UPnPlay, it's "upnp:rootdevice".
In Slick UPnP, it's "ssdp:all".

Why Slick UPnP works on occasion

I noticed that Slick UPnP detects the server sometimes. Especially when I restart the server. It turned out the detection works when the server broadcasts NOTIFY packets:
Code:
10.8.0.1 -> 239.255.255.250 SSDP 386 NOTIFY * HTTP/1.1

Those broadcasts are sent when the server starts. And every 895 seconds after that by default. Luckily, that interval is configurable, so setting it to a lower value like 20 seconds works around the issue.


Kodi

With Kodi, I see complete silence as far as the TUN interfaces go. It doesn't send broadcast searches or react to NOTIFY packets.

However, monitoring the wlan0 interface shows that Kodi is sending broadcasts there with the right ST field.

So, I'm more confident now that the issue with Kodi is indeed ignoring the TUN interfaces.
Reply
#6
I have a similar issue except I'm only using my Synology NAS (with DNLA/UPNP enabled) on a local LAN.

Installed latest Kodi on Windows 8.1 and it detects the Media Server almost immediately.
Installed Kodi on my Sony Experia Z3 Phone and Z3 Tablet (Android 4.4.4) and it takes a long time (over 2 mins every time you launch the app) to detect the Media Server. There are times when Android simply doesn't find the Media Server. However Other Apps such as Sony's Video Player app or 3rd party apps like Moliplayer finds the DNLA server immediately.

Looks like an issue within the Android version of Kodi I think.
Reply

Logout Mark Read Team Forum Stats Members Help
UPnP/DLNA servers available through a TUN interface are not detected0