nat

How to do NAT with PHP sockets

本小妞迷上赌 提交于 2019-12-04 12:31:46
I'm trying to make a peer to peer app in php to work in the same kind of way skype works. It works with internal addresses, but when I try to send data to my external address the message never gets there. Obviously I'm missing some address translation, but I'm at a loss for how to do that with PHP sockets. Is it possible? This is the code i have at the moment to receive the message, which I run first to wait for some message: <?php $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("Could not create socket: " . socket_strerror(socket_last_error($socket))); socket_bind($socket, "0.0.0

HTTP Server behind NATs

假装没事ソ 提交于 2019-12-04 12:26:17
问题 I'm trying to make an (apache) server behind multi-layered NAT to be accessible from Internet. Restrictions: Avoid relay. There is a public server (we call him the OldMan) for login / stun, but its bandwidth is too poor to carry relay data. I have no right to configure the NATs manually. 3.User don't have to change their browser or device.(that is, works on android, ios, and any PC) I tried UPnP , but it only works on 1-layered NAT . I tried to search NAT traversal solutions for several

Trying to get NAT's external IPAddress with INATExternalIPAddressCallback in C#

▼魔方 西西 提交于 2019-12-04 11:55:28
How do I get the external IP Address of a NAT using the windows library? I am trying to find any information on INATExternalIPAddressCallback, but have only found one example in C++ using unavailable interfaces to C#. Any guidance would be much appreciated. -Karl Sorry, that I don't answer with an existing API from Windows that uses the UPNP service, but it migh help you You could also use a STUN-server on the internet, there are many open ones, every VOIP provider has one. http://en.wikipedia.org/wiki/STUN http://tools.ietf.org/html/rfc3489 e.g. open an UDP-socket, connect to stun.gmx.net on

UDP, NAT and setting up “connections”

喜欢而已 提交于 2019-12-04 10:28:00
问题 I know the word "connection" isn't really appropriate when talking about UDP, but... How does a server (the one with the known IP) get its UDP packets through the Internet to a client that is behind NAT? For example: say a client connects and authenticates to the server using some messaging over TCP. At this point the server is ready to start streaming data to the client over UDP, but how does the server know where to address the UDP packets so that they would find their way through any NAT

UDP over Internet. How does it work?

好久不见. 提交于 2019-12-04 10:16:55
As I am programming a network chat (java, but should not make a difference for the question), and wanted to use UDP, I ran into the problem of it not working over the internet. After a little research I found out that you have to have port forwarding for the specific port activated. So now it comes to my question: Does UDP work over the Internet in a not configurable way? For example, if I would program a whole Network Game would it make sense to use UDP? Or would I require the Player to activate Portforwarding and open the Port etc? When would it make sense to use UDP then? And why? I'm

UDP/TCP hole punching vs UPnP vs STUN vs?

梦想与她 提交于 2019-12-04 08:49:05
I try to make a P2P Program and need help with getting through the NAT of the clients. I have read many questions here on stackoverflow, but i never got what the drawbacks and benefits of all the Methods to get through a NAT are. How many routers support which methods? Which methods are commonly used by the big companies? (BitTorrent, TeamViewer,...) What are the drawbacks/benefits of the three methods i listed and which else exists? UPnP requires software support in your router. Even when routers have it, it's sometimes turned off due to security concerns. STUN uses a simple public server to

TCP hole punching on iPhone

南笙酒味 提交于 2019-12-04 05:47:15
I have done a bit of reading, and although I'm new to iPhone networking I was wondering if a TCP hole punch is possible for connecting two iPhones through NAT. I also read some helpful things about uPnP and hairpinning but I'm not to familiar with those at all, so if anyone has any ideas as to whether or not this is possible. My goal is to be able to connect multiple iPhones over a large range (so it may be better to switch to some type of GPSR) but for now I'm only working with two iPhones and 3G NAT Traversal seems the simplest and most reliable in theory. nat traversal is generic term used

Understanding NAT

孤街醉人 提交于 2019-12-03 22:11:55
Understanding NAT Network address translation - or NAT - is a networking option that first appeared in VMware Workstation 3.0. NAT provides a simple way for virtual machines to use most client applications over almost any type of network connection available to the host. The only requirement is that the network connection must support TCP/IP. NAT is useful when you have a limited supply of IP addresses or are connected to the network through a non-Ethernet network adapter. NAT works by translating addresses of virtual machines in a private VMnet network to that of the host machine. When a

How to discover the type of the NAT a given interface is behind

北城余情 提交于 2019-12-03 16:17:10
I would like to discover the type of the NAT (FullCone, Restricted Cone, Port Restricted cone, Symmetric) a given network interface is behind. I've tested different tools ( http://freshmeat.net/projects/jstun/ , http://code.google.com/p/boogu/ ) but they report different results for the same interface. I'm looking for a definitive answer in Python (or other languages, 2nd choice being Java, if nothing else is available). http://en.wikipedia.org/wiki/STUN NAT devices are implemented in a number of different types of address and port mapping schemes. STUN does not work correctly with all of them

Python UPnP/IGD Client Implementation?

▼魔方 西西 提交于 2019-12-03 11:04:45
I am searching for an open-source implementation of an UPnP client in Python, and more specifically of its Internet Gateway Device (IGD) part. For now, I have only been able to find UPnP Media Server implementations, in projects such as PyMediaServer , PyMedS , BRisa or Coherence . I am sure I could use those code bases as a start, but the Media Server part will introduce unneeded complexity. So can you recommend a client UPnP (and hopefully IGD) Python library? An alternative would be to dispatch calls to a C library such as MiniUPnP , but I would much prefer a pure Python implementation.