Staredit Network > Forums > General StarCraft > Topic: Battle.net Ports
Battle.net Ports
Jan 29 2012, 1:09 am
By: iCCup.xboi209  

Jan 29 2012, 1:09 am iCCup.xboi209 Post #1



For Starcraft, there's 2 ports. One port is for staying connected to other players in a game, the second port is to connect and stay connected to Battle.net(for the stats and stuff). Most of us know the first port is ports 6112-6119.
Here's the ports that I found so far on Battle.net:
Code
51610
51614
51640
51642
51643
51644
51645
51646
51647
51649
51651
51655
51656
51661
Note: This list is incomplete and these ports are TCP only

Anyways I don't really recommend you to port forward those ports UNLESS the battle.net interface lags for you. If you do want to port forward those ports, try port forwarding 51600-52100 instead of individually typing in all the ports.
The ports listed above are Blizzard's Battle.net ports, I tried ICCUP and their ports are in between 51800-52100.
ICCUP's usually lags for me so I decided to port forward their ports and saw a 50ms difference.
I've now tested Starcraft 2 and there are 2 separate ports just like in Starcraft 1. The ports I've tested so far ranges from 52600-53000. Now I forwarded those port numbers for Starcraft 2 and it only helps by a little bit.

Post has been edited 4 time(s), last time on Jan 29 2012, 2:05 am by xboi209.




Jan 14 2013, 2:59 am theleo_ua Post #2



Hi xboi209

Could you please clarify next:

1) Are ports 51xxx related to hosting games?

2) Scenario 1: I have a NAT (no one can join to my games), and I forwarded only ports 611x. Someone want to join to me, and received "latency message", because my Starcraft application used ports 51xxx for hosting games

Scenario 2: my Starcraft application used random port for hosting games (for example 1234 or 77888)

Both Scenario 1 and Scenario 2 means, that I did nothing in system registry (I didnt changed ports), so we are talking about default Starcraft behavior

The question is next: are Scenario1 and Scenario 2 - possible?

3) Same as 1 and 2, but about "receiving lags in game, if second NAT user will be in game" instead of "hosting games".


Someone told me, that Starcraft (by default) use random port for hosting games on battlenet, and this port is not from 6112-6119 range, so if you have NAT and want to host games on battlenet - it is not enough for you to forward ports 6112-6119 for this (also it is not enough for you to forward ports 6112-6119 for "not receiving lags in game, if second NAT user will be in game"). Is it true?

Also, there is "/netinfo" command in battlenet, which shows you your current opened ports. Is it show correct information? Should we beleive to the information, received by "/netinfo"?

Also, "/netinfo" shows next information: Server TCP, Client TCP, Client UDP and Game UDP. What does it mean? Which categories are related to hosting games and to "possibility to play with NAT users without lags"?

Thanks

Post has been edited 3 time(s), last time on Jan 14 2013, 3:16 am by theleo_ua.



None.

Jan 14 2013, 5:59 am Lanthanide Post #3



Not sure why xboi made this thread in the first place, but he evidently doesn't have much knowledge of TCP/IP connections.

For TCP/IP, typically the server uses a well-known port, for example 6112 (battle.net server), and the client (Starcraft on your PC) uses a random port number in the range 49,152 to 65535. As all of the ports 'found' by xboi are in this range, we should assume that that is simply the (meaningless) random client port number he is looking at, rather than the battle.net server ports, which as stated are 6112-6119.

See also: http://en.wikipedia.org/wiki/Ephemeral_port

Post has been edited 1 time(s), last time on Jan 14 2013, 6:04 am by Lanthanide.



None.

Jan 15 2013, 12:26 am theleo_ua Post #4



Quote from Lanthanide
For TCP/IP, typically the server uses a well-known port, for example 6112 (battle.net server), and the client (Starcraft on your PC) uses a random port number in the range 49,152 to 65535

So - if I hosted a game - my role is "server", and I will use "well-known port, for example 6112" for this, and if I joining a game - my role is "client", and I will use "random port number in the range 49,152 to 65535" for this - correct?



None.

Jan 15 2013, 12:49 am Excalibur Post #5

The sword and the faith

The only thing I know for certain about ports and SC is this:
First your IP address has to be set to a preferred IP outside of the DHCP range. If your router provides DHCP from 192.168.1.1 to 100, then you set to 192.168.1.200.
You then forward ports 6112-6118 on 192.168.1.200 and hope it works.

I've never had much luck with port forwarding even with all my technical skill. I wish you luck.




SEN Global Moderator and Resident Zealot
-------------------------
The sword and the faith.

:ex:
Sector 12
My stream, live PC building and tech discussion.

Jan 15 2013, 1:35 am Lanthanide Post #6



