Jazz Jackrabbit 2 and Gateways

The age-old problem of "I time out after thirty seconds...HELP" has plagued Jazzers and the Technical Help forum almost since the beginning. And the solution to the problem is almost always the same. The purpose of this article is to explain why the problem occurs and how to fix it.

You should be reading this if you have a local area network with router\gateway, and you are having trouble joining and hosting JJ2 games. This article does not cover software firewalls such as ZoneAlarm, but may still be useful to read if you have one. There are are also two assumptions made: that you are using JJ2 version 1.23 or 1.24, and that you have the list server patch and are able to retrieve the list in-game.

Introduction
Why does it happen?
How is my network set up?
Configuring my gateway
If it still doesn't work

2. Why does it happen?

It is easiest to explain this graphically, with the animated image below.

The three computers on the left are behind a local area network, and connect to the Internet via the blue gateway. This gateway can be a piece of hardware such as the "routers" found at computer stores, or it can be another computer set up with multiple network cards and configured to act as a gateway. With either kind, the concept is exactly the same.

The computer running JJ2 in the network has already retrieved the server list and is attempting to join a game. It sends a request out to the JJ2 server. The gateway allows this request to go through properly. However it also modifies the request slightly. Specifically it changes the originating address to that of the gateway. This lets the JJ2 server know to connect to that address, rather than the inaccessible address of the originating computer.

So far, so good. The request is sent over the Internet to the JJ2 server, which in turn tries to complete the connection by sending game data back. Here is where the trouble occurs: when the data packets hit the gateway, all they specify is the address of the gateway. There is no way for the gateway to know which computer on the network the request should go to. So it blocks it. Because only a partial connection is established, the client game will seem like it has joined and will be able to see chat text. However, the game disconnects after thirty seconds because only some data (the chat text) is sent. All the rest of the data like player movements is blocked by the gateway.

There is a similar effect when one is hosting the game rather than trying to join it. It is much simpler: all requests to the server are blocked because the gateway doesn't know what do do with them. In this case there is no partial connection - all games trying to connect are immediately refused.

3. How is my network set up?

Before actually solving the problem, there are several details you must find out. First you need to know what kind of gateway you have - specifically whether it is a hardware "router" or an actual computer. The easiest way to do this is by asking someone who knows. Try asking parents or the people who set up your network.

If you can't ask someone or they don't know, you'll need to find out yourself. Locate your cable or DSL modem. These all look different, so it is impossible to describe exactly what it looks like. But it will have a coaxial (cable) or telephone (DSL) cable connected to the back. It will also have a network cable connected. Follow the network cable until you get to the other end. If it connects to a small box with other network cables coming out if it, you have a hardware gateway (a "router"). If it connects to a computer, that computer is probably acting as a gateway, especially if the computer has other network cables connected as well. NOTE: Wireless networks almost always use a hardware gateway (combined with the wireless access point so it will have antennae on it)

If you have a computer acting as the gateway, you need to find the documentation for the gateway software. This guide can only tell you what to do, not how to do it. The author is able to give general instructions for hardware gateways, but not for software.

There are two things you need to find out from the computer that you want to play JJ2 on: the internal address of the computer, and the internal address of the gateway. The process is slightly different depending on what operating system you use.

Windows 2000\XP
  1. From the start menu, select "Run".
  2. Type cmd in the box and press enter. A command prompt will appear.
  3. At the prompt, type ipconfig and press enter.
  4. Information like this will appear:
    IP Address. . . . . . . . . . . . : 192.168.2.104
              Subnet Mask . . . . . . . . . . . : 255.255.255.0
              Default Gateway . . . . . . . . . : 192.168.2.1
  5. Record (or remember) the IP Address and the Default Gateway.
Windows 95\98\ME
  1. From the start menu, select "Run".
  2. Type winipcfg in the box and press enter. A window will appear.
  3. Make sure the correct network adapter is selected from the drop-down box, and record (or remember) the IP Address and the Default Gateway.

4. Configuring my gateway

JJ2 uses network port 10052 for internet games. A port can be thought of as a numbered extension in an office telephone system. You would call the office with a single number, but you would have to tell the switchboard the specific extension number for the person you are trying to reach. Ports work in the same way: the client connects to the server with a certain address, but also tells the server what port it wants to connect to. Different services could be running on different ports.

With a computer directly connected to the internet, the computer itself acts as the switchboard. Requests are made on certain ports, and the networking driver directs those requests to specific programs based on what port number it was. However, when a gateway recieves a request the request still only includes the address and the port number. The gateway doesn't know which computer to send the request to.

This is where forwarding comes in. Most gateways and gateway software are able to forward requests to specific computers based on the port number. For example, you are able to forward all requests on port 10052 to the computer that JJ2 is running on. This is the general solution for solving gateway problems.

10052 TCPInitial connection, level and tileset download, and chat
10052 UDPGame data (player movement, shots, flag information, triggers, etc.)
10053 TCPServer list retrieval
10054 TCPDynamic list connection (initially lists server and updates number of players)

The above table summarizes the ports that JJ2 uses for network play. Gateways are usually able to handle outgoing TCP connections, so that is why you may be able to connect, download the level, and see chat text, but still time out after 30 seconds. Gateways can even usually handle outgoing UDP connections. It is the incoming UDP connections that are blocked by the router, therefore causing a timeout. To put it simply, the only port that needs to be forwarded to join other games is port 10052 UDP. However, to allow others to join your own game you need to forward port 10052 TCP as well. Ports 10053 and 10054 usually do not cause a problem, as they are always outgoing TCP connections. But if your gateway has firewall capability enabled, outgoing connections on ports 10052 through 10054 will need to be opened.

