nat

Connecting P2P over NAT?

末鹿安然 提交于 2019-11-28 17:13:28
I started to explore the option of connecting with other using a p2p connection, so I coded a simple socket program in JAVA for android devices in which the users can share simple messages p2p (I didn't have any idea about NAT then). I got to know about NAT, so I now need to establish a TCP connection with another user which uses a server for discovery but payload is transferred p2p. I have also looked at XMPP(a very good and detailed explanation of how protocol works is here ) and UPnP but I dont know how to implement them. Another interesting question that arises is of BitTorrent because

How can a server find real client IP address?

穿精又带淫゛_ 提交于 2019-11-28 14:45:42
I can only access the internet from my place from behind a NAT and a proxy. This site however also shows my machine's private LAN address, as well as my NAT's public address. They are apparently using javascript in the process, but I can only find code where they set the value, but not how they find it. So, how can we find out the private IP address of a client machine using javascript? Are you sure you're behind just a NAT router? If you're behind a proxy, the proxy might well be adding an X-Forwarded-For header. They're using Java for that: <span class="pbb" id="lanip"><b>Router IP Address

Behind NAT to behind NAT connection

巧了我就是萌 提交于 2019-11-28 10:09:59
I've come across an interesting problem. Basically I have 2 mobile phones that are both behind NATs. I want to communicate directly between the 2 devices using UDP. I know if I initiate a connection from the phones to a server then I can push data back down that connection to the phone (ie send it back from the same port that received the message to the same ip and port that it was received from). So I can easily communicate between the 2 devices by connecting both phones to the server. Then sending data to the server and having it re-routed back to the phones. This bypasses any NAT traversal

How do I make a TCP server work behind a router (NAT) without any redirection configuration needed

对着背影说爱祢 提交于 2019-11-28 08:32:21
The scenario is the following. I have two machines A and B: A: Client (behind NAT) B: Server (behind NAT) I want B to be able to listen on any given port, so that A can send packets to B through that specific TCP port and receive any response. If both machines are not behind a NAT it is pretty straight foward process. However how do I make it work so that it works even when B is behind a router, without him having to go change the router configuration enable some port forwarding etc... For example, how do peer-to-peer programs like torrent clients work without the user having anything to

TCP Hole Punch (NAT Traversal) Library or something?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 03:57:25
I want to do TCP Hole Punching (NAT Traversal) in C#. It can be done with a rendezvous server if needed. I found http://sharpstunt.codeplex.com/ but can not get this to work. Ideally i need some method which i give a Port Number (int) as parameter that after a call to this method is available ("Port Forwarded") at the NAT. It would be also OK if the method just returns some port number which is then available at the NAT. Has anybody done this in C# ? Can you give me working examples for sharpstunt or something else? In each network scenario, TCP hole punching operates in a similar way to UDP

UDP hole punching implementation

我与影子孤独终老i 提交于 2019-11-28 03:29:43
I am trying to accomplish UDP hole punching. I am basing my theory on this article and this WIKI page , but I am facing some issues with the C# coding of it. Here is my problem: Using the code that was posted here I am now able to connect to a remote machine and listen on the same port for incoming connections (Bind 2 UDP clients to the same port). For some reason the two bindings to the same port block each other from receiving any data. I have a UDP server that responds to my connection so if I connect to it first before binding any other client to the port I get its responses back. If I

NAT translation not working from inside the network (hairpin condition)

吃可爱长大的小学妹 提交于 2019-11-28 00:24:26
I'm writing a P2P application. Peers regularly ping a main server to update their current IP/port, so when a peer wants to reach another one it can ask the server for that information. For now peers use UPnP to configure the NAT (for classic home setups) to be accessible from outside. So everything works, except when a peer's client tries to reach another (or the same) peer's server and both are behind the same NAT. Since in that case the client is trying to reach its own "external" (public) IP address from behind the NAT, the NAT doesn't do the port forwarding and is unable to route the IP

STUN, TURN, ICE library for Java

限于喜欢 提交于 2019-11-27 20:07:19
I need to establish a P2P UDP and TCP Connection between two Users. Both of them are behind a NAT. A little research leads me to STUN , TURN and ICE . Is there any Java solution (library) except jSTUN which seems to work only on UDP. And TURN, ICE is much better for the symmetric NAT Problem. Not to toot my own horn too much, but might I recommend trying IcedJava . (It's a part of the SipTools project) It's actively being developed, has a stable release 0.9 version, and supports use cases like RTP streaming out of the box. As far as TCP support, that's slated for a later release, but you're

Android: NAT Traversal?

允我心安 提交于 2019-11-27 15:14:10
问题 It appears to me that newer Android devices run behind a NAT, where the local address is an internal carrier or LAN address and the public address is the router or carrier assigned external address. Nevertheless, newer phones don't return the same address using the NetworkInterface as when accessing an IP detection service. Therefore, connecting via direct P2P SocketChannels inherently fails. Are there any common workarounds to this problem designed for the Android platform? Can anyone

How NAT traversal works in case of peer to peer protocols like bittorrent.

扶醉桌前 提交于 2019-11-27 14:24:45
I know about NAT traversal and about STUN, TURN and ICE and its use. I want to know whether these are implemented in peer to peer file sharing application like bittorrent. Whether trackers facilitate peers behind NATs to communicate with each other by helping in creating direct connection using STUN or relay through TURN. In the case of Distributed Hash Table(DHT) how one peer would communicate with other peer behind NAT ? BitTorrent does not need to connect to any particular member in a swarm, it's not a p2p chat protocol where two specific end points want to talk to each other. All it cares