Quote from theleo_ua
Quote from Lanthanide
For TCP/IP, typically the server uses a well-known port, for example 6112 (battle.net server), and the client (Starcraft on your PC) uses a random port number in the range 49,152 to 65535

So - if I hosted a game - my role is "server", and I will use "well-known port, for example 6112" for this, and if I joining a game - my role is "client", and I will use "random port number in the range 49,152 to 65535" for this - correct?

Yes. Firewalls and NAT (they are separate things but go hand-in-hand) typically don't place any restrictions on out-going connection attempts (eg, your PC connecting to a website), but do block in-coming connection attempts (eg, someone's SC client connecting to your SC client because you're hosting a game).

So if you forward port 6112 (I don't think the others are actually used by SC) on your router/firewall, when the firewall sees an external computer trying to connect to that port, it will allow the connection through. This is why to host games you need to forward ports, but to join games you don't (just like connecting to a random website you don't need to forward any ports).

Quote from Excalibur
The only thing I know for certain about ports and SC is this:
First your IP address has to be set to a preferred IP outside of the DHCP range. If your router provides DHCP from 192.168.1.1 to 100, then you set to 192.168.1.200.
You then forward ports 6112-6118 on 192.168.1.200 and hope it works.
This indeed should work, but basically it's a result of a lesser-capable router/firewall. More capable routers/firewalls are able to forward ports to DHCP IP addresses, but it's still less error-prone to go with a static IP address (which is what I do, although I configured my DHCP server to always give my desktop PC the same IP address and then forward the ports to that address, so I am using DHCP but always with the same IP).



None.

Jan 15 2013, 2:48 am theleo_ua Post #7



Big thanks to all

So - the conclusion is next:

1) By default - only 611x ports are related to hosting games and to "playing without lags if second NAT user are detected in game"

2) You can change this port to any other, using system, registry (go to HKEY_CURRENT_USER\Software\Battle.net, go to the Configuration subkey, and create and new DWORD named "Game Data Port", then edit it, change the value type to decimal).

Also - this way you can use not only 611x ports.

3) http://portforward.com/english/applications/port_forwarding/Starcraft/default.htm

It said, that you need to forward only 611x


Only 2 questions left:

a) There is "/netinfo" command in battlenet, which shows you your current opened ports. Is it show correct information? Should we beleive to the information, received by "/netinfo"?

b) Also, "/netinfo" shows next information: Server TCP, Client TCP, Client UDP and Game UDP. What does it mean? Which categories are related to hosting games and to "possibility to play with NAT users without lags"?

Thanks



None.

Jan 15 2013, 3:52 am iCCup.xboi209 Post #8



I posted this topic to just document this stuff.
Anyways, the ports I posted are basically the connection the server itself. I'm assuming this is needed to keep record of stats and various other things like telling your friends if you're in a game or not and what game. The only useful reason to forward them is if you connect to a server that you have a higher ping with such as iCCup or Fish because their servers are located very far away so you may notice that when you join another channel or look at the game list, there is a longer than usual delay than if you were playing on servers that are located closer to you.

To host and play games with other people, you should port forward 6112 UDP however I recommend 6112-6119 UDP because it's known to improve latency for some odd reason.

The /netinfo command to exclusive for PVPGN servers, not Battle.net and it does not show your opened ports. Here's a breakdown of what everything means:
Server TCP: The ip address of the server followed by a colon and port number SC is using to play games
Client TCP: Your ip address followed by a colon and port number for connection to server
Client UDP: Your ip address followed by a colon and port number SC is using to play games
Game UDP: Same as Client UDP, only shown when using the command in-game





Jan 15 2013, 5:53 am theleo_ua Post #9



xboi209

Big thanks!



None.

Jan 15 2013, 6:26 am Lanthanide Post #10



Quote from theleo_ua
1) By default - only 611x ports are related to hosting games and to "playing without lags if second NAT user are detected in game"
I would guess that 95%+ of all people playing Starcraft on battle.net are behind some kind of NAT.

I believe the phenomenon you're talking about here is when you get the really debilitating lag that hits every 3-4 frames constantly and appears to be caused by some pair of players: if either of the players leave the game, the lag goes away. I haven't been able to get to the real root cause of this problem, but from the preliminary investigations I did, it appeared that two of the players that may have been causing the lag were using the same ISP, with very close IP addresses. My guess is that what is happening to cause the lag is that SC is incorrectly sending the packets for one player, say B, to player A by mistake, and then player A has to re-route the packets back to B, which causes the extra lag, and when one of them leaves the problem naturally goes away. It is possible that this only happens with particular ISPs, or people who have particularly close IP addresses, possibly as a result of mis-configuration on the part of the ISP. I haven't really done enough research to determine what the problem is, and probably won't do so.

