I ran into an interesting problem. Basically, I have 2 mobile phones that are behind NAT. I want to communicate directly between two devices using UDP.
I know that if I initiate a connection with phones on the server, then I can send data back to this connection with the phone (i.e. send it back from the same port that received the message, to the same ip and port that it was received from). Therefore, I can easily establish a connection between the two devices by connecting both phones to the server. Then send the data to the server and redirect it to the phones. This circumvents any NAT traversal issues that I may encounter.
However, I would rather just use the server to point 2 devices at each other and then let them communicate directly. How can I do it? Is it possible to use something like uPnP?
Any help would be very helpful!
Edit : I found this document http://www.brynosaurus.com/pub/net/p2pnat/ It seems that the translation of the studs is what I need, but it does not look widely supported. I wonder how good the support of the mobile Internet provider for UPnP is.
mobile udp p2p nat nat-traversal
Goz
source share