Sign in to follow this  

Peer-to-peer connection issues (TCP/IP)

This topic is 2046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to test my server/client architecture with a friend (Let's call him "Friend A"), and have already determined that the code is working correctly, since I am able to join my friend when he hosts.

For whatever reason though, he can't connect to me when I host. I've tried a number of things, but nothing seems to work.

I've tried bypassing my router entirely and connecting directly to the modem, but he still wasn't able to connect when I hosted.

I've added the necessary ports to the inbound/outbound lists on my firewall as well (while still connecting directly to my modem), and I've even tried disabling any anti-virus software that might have been messing with things.

I can't really think of anything else that could be wrong with my setup. Just for kicks, I also tried the same steps using UDP, but I got the same results. I could connect to him, but he couldn't connect to me.

I got another friend to help test, as well. We'll call him "Friend B".

I can't connect to "Friend B", nor can he connect to me.

"Friend A" can't connect to "Friend B", however, "Friend B" can connect to "Friend A" (just as I can).

So the only person who can apparently host, is my "Friend A", despite my efforts to open up my computer to incoming connections. I haven't asked my "Friend A" to do any sort of configuration on his end. He's connected to a router, and both myself and my "Friend B" are able to connect to him just fine.


Has anyone else ever encountered a similar problem? Any ideas as to what might be causing this? Please let me know if I can clarify anything, or provide additional details.

Share this post


Link to post
Share on other sites
Can you connect to your own public IP? When I do network I always first host the connection on my computer. Then first tries to connect to localhost, if that works i connect to my LAN IP, and finally connect to my public IP.

But your problem most likely lies in A) not having forwarded all the ports, or B) being behind some external firewall/proxy from your ISP.

Share this post


Link to post
Share on other sites
[quote name='VildNinja' timestamp='1336458075' post='4938302']
Can you connect to your own public IP? When I do network I always first host the connection on my computer. Then first tries to connect to localhost, if that works i connect to my LAN IP, and finally connect to my public IP.

But your problem most likely lies in A) not having forwarded all the ports, or B) being behind some external firewall/proxy from your ISP.
[/quote]

Nope. I wasn't able to connect to my public IP - which I found quite strange as well. 127.0.0.1 works - as it clearly should.

With regards to the ports, I've 'forwarded' all of the ones that I'm using, and I've even tried disabling my firewall entirely (not the best idea, but it was a good test at least).

My concern is that you are correct and that it's my ISP doing something silly and preventing me from being able to test things properly. I've never had an issue with them before though, and I've done other stuff locally (such as running an apache server on my local machine) that has never given me trouble when connecting to my public IP.

Share this post


Link to post
Share on other sites
[quote name='Novark' timestamp='1336458911' post='4938307']My concern is that you are correct and that it's my ISP doing something silly and preventing me from being able to test things properly. I've never had an issue with them before though, and I've done other stuff locally (such as running an apache server on my local machine) that has never given me trouble when connecting to my public IP.
[/quote]
Have you ever tried hosting any non-HTTP based services on your computer? or services on other ports than port 80?
Some proxies limit access to HTTP, but I never heard of any one doing it on incoming traffic only.. But sorry, that's kind of how far my network knowledge go :(

Try hosting a random game. preferably one where your friends can connect directly to your IP, without entering a lobby (lobbies tend to do some nifty NAT tricks)

Share this post


Link to post
Share on other sites
[quote name='VildNinja' timestamp='1336459467' post='4938310']
[quote name='Novark' timestamp='1336458911' post='4938307']My concern is that you are correct and that it's my ISP doing something silly and preventing me from being able to test things properly. I've never had an issue with them before though, and I've done other stuff locally (such as running an apache server on my local machine) that has never given me trouble when connecting to my public IP.
[/quote]
Have you ever tried hosting any non-HTTP based services on your computer? or services on other ports than port 80?
Some proxies limit access to HTTP, but I never heard of any one doing it on incoming traffic only.. But sorry, that's kind of how far my network knowledge go [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]

Try hosting a random game. preferably one where your friends can connect directly to your IP, without entering a lobby (lobbies tend to do some nifty NAT tricks)
[/quote]

To my recollection, I've had other things working where my friends were able to successfully connect to me via my public IP address. Sometimes it won't work, and I'll have to join one of them, but that might be due to other factors since I'm usually connected via a router.

In this one instance with my server/client architecture, however, it doesn't seem to work unless I join my friend.

It's driving me nuts, because I've eliminated the possibility that it's something with my router / firewall, and I don't know else I can try at this point...

Share this post


Link to post
Share on other sites
I'm pretty sure it is related to your firewall, or perhaps the firewall of your ISP. Also, your Friend B probably has the same (or a similar) problem.

Get yourself access to a UNIX shell somewhere outside of your local network. Then try to "telnet your-public-ip your-port" and see if it connects, or doesn't connect. If it doesn't connect, it's a firewall/port-forwarding problem.

Share this post


Link to post
Share on other sites
[quote name='hplus0603' timestamp='1336603337' post='4938801']
I'm pretty sure it is related to your firewall, or perhaps the firewall of your ISP. Also, your Friend B probably has the same (or a similar) problem.

Get yourself access to a UNIX shell somewhere outside of your local network. Then try to "telnet your-public-ip your-port" and see if it connects, or doesn't connect. If it doesn't connect, it's a firewall/port-forwarding problem.
[/quote]

I think I can rule out the possibility that my ISP is at fault, since I have never had problems with them before, and my "Friend A" also has the same ISP and I'm able to connect to him just fine.

Please forgive my ignorance on the subject, but what exactly would be the difference between using a -telnet command versus getting my "Friend A" to try to connect to me? Is it simply to eliminate the possibility that there's something on my friend's side of things that could be wonky, or is there another benefit to using a UNIX shell to test?

Share this post


Link to post
Share on other sites
[quote name='Novark' timestamp='1336640853' post='4938926']
Please forgive my ignorance on the subject, but what exactly would be the difference between using a -telnet command versus getting my "Friend A" to try to connect to me? Is it simply to eliminate the possibility that there's something on my friend's side of things that could be wonky, or is there another benefit to using a UNIX shell to test?
[/quote]
To isolate the problem. By using telnet instead of your own client, you eliminates the possibility that an error in your client can cause the problem. You can also run telnet from windows, but they disabled it by default (since Vista I think). Google it if you want to enable it again - I can't remember where it's done.

Share this post


Link to post
Share on other sites
An alternative is to download and install putty, which has a telnet mode, and lets you enter the port number you want to connect to.
The whole point is, as Feral Ninja says, to isolate the source of the problem.
Also, with an easily controlled session initiator, you can more easily look at the set-up of the connection (the initial SYN packet and any response you might get) in Wireshark to try to debug what's going on.

Share this post


Link to post
Share on other sites

This topic is 2046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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