To sum up: the debilitating lag on Stracraft seems to be only between specific players who likely share an ISP that may have some misconfigured gear. As most players will be running being NAT of some kind, it is not a generic "NAT problem" that causes the lag.

Quote from name:xboi209
The only useful reason to forward them is if you connect to a server that you have a higher ping with such as iCCup or Fish because their servers are located very far away so you may notice that when you join another channel or look at the game list, there is a longer than usual delay than if you were playing on servers that are located closer to you.
That is only true if the server connects back to the game client, which is almost certainly (99.9% chance) not the case, because servers generally don't act that way. Forwarding these ports will therefore do nothing.

Post has been edited 1 time(s), last time on Jan 15 2013, 6:34 am by Lanthanide.



None.

Jan 15 2013, 8:23 am theleo_ua Post #11



Lanthanide

Another reason is that StarCraft needs all players in a game to be connected to each other; failing to communicate between any 2 players leads to well-known lags, where you have like 2 FPS. If you have your StarCraft port closed, you can only make outgoing connections. If 2 or more players in a game have their port closed, they can't communicate with each other, because none of them can accept incoming connections -> lags as described above. So, there can be only 1 player with closed port in a game. This matters if you play not only 1x1.

(c) http://wiki.teamliquid.net/starcraft/Port_Forwarding

I tested this a lot of times. For example, one of my tests was next: I had 2 friends (one from Kazakhstan, and another from Russia), and both of them cannot host games on iccup. I hosted a game (I am from Ukraine BTW), and when they joined to me - we received unplayable lags. But when one of them left the game - the lags disapear.

As you understand, Russia, Ukraine and Kazakhstan - cannot have same ISP.


BTW:

Quote from theleo_ua
2) You can change this port to any other, using system, registry (go to HKEY_CURRENT_USER\Software\Battle.net, go to the Configuration subkey, and create and new DWORD named "Game Data Port", then edit it, change the value type to decimal).

Also - this way you can use not only 611x ports

Is it true? Can you use any port (not from 6112-6119 range) for hosting games, using "system registry" method?

Post has been edited 2 time(s), last time on Jan 15 2013, 8:31 am by theleo_ua.



None.

Jan 15 2013, 11:23 pm Lanthanide Post #12



Quote from theleo_ua
Lanthanide

Another reason is that StarCraft needs all players in a game to be connected to each other; failing to communicate between any 2 players leads to well-known lags, where you have like 2 FPS. If you have your StarCraft port closed, you can only make outgoing connections. If 2 or more players in a game have their port closed, they can't communicate with each other, because none of them can accept incoming connections -> lags as described above. So, there can be only 1 player with closed port in a game. This matters if you play not only 1x1.

(c) http://wiki.teamliquid.net/starcraft/Port_Forwarding
The concept they are describing is correct, however they are actually a bit wrong in what the implications of closed ports are (likely because of the 'simplified' language used by battle.net).

Yes, all players need to be able to communicate with all other players in the game. If one player does not have forwarded ports, this means they can only create outgoing connections, but not receive in-coming connections. You can have at most one such player in a game at a time, and these players cannot create games. You cannot have two such players in a game, because they have no way of creating a connection between themselves as neither one can receive an incoming connection.

What this means in practice is that if you have closed ports, there are many games on the list that will give you the "latency to the game creator is too high" error because that game already has one person in it that has closed ports. However if that person leaves the lobby, then you will be able to join and the "latency to the game creator" is suddenly not a problem. I myself experienced this as I had my port forwarding buggered up for several months when I was trying to play SC online.

So what the liquipedia is saying is that if you get 2 players with closed ports in a game, you will get really bad lag. But actually, it should not be possible for two players with closed ports to join a game in the first place.

Quote
I tested this a lot of times. For example, one of my tests was next: I had 2 friends (one from Kazakhstan, and another from Russia), and both of them cannot host games on iccup. I hosted a game (I am from Ukraine BTW), and when they joined to me - we received unplayable lags. But when one of them left the game - the lags disapear.

As you understand, Russia, Ukraine and Kazakhstan - cannot have same ISP.
This is a useful data point. In my brief attempts to track down what was going on (only 2-3 games), it was always in games with 5-6 people so it was difficult to pin down exactly who the culprits were, but I did see IP addresses from very close blocks so went with the 'same ISP' assumption as I'd previously seen other people mention this and 'NAT problems' as the cause of this issue.

Perhaps what is happening here is some sort of partial port forwarding or routing is allowing both of these players join the game when really only 1 of them should be able to, and as a result when the game starts it ends up reflecting all of the game packets through the 3rd player resulting in the massive lag. This would go in line with what the liquipedia is saying, although they aren't being explicit about the fundamental cause of the lag and don't describe the behaviour I mentioned above where normally both players should not be able to join the game at all.