If you use a computer as a gateway, this is as far as this guide can help. You need to consult your specific documentation to determine how to forward the ports mentioned in the previous paragraph. You will usually need to set an IP address to forward to - use the IP Address determined in the previous section. From here on the focus will be on "routers".

Most routers have a web configuration interface, accessible through a web browser within the local network. The address is almost always the same as the "Default Gateway" recorded in the previous section. For example, if your default gateway was 192.168.2.1, the configuration URL would be http://192.168.2.1. Try to access this address from a browser within your network. If it doesn't work, you will need to consult your router documentation to find out how to configure it. Some may use a software configuration tool on a networked computer, or some may have a telnet-accessible interface.

The configuration interface is usually protected by a password. The default password is usually "admin", but may also be blank or some variation on the name or model of the router. If the default password doesn't work (consult the router documentation to find out exactly what it is), someone has changed it. You will need to ask them what it is, or ask them to enter it. If they refuse, tell them you need to change some settings to get a game to work, and show them this guide.

After getting into the configuration tool, you will need to find the configuration section where ports can be forwarded. This is usually in an "Advanced" section, and may be simply called "Port Forwarding", but could also be called "Virtual Server" or something else. Whatever it is called, you should be able to enter port numbers, IP addresses, and whether that entry is UDP, TCP, or both. If you are unable to find a section like this, consult the router documentation. It may also be possible that your router doesn't have this feature.

Once you have found the correct section, add entries for JJ2. You will need to forward port 10052, both TCP and UDP, to the IP Address determined in the previous section (not the Default Gateway address). If there is no option distinguishing between TCP and UDP, it is likely that both will be forwarded and you only need to add one entry. Some routers also have an option for "Both", in which case you will also only need one entry. After entering the correct information, click the "Submit" or "Save" button. Note that routers will often temporarily sever the internet connection when you save, so ensure that nothing is running on the computers that would be affected by this.

There is a feature on newer routers that is similar to port forwarding but is more secure. By keeping port 10052 forwarded all the time, you are leaving an opening for hackers whenever you aren't playing JJ2. Port triggering gets around this. With port triggering, the ports are automatically forwarded when required. For example, you could set the router to forward port 10052 UDP whenever there is an outgoing request on port 10052 TCP. Since this isn't a very standard feature, it is impossible to explain how it is done. Consult your router documentation to find out exactly how it works and how to configure it.


5. If it still doesn't work

After configuring your gateway, JJ2 internet play should work perfectly. However, there is always a possibility that it doesn't. If this is the case, there are several things you can do.

  • Ensure all settings are correct. Make sure you entered everything in the right place, and entered the correct information. Double-check that you entered the IP address of the computer you are playing on, and not the address of the gateway. It is also possible you just made a typo and entered the wrong IP address or port number.
  • Ensure no firewalls are blocking. Sometimes a firewall will be blocking the connections. To check if this is the case, simply disable any firewalls temporarily. Remember that Windows XP has a built-in firewall that may be enabled. If this solves the problem, consult your firewall documentation to find out how to allow JJ2 specifically to initiate and recieve connections.
  • Search for others with the same problem. If you've done everything right and it still doesn't work, it is likely that other people have had the same problem and have posted about it. Search for the name\model of your gateway software or hardware on the internet or newsgroups. To narrow down the search, also include a keyword like "forwarding".
  • Send a support request. Go to the manufacturer's site and find the support section. There will usually be a way to send an online request, through a form. Remember to describe the problem accurately. If you are unsure of whether you can word the problem correctly, include a link to this page, specifically the configuration section:

    http://www.jazz2online.com/J2Ov2/node.php?title=proxyServersHelpGuide#a4

    Remember that most companies take weeks to reply to online requests. If you are impatient you could try telephone support.

If you are having a problem after getting this far, it is not recommended to post in the Technical Help forum at the JCF. The people there can only tell you as much as has been told in this guide. Here you need specific help that can only be given by people who have experience with your hardware\software, and you are not likely to find it on the JCF.

If you are extremely desparate there is one other thing you can do. You can bypass the gateway entirely. Please ask permission before doing this, as it will break the internet connection for all other networked computers and will break the network connection for the computer you do it on. It also leaves Windows file sharing ports wide open to hacking attempts. Enable a firewall before doing this, or at least disable file and printer sharing.

  1. Locate the network cable connecting your computer to your gateway. The easiest way to do this is to find it on the back of your computer and follow it until it gets to the gateway.
  2. Disconnect this cable from the gateway (but keep it connected to the computer).
  3. Locate the network cable connecting your cable\DSL modem to your gateway.
  4. Disconnect this cable from the modem (but keep it connected to the gateway).
  5. Connect the cable from the computer directly to the modem.
  6. If required, reconfigure the computer for a direct connection. Most of the time it would have been already using DHCP with the gateway, but if it used static addresses you will need to configure it for DHCP. This is done by going into the network settings and selecting "Obtain an IP address automatically".
  7. If running Windows 98 or 95, restart the computer. This is not required with Windows 2000 or XP.
  8. Verify that you are connected by following the same procedure to check the IP address as in section 3. If the IP address does not start with 169 (an automatic private IP range for when DHCP servers cannot be reached) then it probably worked.

This is only a workaround solution and should not be permanent. If your gateway does not have the capability to forward ports properly, you should replace it with one that does. If it is supposed to have the capability but it doesn't work properly, you should demand a refund because it doesn't do what it is supposed to do.


Hopefully this article has helped you solve your problem. Remember that there are other resources too, such as manufacturers' sites and public message boards. It should be noted again that if your problem was not solved by reading this article, you should not post in the Technical Help forum on the JCF. Responses there cannot get any more detailed or specific than this article. There are probably people in the community who would be willing to help you on a personal basis, so you could ask around privately.

This article copyright © 2003 Chris Bruton aka Link. Used with permission.