473,889 Members | 1,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2 computers on same network connectnig to each other via internet

18 New Member
I have written an application that runs in a kind of peer-to-peer framework. Servers connect to a masterserver, which a client then queries to receive a list of servers. The client selects a server and connects to that server directly and both the server and client sever their connections with the masterserver.

Problem: I have the masterserver set up at a location and it is not behind a router or firewall or anything, just directly connected to the internet. I have in a separate location (separate internet connection, too) a server and a client computer on the same network. Both can connect to the masterserver fine. A TCP connection is maintained with clients whilst UDP packets are sent out periodically to both clients and servers. The TCP connection is fine and the UDP packets are always received by the same computer, and always not received by the other one (regardless of which one is the server and which one is the client). When the direct (TCP) connection between the client and server is attempted, however, it doesn't work: "Connection forcefully refused" error message. The standard ports that the application uses are opened for both TCP and UDP on the router. My thoughts are that whilst these ports are set to forward to both computers in the router setup, only one computer receives the UDP packets sent out by the MS and so I'm wondering if the perhaps only one computer is receiving the TCP packets necessary to establish a connection as well.

Notes: If I run the masterserver on the network behind the router and try to connect to it (as either server or client) from the computer directly connected to the internet the connection is fine (I haven't tested the server-client connection from computers on different networks yet). When the masterserver is run on the same network as the server and client and a local address (192.168.x.x) is used for the masterserver everything works perfectly. In the same situation when a non-local IP is used neither computer can connect to the masterserver as either server or client.

I would really appreciate any help on this issue since the application is meant to support two computers on the same network connecting to each other via the external masterserver.

Regards,
AJ

P.S. The router is Open Networks in case that helps.
Apr 3 '09 #1
24 5840
NeoPa
32,584 Recognized Expert Moderator MVP
It sounds like one of the machines is not accessible (the one that never receives any UDP packets).

Can you share which subnets the three machines are on. Please include the actual IP address subnets, as well as those which are needed to address them publicly across the internet. This is for working out whether the correct addresses are being shared with the other machines (client/ server etc).

If you are uncomfortable sharing these publicly then please feel free to PM me with the information.
Apr 13 '09 #2
Asja
18 New Member
Thanks for your suggestion NeoPa.

OK, an update on the problem:
It turns out that you can't forward the same port to multiple computers.
I solved this problem by allowing the user to specify which port
their machine uses for communication and then forwarding the
appropriate ports.

So now all computers in all situations can communicate via TCP
and UDP correctly with the masterserver. When a client tries to
connect to a server behind the same router (even if the server is
running on the same computer as the client), however, I receive
the "Connection forcefully refused" message. So things have
progressed but are not quite there yet.

I have debugged the server application and can confirm that it
never receives any connection request from the client computer,
so I presume the problem is once again with the router setup.
Also, if I run "netstat -a" I can see the server listening for a
TCP connection on the correct port. When the router is not
present everything works as intended.

Also, if the masterserver is moved behind the router, computers
behind the same router cannot connect to it. Is it possible that
computers behind the same router cannot establish a connection to
each other using the external IP?

Thanks again for any help with this new issue,
AJ
Apr 16 '09 #3
NeoPa
32,584 Recognized Expert Moderator MVP
Let's determine if it is all happening in the firewall (router), as I suspect.

Try setting it all up, then turning off the machine that normally reports the connection is forcefully closed (I mean one your client PC is trying to connect to).

If you get the same message when the machine is powered off, then you can be fairly sure the error message is originating from the firewall.
Apr 16 '09 #4
Asja
18 New Member
I tried turning the machine off and I get the same message, so I guess the problem is with the firewall. Do you have any idea what could cause this problem or how to fix it?
Thanks,
AJ
Apr 17 '09 #5
NeoPa
32,584 Recognized Expert Moderator MVP
I can only suggest that the port-forwarding is configured correctly.

This is not something I can help much with as I'm not familiar with the specific firewall, nor exactly what subnets are in use here.

How many firewalls do you have in total, for your three separate machines?
Apr 17 '09 #6
Asja
18 New Member
The two machines that are behind the router just have the router (and the Windows firewall), the other machine just has the Windows firewall.

As far as the port forwarding configuration, I have set up rule for each computer for the relevant port and selected TCP/UDP. Since the computer uses the same number TCP port as UDP port and the UDP works, I don't understand why the TCP doesn't. Maybe I could try setting up separate rules for UDP and TCP.
Apr 18 '09 #7
NeoPa
32,584 Recognized Expert Moderator MVP
@Asja
As I understand it you have three machines. A Master (controlling) Server, a Server and a Client. This answer doesn't make clear which of the machines are behind the firewall/router.

It may be worth turning off the Windows Firewall for those machines behind the firewall router anyway. At least during the development/testing stage.

As a general rule, I would advise configuring a single firewall properly, and not deploy multiple levels. This only says you don't have much confidence in either. Furthermore it makes working out exactly what's going on that much harder.
@Asja
I would certainly try that, if for no better reason than it will help you to determine where your problem lies. Finding solutions is often as much about finding what isn't the problem, as it is about finding what is.
Apr 18 '09 #8
Asja
18 New Member
The Master Server is behind just the Windows firewall,
The Server and Client are behind the router and Windows firewall.

I will try disabling the Windows firewall for the server and client as you suggest.

I said UDP was working but TCP wasn't. My mistake, none were/are working.

Thanks again for all your help so far,
AJ
Apr 19 '09 #9
NeoPa
32,584 Recognized Expert Moderator MVP
No worries Asja. Let me know how you get on.
Apr 20 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

5
1795
by: Max M | last post by:
I am using ClientCookie for login on to servers and browsing them as authenticated users. I kept getting "HTTP Error 400: Bad Request" errors when submitting my forms. So I boiled it down to a simple example. When I try to use ClientCookie.urlopen() on my private network with ip numbers like "http://localhost:8081/test_site/logged_in", it works fine. If I try to call the same site through the Internet, with a url like:
3
465
by: Sandeep Arya | last post by:
Thanks linuxfreak and sybren for positive comments My application will be running on Linux. How to send ICMP ECHO as broadcast packets. I do not know this. Please tell me how to? Sybren.. Does nmap is available on every systems? I tried on my linux fc4 machine in user previleage. it was not working. Does this just belongs to superuser...
3
1722
by: J Smith | last post by:
I'm making a website where each page has the same design, obviously its a bad idea to put the same code/html in each page so what is the best way to do this? What I'm doing at the moment is putting a file called 'index.php' and a file called 'content.php' in each directory. 'index.php' would set a variable called $content with the full path for 'content.php' then it would have an include() statement which called a script outside...
3
3884
by: Steve | last post by:
Hi all How would i get a list of all Active Computers on a network? All I need are the computer names. Kind Regards, Steve.
15
7538
by: dylpkls91 | last post by:
I have been researching this topic and come up with some code to make it work. It uses SSL and requires the 3rd party package Paramiko (which requires PyCrypto). However, at this moment I have no network to test the code on! Trying to connect to localhost (127.0.0.1) fails. Before I buy network components, I want to be sure that this code will work. Will someone with two networked computers try it out for me? Thanks! Code: def...
1
1921
by: brosner | last post by:
I installed MSSQL 2000 on my desktop (running NT 2000). No problem. I created an adp and attached it to a database within MSSQL 2000, no problem. When I go into MS Access, on another PC (running Windows XP Pro) on the same network, and try to create a using 'Project(Existing Data)' and connect it to MSSQL 2000 on my desktop, I fill in the Data Link Properties '1. Select or enter server name', no problem, '2. I click on Use Windows NT...
9
11767
by: Vyas111111 | last post by:
Hello all I want to delete a file which is not placed on my local machine, it is placed on diffrent machine but in the same network. How can i delete that file , i am using VBScript -ASP Thanks in advanced
11
10250
by: jellychai | last post by:
I'm doing the final year project that related to the SNMP. I need to find the solution for the IP auto detection in C#. When I run the main project, the program can automatically detect the IP for the agent and retrieve it's MIB, so that the user do not need to enter the IP address of the agent. Beside that, I also look for the solution that can detect the nodes that had switch on or switch off in C# coding. Wish can get the solution for these...
1
1473
by: maheshgupta024 | last post by:
Im very new to PHP, and interseted in network stuff, using php can i enter into different computers from network within my LAN. Can anyone help on this.. Thanks in Advance
0
10789
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10889
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7150
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5828
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6028
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.