I followed a link from the liquipedia discussion page to a Russian site with pictures of the networking topology for SC/War2 vs Diablo/D2/War3 and it mentions that the cause of the stuttering lag is if for some reason one player can't communicate with another, their traffic will be routed via the host, and if the host gets dropped then that player will also get dropped as they can no longer communicate with all other players. So this seems to be the likely sort of explanation for the lag. It doesn't explain how these people were able to join the game in the first place though - I wonder if they can join because they have their TCP ports forwarded (which b.net uses for chat and game lobbies) but don't have their UDP ports forwarded (which is used for game data)?

Quote
BTW:

Quote from theleo_ua
2) You can change this port to any other, using system, registry (go to HKEY_CURRENT_USER\Software\Battle.net, go to the Configuration subkey, and create and new DWORD named "Game Data Port", then edit it, change the value type to decimal).

Also - this way you can use not only 611x ports

Is it true? Can you use any port (not from 6112-6119 range) for hosting games, using "system registry" method?
Sorry, I have no idea.

Post has been edited 1 time(s), last time on Jan 15 2013, 11:31 pm by Lanthanide.



None.

Jan 16 2013, 4:23 am iCCup.xboi209 Post #13



Quote from theleo_ua
Quote from theleo_ua
2) You can change this port to any other, using system, registry (go to HKEY_CURRENT_USER\Software\Battle.net, go to the Configuration subkey, and create and new DWORD named "Game Data Port", then edit it, change the value type to decimal).

Also - this way you can use not only 611x ports

Is it true? Can you use any port (not from 6112-6119 range) for hosting games, using "system registry" method?
I haven't tested any ports outside of the 6112-6119 range however it's recommended that you don't go outside of it so that you won't collide with any other programs that may possibly be using it. There aren't any reasons to go outside of it anyways and if you're not familiar to editing the registry, you can download premade .reg files to change your port:
https://sites.google.com/site/maged123/ports




Dec 13 2013, 1:35 pm Zhuinden Post #14



I know this is an old thread, but I was using ChaosLauncher for ages to change my port to 7777, and currently Mca64Launcher says it can use UPNP to bypass the need for port forwarding.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:59 pm]
Pr0nogo -- NudeRaider
NudeRaider shouted: NudeRaider Background: In music this has caused a loudness war, over the past decades where artists amplified their works more and more to sound more prominent than others. In this context it's actually perceived negative, because while for the untrained listener this creates a more effectful (because louder) piece, it actually destroys the finer details artists used to play very quietly. But because the latter is only appreciated by music enthusiasts with good stereo equipment, the former targets a larger audience and thus has proven more commercially successful.
yeah this happens in all media now, sc2's sfx compared to sc1's is a good example of loudness war. also commercials/youtube ads being way louder than the content you're watching
[05:42 pm]
MasterJohnny -- Echo
Echo shouted: My minerals still negative from Moose
We should get minerals for logging for the day.
[05:23 pm]
jjf28 -- Echo
Echo shouted: Did Crescent Dyne ever get finished
:lol:
[05:14 pm]
Echo -- Did Crescent Dyne ever get finished
[05:13 pm]
Echo -- My minerals still negative from Moose
[05:13 pm]
Echo -- I joined 15 years ago and now I'm turning 29 tomorrow. Time zoomed by
[05:12 pm]
Echo -- What you guys still doing here
[05:06 pm]
NudeRaider -- NudeRaider
NudeRaider shouted: SiKiN Don't wanna persuade you to do anything, Sikin, but Pronogo has a point. Uniformly lifting the wave form can only do so much (you noticed that you hit a ceiliing pretty early) but if you use a method that amplifies quiet component more than loud components the resulting perceived loudness will go up much quicker without hitting distortion.
Background: In music this has caused a loudness war, over the past decades where artists amplified their works more and more to sound more prominent than others. In this context it's actually perceived negative, because while for the untrained listener this creates a more effectful (because louder) piece, it actually destroys the finer details artists used to play very quietly. But because the latter is only appreciated by music enthusiasts with good stereo equipment, the former targets a larger audience and thus has proven more commercially successful.
[05:01 pm]
NudeRaider -- SiKiN
SiKiN shouted: Yea cheers but I think I'll land on 20db, hes fine how he is.
Don't wanna persuade you to do anything, Sikin, but Pronogo has a point. Uniformly lifting the wave form can only do so much (you noticed that you hit a ceiliing pretty early) but if you use a method that amplifies quiet component more than loud components the resulting perceived loudness will go up much quicker without hitting distortion.
[03:03 pm]
Zycorax -- :wob:
Please log in to shout.


Members Online: Roy, Pandut