Sign in to follow this  
Geometrian

Connecting to Remote Host from Home Machine

Recommended Posts

Geometrian    1810
Hi,

Disclaimer: About 80% of what I know about networking comes from reverse engineering.

I am trying to write a basic client-server-model networking library in Python.  It is available FOSS here. I have tested this library with a client and server on my local machine, but now I want to try it in the Real World.

For testing, I have SSH access to two exterior hostings--one on webfactional and one at a university, both running Linux.  I can run a server from either place through a remote shell, but I cannot connect to it.

In my test (using values from the webfactional hosting):
-I open an SSH shell.  I find the host's name through "hostname" (it is "web15.webfaction.com"), and then find an ip address through "host <name>" (it is "108.59.4.81").
-I start the server via an SSH shell.  The server's socket binds on a given port and the ip address found above ("108.59.4.81", 6317).
-I start the client on my local machine.  The client's socket attempts to connect to the ip address above and the same port (so again: "108.59.4.81", 6317).
-The connection never takes; the client times out, and the server appears completely oblivious--as if no incoming connection was attempted.

I don't know if my approach for this test makes any sense, but it's my best guess.

If it's not something silly like that, I suspect the problem has to do with the NAT, since very similar code worked at my previous residence under a different network setup (though I don't know how it was tested).  However, I don't know what could actually be causing such a tie-up, unless it is a NAT on the server's end.

I'm really confused on the whole thing.  I'm not looking to set up a peer-to-peer connection per-se, although I would like to allow those behind a NAT to host a server.  Can someone clarify and explain this mess?

Thanks,
-G
Edited by Geometrian

Share this post


Link to post
Share on other sites
hplus0603    11347
Your problem is most likely NAT, and/or firewalls that work much like NAT (with connection tracking,) on both the university side and the cheap webhost side.
You solve this by getting a real host that does not NAT/firewall your programs -- typically, a VPS or similar. That server can either be the game server, or it can be a NAT introducer for the actual server.
More information about NAT punch-through is found in the FAQ.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this