Jump to content

uPnP does not work properly in 1.8.x builds


blackbox

Recommended Posts

Hi, it seems I found a bug with UPnP port forwarding in µTorrent.

Latest stable version 1.7.7 opens TCP port with the entry name "uTorrent". It allows me to pass the port check at http://www.utorrent.com/testport.php?port=xxxxx and the icon in status bar turns green.

Build 8192 didn't seem to forward the port properly, as the icon stayed red and online port check failed.

Build 9137 creates port forwarding entry in my router, but only for UDP (entry name is "uTorrent (UDP)"). Online port check fails and the status bar icon is blank for some reason.

If I go to the XP's "Internet Connection" properties and change the port forwarding entry type from UDP to TCP manually, it works.

After updating to latest beta I tried deleting settings.dat, but it didn't help.

Here is the UPnP log:

[noparse][18:16:19] UPnP(XP): TCP port 17265 -> 192.168.1.33:17265 mapped successfully.

[18:16:21] UPnP(XP): UDP port 17265 -> 192.168.1.33:17265 mapped successfully.

[18:16:22] UPnP: Discovered host: http://192.168.1.1:80/DeviceDescription.xml

[18:16:23] UPnP: Discovered new device: "ADSL Modem IGD" http://192.168.1.1:80/UD/?3

[18:16:23] UPnP: Getting external IP

[18:16:23] UPnP: Got external IP: 10.105.45.80[/noparse]

As you can see, no port forwarding for TCP is done.

I use XP SP2 (same results with Vista SP1) and my router is ADDON GWAR3500 (based on TrendChip).

Link to comment
Share on other sites

Yes, I meant build 8912 instead of 8192. If I understand changelog correctly, b9137 should create two port mappings - TCP and UDP. However, it creates only one for UDP.

I didn't try the program you suggested, but all other UPnP-aware programs work well with my router. For example, eMule creates two port mappings - "eMule (UDP)" and "eMule (TCP)".

Link to comment
Share on other sites

Sorry, I'm new to Wireshark and can't seem to find how to filter SSDP requests. There is a text field "Filter" on the toolbar and corresponding dialog box, but neither of these list SSDP as a supported protocol. So I used NirSoft SmartSniff to see what's going on and there are indeed two AddPortMapping requests, both successful.

However, if I open the "Internet connection" properties, there is only one UDP mapping visible.

It's interesting to note that svchost.exe keeps two simultaneous connections to the router, and both port mapping requests use different connections. Maybe when the router receives a request before completing previous one, it "forgets" the first port mapping?

Anyway, I'd like to stress again that even if this is a router bug, eMule is able to add two port mappings.

I tried disabling XP's UPnP service to see if it makes any difference, and µTorrent created port mappings on its own. However with UPnP interface disabled I can't see the port mappings, because my router doesn't show them in the web interface. But online port check still fails, so I assume that TCP forwarding didn't take place.

I also searched the forum and this thread looks very much like what I have.

Link to comment
Share on other sites

I monitored eMule's activity and there's one obvious difference: it uses single Keep-Alive connection, instead of multiple connections like µTorrent. It also makes some additional requests:

GET /WanDslLink.xml, GET /WanIpConn.xml and POST ... SOAPAction: "urn:schemas-upnp-org:service:WANIPConnection:1#GetStatusInfo" (I can post the full log if necessary).

It all results in a significantly longer initialization, but all port mappings are done properly.

I'm pretty sure that it's single connection that makes a difference.

Link to comment
Share on other sites

Anyway, there must be some explanation why one program manages to set up port forwarding properly and the other doesn't :)

I can do more packet sniffing or logging if necessary.

Added 04.04.2008:

Ok, I did more testing and it turns out that my router doesn't like when two port mappings (for TCP and UDP) are made on the same port. The second mapping succeeds, but overwrites the first one.

As TCP mapping is followed by UDP, it gets overwritten and no TCP forwarding is taking place, leading to unconnectable state and low speeds.

Because of that, I'm stuck with 1.7.7 as I can't get acceptable speeds with 1.8.0.

Is it possible to implement a workaround for this router bug?

I think there are at least two ways this could be done:

[ul][li]change the order of mapping requests (first TCP, then UDP) - this will cause UDP mapping to be overwritten, but at least TCP will be connectable;

[/li][li]disable UDP mapping altogether, reverting to 1.7.* behavior (via an advanced setting of course)[/li][/ul]

Link to comment
Share on other sites

  • 3 months later...

i can confirm that this bug still hasn't been resolved as of 1.8 build 11564. i see a lot of entries in the changelog relating to trying to fix this, but you simply can't--some routers are just fucked up. as the OP said, there needs to be a option to only map TCP with UPNP.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...