FSPortTest (use this tool to check your network)

Started by Russell Gilbert, November 21, 2007, 12:16:11 PM

Previous topic - Next topic

Russell Gilbert

Hi guys,

There's been a lot of discussion over the years about a network testing tool (for example, here and here).  I had an idea today about a really simple way of testing your network.  Instead of trying to mimic all the DirectPlay craziness, I decided that the main problem most people have is just getting their ports forwarded correctly in their firewall or router, so the other players in the session can connect back to them.  So I made a little program that just checks your port forwarding.

Here's how it works...

It has a list of ports that it tests by default:  UDP 23456, 6073, and 2300-2400.  These cover FS2002, FS2004, and FSHostClient (for FSX).  There are a couple more ports that need to be forwarded if you're hosting a session (TCP 47624 for FS2002, and TCP 80 for the Master Server and FSHostSpy), but the FS2002 port is really just for outgoing data so it's usually not a problem with routers, and FSHost itself will tell you if you don't have TCP 80 forwarded correctly.

For each port, it connects to a little CGI program on my server and asks it to send back a UDP test message to that port.  It then listens on that port for the message, and if it gets it, it marks that port as OK.  If it doesn't, it times out after 3 seconds and marks it as an error.

You can also add other ports you want to test.  For example, if you're running FSHost with the FS2004 session on port 23457 (instead of the default 23456), you can tell the program to test 23457 as well.  It'll still test 23456 also, but you can ignore the error message it produces in that case.

So... here's the program:

http://www.chocolatesoftware.com/fshost/FSPortTest_1.6.exe (Updated to version 1.6 on May 17, 2012)

First, if you have FS2002 or FS2004 running and you're connected to a server, disconnect from it (but you can leave the program running).  If you have FSHost running, stop the game servers (under the Server menu).  Then save the program above somewhere on your machine, and double-click it to run it.  It'll test all the normal ports and tell you if there are any errors.  If it reports an error for a port, then it means that the outside world is not able to send data to you on that port, and you need to check your firewall and/or router again.

If you want to add additional ports for it to test, open a Command Prompt window (Start / Programs / Accessories / Command Prompt), change to the directory where you saved the program, and then run it with the additional ports added to the command line, separated by spaces.  For example, to test 23455 and 23457 in addition to the normal ports, you'd run this:

FSPortTest.exe 23455 23457

And here's the full list of ports again, just for reference:

FS2002:
TCP 47624
UDP 2300 to 2400

FS2004 and FSX:
UDP 23456 (or your "2004 host port" on Server / Options / Session tab)
UDP 6073
UDP 2302 to 2400 (not necessary if also forwarding 2300 to 2400 for FS2002)

Remote (web) Access, and for FSHostSpy to be able to find your session:
TCP 80 (or your Remote Access port on Server / Options / Remote Access tab)

If you need help with forwarding ports in your particular router, you might take a look at www.portforward.com.  Select your router from the list, then click the link in the upper right corner to "skip this advertisement" (you don't need to buy anything), and then select one of the "Flight Simulator" versions.  The instructions there only tell you to forward one or two ports, but be sure to follow the same steps to forward all of the ports listed above, depending on which version of Flight Simulator you're using.

Let me know if you try out the program above!

Russell

jdude

#1
Well, I can confirm this works.  ;D

At least now I know port 6073 is the issue.
~(Signature Construction Zone)~Posters proceed with caution. Thanks you.

G_CHAS

hello Russell how you doing matey! 8)

my FIRST results of the Network test tool

2nd test Port 2352....Error, timed out waiting for response ???

3rd test Port 2393....Error -1 requesting URL: http://www.chocolatesoftware.com/cgi-bin/udpsend.cgi?2393 The operation timed out  ::)

4th test port 2390....Error -1 requesting URL: http://www.chocolatesoftware.com/cgi-bin/udpsend.cgi?2393 The operation timed out   :-\

5th test    PERFECT no timeouts   ;D

Press any key to continue?

