Pitboss Question To Network Experts

LordRahl

The Objectivist
Joined
Oct 30, 2005
Messages
1,500
Location
NYC, USA
I'm having a little problem with setting up pitboss game exactly the way I would want it to, and I was hoping somebody on the forum could help me out with it. Here's my setup:

I was trying to set up a pitboss game with a friend of mine, who lives in another country. The problem with the setup above is that I can't get it to work.
I installed the pitboss on my Desktop computer. I installed CIV4 on my Laptop1 computer. I set up my router to forward all incomming traffic (both UDP and TCP) on ports 2050-2060 to my Desktop Computer. I then hosted a pitboss game on my Desktop, and tried joining it with my Laptop1 - I could connect and play without any trouble.
The next day, I emailed my friend to join my pitboss game - with his Laptop2 he connected to my Desktop pitboss without any problem and started his turn. After he connected, I tried to join but for some reason I could no longer join the game from my Laptop1. I got the "firewall is probably enabled" type of error. I knew there would be some firewall issues to begin with, so we both had our Windows firewalls totally disabled (on all computers), and as mentioned before the router was set to forward the traffic on the civ port.
Since my original setup didn't work, I then started trying different configurations. I figured the fact that I'm not running the pitboss on the same machine as my Civ causes the problem. So I installed the pitboss on my Laptop1, and tried hosting and playing the game from there, but my buddy could no longer connect to my game (even though I updated router traffic forwarding to my Laptop1).
The only thing that worked in the end was having both the Pitboss, and the Civ Game running on my Desktop.
This would suggest that the problem lies with my laptop wireless connection, because I can play from my Desktop but I can't play from my Laptop1, but strangely, I am able to play online multiplier games through GameSpy from my laptop without problems.
I hate spending long hours sitting at my desk, so I'd rather be laying down on my couch with the laptop, which is why I really want to get the game working on the Laptop. Since I don't keep my laptop on at all times, I really want to have the Pitboss on the Desktop which is on 24/7. So does anyone have any idea how can I get the setup from the picture to work? Any help would be greatly appreciated - thanks guys.
 
Open port 2056 and point it to your PITBOSS server. (Specifically UDP)

I would remove all other rules off the firewall. And have him connect. If you want to try my server out to make sure it isn't a problem on your setup, send me a personal message and I will send you the info.

Toddler
 
I did have only 2056 open originally and only decided to open more after not being able to get the setup working. Surely having open more ports is unnecessary but it can't be hurting anything either, or can it?
 
I have the exact same setup. All I have configured on my firewall is a port forward for UDP 2056 to my pitboss server. I then create a new direct ip game and I'm able to connect to it using the private ip of my server, while my friends connect yo my public IP (the port forwarding takes care of the rest).
 
My understanding is that in order for the game to work correctly, each peer (computer) needs to be able to communicate with every other peer. If you have both Pitboss (your desktop) and your client (laptop 1) using the default port (2056), then your friend's client (laptop 2) has no way to distinguish between Pitboss and your client (laptop 1). Both are behind the same public IP address and running on the same port. Your port forwarding rule will forward all the traffic that's meant for your client (laptop 1) to the Pitboss machine.

I more or less have the exact same setup at home. D-link router, wired desktop running Pitboss, and wireless laptop running the client. I've been successfully hosting a Pitboss game and had friends join it for a month or two now.

You need to edit the CivilizationIV.ini file on your client (laptop 1). There should be a shortcut in your CivIV program directory. Change the line that reads "Port = 2056" to "Port = 2057". This sets your client (laptop 1) to use port 2057 for communication instead of the default 2056, which your desktop is using for Pitboss. On that note - leave the Pitboss server on its default port (2056). This way your friend only needs to enter your public IP address into his client and not worry about the port.

