UPnP NAT Traversal for 3G/4G Wireless Data Connection on Android
Asked Answered
S

3

2

Is there any way to use UPnP for NAT traversal on Android with a 3G/4G connection, and if so, is it carrier dependent?

Sirree answered 24/4, 2012 at 4:30 Comment(0)
S
6

No, for the time being thee is no way to do that, for the simple reason that the mobile carriers don't use residential-class NATs - what they have is "Carrier-Grade NATs" CGN, see here http://en.wikipedia.org/wiki/Carrier-grade_NAT, and these devices have very different port allocation and management mechanisms from the residential gateways.

See the Carrier-Grade NAT (CGN) related documents in this collection: http://www.scribd.com/collections/3292450/P2P

PS there currently is a UPnP-like protocol that is contemplated for CGNs, namely the "Port Control Protocol" (PCP), see here: https://datatracker.ietf.org/doc/html/draft-ietf-pcp-base-29

Syntax answered 7/1, 2013 at 20:30 Comment(0)
O
3

Cling has Android specific classes to do UPnP and, from the looks of forum messages and their documentation, it should work. I am currently testing it on the PC but ultimately I chose it because of their Android support. I will post my test results here in a day or two.

Check Cling Core and especially Support libraries. At the most basic level you only need 4 lines of code to do port mapping.

[UPDATE] Cling documentation for Android states that it only allows binding to the Wi-Fi interfaces thus making port mapping on cellular data connection impossible (At least with Cling version 1.0.5)

Outshout answered 30/4, 2012 at 9:14 Comment(2)
You might wan't to review you accepting my answer as a correct. I am reading Cling Android documentation at the moment and I see it saying that Cling will only bind to WiFi interface. So effectively it means that there are no port mapping for 3G )-.Outshout
I read through their docs and saw that. I'm assuming they know what they are talking about and therefore it can't be done....might not be the answer I was hoping to find, but it is an answerSirree
J
0

Instead of trying to use uPnP (which is a security risk because it lease an unmapped port open), you might want to either use STUN to get a public ip/port and then establish a UDP connection which you can tunnel psudo-TCP through, or use a TURN server. For carrier grade NAT, if you don't want to pay for relaying, there is also this technique, which might sometime work:

https://drive.google.com/file/d/0B1IimJ20gG0SY2NvaE4wRVVMbG8/view?usp=sharing

Judgment answered 14/8, 2015 at 22:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.