When I follow the command `Press any key to continue` the  program just dissappears. and i thought something else was about to happen. Maybe a text change to "Test Complete......press any key to end the test" would suffice as I went looking for the window!! and no doubt I`ll not be the only one who will run more than one test expecting to see what happens next?

As ports 2300-2400 are forwarded, the random timeouts  will be glitches due to computer-internet technology and nothing more, just like an adsl speed connection test?

Again Russell, another program that the PC community will thank you for  :-*
Take care, Best wishes to you and yours
Merry Xmas too!


wheelie

Hi Russell,

Brilliant tool. I thought everything was OK till I ran this and found out I had screwed up a few ports  :-[ (like incoming 2317 being forwarded to 2371 - typing problem - and others using tcp and not udp).

Could you do ports 23450 to 23455 as part of the default list?

Would be nice to see the IP address too. One server I connect to always claims that my IP address is 10.0.0.50 - I don't where it gets that address from.


hawkflyers.com

#4
well i finnaly got ppl off the server for just enough time to test it out
2318 hung it up a few times for some reason but then it went thru the test and FSHF.HOPTO.ORG pass with flying colors



We here at HAWKFLYERS thank you for all your time and effort
and for all your sim ploits just to let you know if you cant  find a server to fly on we are here and open 24/7
air shows most every week end and theres a big ong one commin in december
if you want more info go here

http://hawkflyers.com/events.html

if you would like to just come watch thats fine we ask that u use the Padude

Once again Russll thank you for you time and effort and all that you put into it
if it wasnt for you we would be fling with AI lol

Russell Gilbert

#5
Hi guys, thanks for the feedback.

I increased the timeouts a bit to hopefully get rid of a few of the "requesting URL" timeout errors (that's the part where it's asking the server to send back a message to the port) and changed several of the messages to be a bit more helpful, including the "press any key" message, and added new summary messages at the end.

Wheelie: I think it's best not to add any more ports to the default list because they'd just time out and produce errors for most people.  But you can easily add them to your own list using the instructions in my original post.  Or if you find yourself wanting to test your machine on a regular basis, you can create a shortcut to the program that will always test whatever ports you want.  Here's how...  Open an Explorer window to the directory where you saved the program, right-click the file and select Copy, right-click in a blank area of the same directory and select "Paste Shortcut", then right-click on the new shortcut you just made and select Properties, then in the "Target" box, add a space after the program name, followed by all the extra ports you want to test, with a space between each one.  For example, "C:\FSPortTest.exe 23450 23451 23452".  Then you can rename the shortcut to something like "My FSPortTest", and whenever you run it, it'll test the additional ports as well.  Also, you asked about your IP address...  The 10.0.0.50 IP address is a fake one that you normally see only on your local network -- like 192.168.x.x, for example.  I don't know why they're seeing that on the server, but I've seen it happen before, so it's probably nothing to worry about.  FSHost reports your IP address when it first starts up, since you'll need to give it to other people so they can connect to you, but people don't usually need it if they're just connecting to someone else's session.  You can always go to www.whatismyip.com though, if you want to check it.

Thanks guys, and I'm still interested in hearing reports from anyone else that tries it.  I'm thinking that if this continues to be useful, it might be something that could be incorporated into FSHost and FSHostClient so you could run it directly from inside those programs.  Then FS2002 and FS2004 users could still download the separate program to test their networks as well.

Russell

Russell Gilbert

I've had a couple of emails from people asking why the tests fail on their machine even though FS2004 and/or FSX seem to be working ok.

I've seen that happen before.  What's happening is that FS is connecting to the server on 23456, and since the router sees the connection initially being made from inside your LAN, it allows the connection out and then also automatically forwards data coming back in on that port to the same machine that requested it.  This is why you don't have to forward every port your machine connects out on -- because the router sees the outgoing request and then allows data to come back in on the same port without a forwarding rule.  And you can even have multiple machines going out on the same port, and your router is smart enough to automatically forward the return data back to the right machine.

However, sometimes FS will end up switching off of the 23456 port and onto the "alternate" ports, which are 6073 and a sorta-random port in the 2300-2400 range (typically the lower numbered ports in that range).  It only does it in certain situations, but when it does, data will be coming back into those ports and the router will have never seen any data going out on them, so it won't know how to forward them to the right machine.  So those ports have to be explicitly forwarded to the FS machine.  This can also happen when you have FS and FSHost on the same machine and you're connecting to your own session, because in that case you have to tell FS to use some port other than 23456 (since it's already being used by FSHost), and then FS will switch to the alternate ports.

Back in FS2002, it always used a port in the 2300-2400 range, and it caused lots of problems for people that didn't know how to setup their networks to allow the incoming data on a random port.  So when Microsoft released FS2004, they changed it so it would always try to use one standard port, which was 23456.  But they left the random port stuff in there as well, for the cases where it wasn't able to use 23456.  FSHostClient (for FSX) uses the FS2004 method of connecting to the session, so it behaves the same as FS2004 in that case.

So you can usually get away with just using 23456 with FS2004 and FSX.  But you should be aware that your setup is not optimal (networking-wise, anyway), and there's a slight chance that it could cause problems for other people in the session.  For that reason, it's always best if you can setup your firewall or router to forward the correct ports to the FS machine, and then you'll be sure that everything's ok.

Unfortunately if you have FSHost and FS on different machines in your local network, there's no good way to solve the problem because you can't explicitly forward a port to more than one machine.  If you can run both on the same machine, it's always better because you can forward all the ports to just one machine (and usually FSHost doesn't cause problems for FS).  Otherwise I'd suggest forwarding all the ports to the FSHost machine, and then just rely on port 23456 for the FS machine, since your router will do the automatic routing when it sees the outgoing connection from that machine.

Hope that helps explain it a bit... It's a bit of a mess, this whole thing with how FS uses ports.

Russell

tuscan17

Hello Russel!

Well... I have been trying to have FSHost running on my XP PC but... can't solve the connection problem to master server.

I have read that XP user should disable the firewall because no solution have been found. So I did but...nothing good.
I still get the error

071201 23:52:50  Master Server registration aborted. The Master Server attempted to verify your server by requesting a web page from it, but was not able to connect to your IP address (81.208.83.216) on port 80. If you have a router or firewall, please change it to allow port 80 to be forwarded to your machine. For help, see the FAQ page under the Help menu. Also, please verify your IP address on the Options / Master Server window. FSHostSpy will not be able to show your server.

I also tried to change the port from 80 to 81 in the FSHost Options/Remote Access  --- useless!

SO I tried to run your network test tool but, all the ports have been reported with an error.

Can u help me?

Monday I'll send you a postcard from Florence (Italy)

Thanks bro!

Russell Gilbert

Hi tuscan,

Are you using a router?  If so, have you forwarded all the correct ports for FS?

Russell

tuscan17

Hello!

I found out that the problem is on my ISP (fastweb) side because they assign a shared external IP to many of their users. Also, the router they gave me is not configurable. It'a an italian mafia s***!

Fastweb seems to be the only italian ISP that't using this IP sharing policy to prevent users from sharing files P2P

Gabriele

mark786

When I run FSHost I am unable to register with the Master Server. I get this message -

080115 21:51:29  Master Server registration aborted. The Master Server attempted to verify your server by requesting a web page from it, but was not able to connect to your IP address (71.55.89.159) on port 81. If you have a router or firewall, please change it to allow port 81 to be forwarded to your machine. For help, see the FAQ page under the Help menu. Also, please verify your IP address on the Options / Master Server window. FSHostSpy will not be able to show your server.

These are the results of the FS PortTest -

FSPortTest version 1.4

Testing ports for FS2002, FS2004, and FSHostClient for FSX...

Port 23456... Error: timed out waiting for response
Port  6073... Error: timed out waiting for response
Port  2300... Error: timed out waiting for response
Port  2301... Error: timed out waiting for response
Error binding to port 2302. Are you running FS or FSHost?
Please disconnect FS2002 and FS2004 from multiplayer sessions,
and/or stop the game servers in FSHost.

Testing complete.

Some ports are not receiving data correctly. (scroll up to see the results)
Please check your firewall and/or router settings.
UDP ports 23456, 6073, & 2300-2400 should be forwarded to the PC's internal IP.
Please see www.portforward.com for help with your router.

I have all the ports correctly forwarded in my router settings.
Any suggestions?

Russell Gilbert

Hi Mark,

It sounds like something's definitely still not right with your network setup, because nothing from the outside is making it back to your PC.  Maybe you can post details about your router, modem, firewall, internal IP address, ports you've forwarded, and anything else you can think of that's related to your network?

Russell

mark786

Hi Russell,

I am using a Linksys WRT54GS router, Embarq EQ-660R ADSL modem, Firewall is Windows Live OneCare which is set to allow FSHost, internal IP address is 192.168.1.1 and potrs forwarded are 23456, 81, 6073 and 2300-2400.
I tried turning Firewall off but that didn't help. I can connect to others with FSHost Client.

Thanks, Mark

Russell Gilbert

Hi Mark,

Ok, a couple of things...  First, you said your PC's internal IP address is 192.168.1.1.  Are you sure about that, because that IP is typically the default for most routers, including the one you have.  If you go to Start / Programs / Accessories / Command Prompt, and type "ipconfig", you can see your machine's internal IP address.

Also, there's more info about your router on this web site, including a checkbox called "Block Anonymous Internet Requests", which it says to clear:

http://www.portforward.com/english/routers/port_forwarding/Linksys/WRT54GS/Flight_Simulator_2004.htm

One thing though, that site only mentions ports 23456 and 6073, but you need to forward all the ones you mentioned.  They should all be protocol UDP except 81, which should be TCP (or you can set them all to "Both").

Russell

mark786

Russell,

Correction, ip address is 192.168.1.100
All my router settings agree with www.portforward.com