Change your port-forwarding rules on your router so that all incoming UDP traffic on port 2056 is forwarded to your destop's internal IP address (running Pitboss), and all incoming UDP traffic on port 2057 is forwarded to your client's (laptop 1's) internal IP address.

Your friend's machine should then send all traffic destined for your client to port 2057 and all traffic destined for the server to port 2056 without him needing to change anything. He need only type in your IP address as the host when connecting to your game.

Hope this helps.
 
Kobald - I really think you're onto something here, because after doing some connection tests with Toddler and my friend, I only see problems with connections where more than 1 person joins the pitboss. My only question to you is regarding this piece:
Your friend's machine should then send all traffic destined for your client to port 2057 and all traffic destined for the server to port 2056 without him needing to change anything.
Does my friend really need to change nothing, and his Laptop2 will automatically know to communicate with my Pitboss on 2056, and my client Laptop1 on 2057?. Is that the way it really works? And how did you find it out (was it trial and error, traffic sniffing, or are there instructions somewhere?) Also - is the port assignment sequential - meaning, If more than 2 people played would you have:
pitboss: 2056
player1: 2057
player2: 2058
player3: 2059 etc.
And what determines the port number of a particular player? Order of joining, or is it all random? Thanks for your help so far.
 
Does my friend really need to change nothing, and his Laptop2 will automatically know to communicate with my Pitboss on 2056, and my client Laptop1 on 2057?
My understanding is that the first thing your client laptop will tell the Pitboss server is how to contact it. It more or less says "Hey Pitboss, my IP address is [whatever IP] and I'm using port 2057". Then whenever another player joins, Pitboss will "introduce" the two peers to each other, along with their IP address and corresponding port. Either that or it helps them introduce themselves to one another. Somewhere along the line (probably helped by the router, since that's its job) the machines outside of your private network learn your external IP and don't try to contact the internal one.

So, hypothetically, if your public IP address is 123.123.123.123, the internal IP address of your host (Pitboss on port 2056) is 192.168.0.2, and the internal IP of your client (on port 2057) is 192.168.0.3, then for you to join your server from your client, you would enter 192.168.0.2 on the Direct IP screen in Civ (since it's within your local network). Your friend would enter 123.123.123.123 on the Direct IP screen to join (since he needs to reach you over the internet). Your friend's laptop will assume that Pitboss is hosting on port 2056 since this is the default. Your router will send the traffic to the Pitboss machine (Port Forward rule on 2056). Through what is probably a very cryptic and complicated series of hello's between the machines, Pitboss (or more likely your client but my reasoning is too complicated to add here) will inform your friend's laptop that to reach your client it needs to contact 123.123.123.123:2057 (ie. port 2057). Your router will then send the incoming traffic to the appropriate destination. Or one would hope so anyway.

And how did you find it out (was it trial and error, traffic sniffing, or are there instructions somewhere?)
I have a competent (hopefully I haven't written anything to cast doubt on this) understanding of networking, and more or less found out through reading the post somewhere here on the way Civ communicates, and a little trial and surprisingly little error (except for the human kind).

Also - is the port assignment sequential
Port assignment is only relevant within your local network. I just chose 2057 because it seemed logical. You could in fact set your port to any unused port number (just stick with 2057 if this is becoming confusing).
You only need different ports to distinguish between different machines behind your router. As your friend has a completely different IP address he can continue to use port 2056, because the IP address sets him apart from your local machines (which HIS client sees as having the same IP address but different port numbers). Additional players need not change their port either. The only situation where you would need another port number is if you were to add a third machine behind your router (ie. on your local network).

BTW I'm making a few assumptions about your network (specifically that you're using static IP's - which is a must and your first post certainly sounds like it). Also, let me know if the internal/external IP address thing isn't making any sense.

Having looked back over this disturbingly lengthy post I hope it makes sense. It's 12:30am here so I apologize if I've gone off on a tangent.
 
You're making perfect sense. For some reason I didn't realize that indeed as long as my pitboss knows that I'm on 2057, it can let my friend's laptop know about it. I will verify this whole setup at the next opportunity, and let you guys know how it went.
Also - one final question - is the port configuration session based, or is it persistent throughout the entire game. I'm asking because I started a game, while my .ini file on Laptop1, was still pointing to 2056. If I change it to 2057 now, and restart the application on my local machine - will the pitboss update my location, so that my friend's laptop knows where to communicate with me? Thanks.
 
Another question, regarding voice chat. I found in another thread that it uses port 3783. Do I forward this one to my Laptop, or my Pitboss server? I'm guessing my laptop...
 
Also - one final question - is the port configuration session based, or is it persistent throughout the entire game. I'm asking because I started a game, while my .ini file on Laptop1, was still pointing to 2056. If I change it to 2057 now, and restart the application on my local machine - will the pitboss update my location, so that my friend's laptop knows where to communicate with me?
The server more or less forgets about you once you disconnect - so I guess "session based" is the answer to your question. This is why you can log in from a different client (if you're at your friends house for example) and play your own turn from there. It's also why it's a good idea to password protect your civ - otherwise other players can log in as you :).
Another question, regarding voice chat. I found in another thread that it uses port 3783. Do I forward this one to my Laptop, or my Pitboss server?
I would agree that forwarding it to your client should be correct. I've never got it working properly though and just use Skype or Ventrilo instead.
 
Not to ruin your expectations, but if your router is configured and working correctly there should be no need to change the default ports on any of the 3 or more pc. I host pitboss games with 5 or 6 players and everybody uses the default UDP 2056. They just need to make sure thei outboud connection is not blocked then my router takes care of all the natting and forwarding.
 
MaxCiv - I haven't had the chance to test this setup yet - will do it this weekend, but from initial testing I'm quite optimistic it will solve the problem. You don't need to mess with port 2056 as long as you don't have two different users, or a user and a server on a different computer, behind a single router. You can have 18 players and be fine, as long as their external IP's are all different, in my case with only 2 players, I ran into the conflict because there was no way for my friend's laptop to discern between my laptop and my server. Port forwarding should fix the problem - again, I'll let you guys know this weekend.
 
I wanted to verify that the information above listed in this thread worked for me. As I have a setup similar to LordRahl. I have a 2k3 box, an XP box both sitting on the inside LAN behind the router. And I had trouble getting a friend and I to simultaeously connect to my Pitboss server.

So I changed the port on my gaming PC to 2057 and left the Pitboss server alone. And it was neccessary also to have my router forward port 2056 to the Pitboss server (192.168.1.50) and 2057 to my gaming PC (192.168.1.100). For me to be able to connect with him.

But kudos for the thread it was very useful. :goodjob:
 
I totally forgot about posting my results. Indeed the method works flawlessly, as I am now able to play with the setup described, exactly the way I wanted to. Thanks for your help.
 
Top Bottom