• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 22:59
CEST 04:59
KST 11:59
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Chinese SC2 server to reopen; live all-star event in Hangzhou20Weekly Cups (Oct 13-19): Clem Goes for Four3BSL Team A vs Koreans - Sat-Sun 16:00 CET7Weekly Cups (Oct 6-12): Four star herO85.0.15 Patch Balance Hotfix (2025-10-8)81
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou The New Patch Killed Mech! RotterdaM "Serral is the GOAT, and it's not close" Weekly Cups (Oct 13-19): Clem Goes for Four 5.0.15 Patch Balance Hotfix (2025-10-8)
Tourneys
Merivale 8 Open - LAN - Stellar Fest Lost Recovery Master -Bitcoin Recovery Experts Tenacious Turtle Tussle RSL Season 3 Qualifier Links and Dates $1,200 WardiTV October (Oct 21st-31st)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers
Brood War
General
OGN to release AI-upscaled StarLeague from Feb 24 BGH Auto Balance -> http://bghmmr.eu/ Is there anyway to get a private coach? SnOw's Awful Building Placements vs barracks BW General Discussion
Tourneys
[Megathread] Daily Proleagues [ASL20] Semifinal B 300$ 3D!Community Brood War Super Cup #4 Azhi's Colosseum - Anonymous Tournament
Strategy
[I] TvP Marine Usage Current Meta Roaring Currents ASL final BW - ajfirecracker Strategy & Training
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread Dawn of War IV ZeroSpace Megathread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread The Chess Thread
Fan Clubs
The herO Fan Club!
Media & Entertainment
Korean Music Discussion Anime Discussion Thread Series you have seen recently... [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023 Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Benefits Of Limited Comm…
TrAiDoS
Sabrina was soooo lame on S…
Peanutsc
Our Last Hope in th…
KrillinFromwales
Certified Crazy
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1775 users

Some notes regarding SC2 networking

Forum Index > SC2 General
167 CommentsPost a Reply
1 2 3 4 5 7 8 9 Next All
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
Last Edited: 2011-12-19 17:33:09
March 24 2010 20:00 GMT
#1
Since I see a lot of misinformation flying around, here's some brief information about SC2 and how its networking works.

UPDATE: Note that when I refer to latency in this post, I'm meaning network latency over the wire. Starcraft 2 includes a built-in command buffer that also adds input latency to smooth out and jittering or higher ping players - no amount of tweaking will reduce or alter that.

UPDATE 2: After some more research it appears SC2 is routed peer to peer rather than server based. Very disappointing . Irrelevant portions of this thread have been struck through.

UPDATE 3: Most of this thread is no longer relevant as this was written during the beta. The actual release uses UDP for game data so it has no issues with TCP latency.

Architecture
Stacraft 2 games run using a server, similar to HoN - not peer to peer as the original BW does. This means that Blizzard is the one hosting the games, not you (note: custom games were not tested). The protocol is TCP, not UDP. I'm unsure why Blizzard decided to go with TCP/IP, since latency is generally worse over TCP especially with regard to lost packets. Perhaps they didn't want to deal with fragmentation or NAT issues?

"Drop hacks" / Lag
Since other players also connect to Blizzard's server, not you, there is no way to be "drop hacked" in SC2. Drop hacking involves terminating the connection to the other player via some means - trivial in BW since both players are connected to each other - desynchronize the connection and you get a drop. However in SC2, since you are only connected to Blizzard's server, not the other player, the most you can do is disconnect yourself from the server, causing you to drop. Since the server knows who disconnected, it can award the win to the remaining player.

Note that this does not preclude any bugs in SC2 that might allow someone to purposefully cause a drop condition by sending malformed packets that crash the server (thus dropping everyone), but given the server architecture, drop hacking should not be an issue in SC2 provided the servers are reliable and well-coded.

You may notice there is still the "Waiting for players" screen. Rather than allow the server to continue if one player is lagging, it pauses the game for everyone. This was done out of fairness I imagine, since if someone is lagging it would not be fair for them to have to engage the other players army. Technically there is no reason why the game can't keep going similar to how HoN handles latency where only the player lagging experiences any lag. In theory this should allow a large number of spectators to be in a game without impacting the latency for the players - if a spectator lags, who cares?


Port Forwarding
Since Starcraft 2 does not use peer to peer connections, you do not need to open any ports to play nor will doing so "improve" your connection. You connect to Blizzard's server, much like you connect to teamliquid.net every time you click a link - you do not need to open ports for outgoing connections.

Map Hacking
Please keep in mind this is not a thread to discuss map hacking in, just some technical commentary. As some people have argued, since SC2 uses a server, it should be possible for the server to eliminate map hacking by only sending unit data for what a player can currently see. Theoretically, this could work - however as many have pointed out, SC2 is a lot more complex than other games such as HoN that do this - in HoN, there is a very small amount of units you have to consider, with only a few of those (heroes) having any particular state. With SC2, there can be hundreds of units, each in many states. If someone moves into your fog of war with hundreds of units that your game doesn't know about, that will result in a large amount of data required to be sent to your client. TCP doesn't burst particularly well, and if one of those packets in the burst is lost, you have a significant delay. There is also spells such as Scan that reveal part of the map immediately on clicking, which the server has no way to predict you using.

While it is technically possible to reduce map hacking with some clever coding and possibly imperceptible latency compromises, this was not done. The technical requirements for such impose a great deal on the latency of the game, and for an RTS latency is extremely important. Which brings me on to...


Improving Latency
As I've mentioned, SC2 uses TCP. TCP is designed for data transfer with latency as a secondary consideration to bandwidth, so isn't really ideal for real-time games. Almost every FPS game in existence uses UDP for this reason. TCP requires reliable delivery - if a packet is lost, it has to be retransmitted, stalling the rest of the data while this happens. There is a small tweak you can make to improve TCP responsiveness for gaming.

Change TcpAckFrequency to 1:

How
Run registry editor (Start, Run, regedit) and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces. You will see a list of random looking keys, find the one that has the "IPAddress" value that matches your current IP. Right click on the right side and go New -> DWORD. Call it TcpAckFrequency with a value of 1.

Why this works
Usually TCP delays sending acknowledgments of received data until either more data has been received OR a timeout period elapses. This timeout period may be because the sending side is waiting for the ack before sending more data. By setting TcpAckFrequency to 1, you send an acknowledgment immediately rather than waiting, preventing miniature "stalls" in the data stream. Note that this WILL reduce your bandwidth, as you will be sending more ack packets, thus using more network resources.


Things that MIGHT help
If you use ADSL, your connection may use interleaving which is a method of error resistance that adds latency to your connection. Look in your ADSL modem settings for an option to turn it off. Note that this may increase the chances of line noise affecting your connection, so it might be required to be on. You may need to contact your ISP as it may be something controlled on their side, but don't expect them to be too accommodating.

Wired vs wireless: A properly configured wireless network should have minimal latency, however if you are in a crowded area with obstructions and other 2.4 GHz noise, the latency caused by retransmissions might add up and cause issues. Try pinging your router - your latency should be 1-2ms at most. If not, try a wired connection while gaming.

If you have a low quality wireless card (common in cheap desktop / laptops), you may experience random periods of lag while it switches frequencies for background scanning (used for roaming between access points). You can turn off background scans with a tool such as WlanOptimizer (Vista / 7 only).

Tweaking your RWIN (Windows XP only) may help - see any number of guides online regarding this.

Things that will NOT help
There is a huge amount of useless information on the Internet that offers supposedly improved performance. The following will NOT improve your network quality at all: Opening your ports. Changing "TCPNoDelay" registry setting. Changing "NetworkThrottlingIndex" registry setting. Changing "TcpDelAckTicks" registry setting. Disabling "QoS Packet Scheduler". In fact, very few registry tweaks will help - there's usually a good reason defaults are the defaults.
Facebook Twitter Reddit
AdministratorTwitter: @R1CH_TL
Wr3k
Profile Blog Joined June 2009
Canada2533 Posts
March 24 2010 20:09 GMT
#2
Thanks Rich.
Lysithea
Profile Joined February 2008
Sweden204 Posts
Last Edited: 2010-03-26 00:14:34
March 24 2010 20:12 GMT
#3
On March 25 2010 05:00 R1CH wrote:
Improving Latency
Change TcpAckFrequency to 1:
<div style="margin-left: 32px">
How
Run registry editor (Start, Run, regedit) and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces. You will see a list of random looking keys, find the one that has the "IPAddress" value that matches your current IP. Right click on the right side and go New -> DWORD. Call it TcpAckFrequency with a value of 1.


Those of us that played wow noticed this a few years ago as well, I went from ~200ms ingame to around 50ms. I do it manually in regedit but for those that are less used to tinker around in the regedit here's a simple program that fixes this for you regardless of win os: http://www.wowinterface.com/downloads/info13581-LeatrixLatencyFix.html

(it has nothing to do with wow, just happens to be hosted on a wow related site)
"Float like a butterfly, sting like a bee." - Muhammad Ali
Wr3k
Profile Blog Joined June 2009
Canada2533 Posts
Last Edited: 2010-03-24 20:17:29
March 24 2010 20:14 GMT
#4
So what exactly does the TCPAckFrequency setting do? Does it have something to do with window size?

Edit: Nvm, you explained it.
Excalibur_Z
Profile Joined October 2002
United States12237 Posts
March 24 2010 20:17 GMT
#5
Great analysis R1CH. Although SC2 uses the "routed peer-to-peer" system, apparently similar to the one that Blizzard touted for War3, it doesn't appear that TcpAckFrequency would have any effect unless every player participating in the game had set it to the same value. Essentially, you're always playing at the speed of the slowest player, because any desyncs or delays call the Waiting for Players screen, right? The more people that know about the regkey, the better, though.

I suppose it's probably too late to expect Blizzard to restructure their netcode around UDP and simply adopt the measures for software port forwarding that War3 included.
Moderator
theqat
Profile Blog Joined March 2008
United States2856 Posts
Last Edited: 2010-03-24 20:21:56
March 24 2010 20:19 GMT
#6
Wow, thanks R1CH

Edit: TcpAckFrequency should be a hexadecimal value?
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
March 24 2010 20:19 GMT
#7
On March 25 2010 05:17 Excalibur_Z wrote:
SC2 uses the "routed peer-to-peer" system.

How do you know this? It would seem pretty flawed if this were the case, and make a lot of my points invalid .
AdministratorTwitter: @R1CH_TL
onmach
Profile Blog Joined March 2009
United States1241 Posts
Last Edited: 2010-03-24 20:22:34
March 24 2010 20:21 GMT
#8
I'm surprised sc2 uses tcp. That's pretty strange, but I guess the blizzard guys know what they are doing.
Excalibur_Z
Profile Joined October 2002
United States12237 Posts
Last Edited: 2010-03-24 20:29:09
March 24 2010 20:26 GMT
#9
On March 25 2010 05:19 R1CH wrote:
Show nested quote +
On March 25 2010 05:17 Excalibur_Z wrote:
SC2 uses the "routed peer-to-peer" system.

How do you know this? It would seem pretty flawed if this were the case, and make a lot of my points invalid .


Isn't that basically what you described though? Player A sends data to the server which is then sent to Players B and C, Player B sends data to the server which is then sent to Players A and C, and so forth. That is the War3 routed peer-to-peer system that Blizzard championed. I use that in quotes for SC2 because on the surface it appears quite similar, but of course it may not be.

EDIT: Although I suppose from that vague description I described what could be either routed peer-to-peer or client/server =/ Regardless, my initial question stands: wouldn't this only have an impact if every player enabled it?
Moderator
Manaldski
Profile Joined January 2004
229 Posts
March 24 2010 20:28 GMT
#10
Nice write-up. I tested the custom games and they are also routed through the server. I may also add one thing on how you can improve your latency: By getting a good add-in NIC. Best ones are the Intels: Intel PRO/1000 MT or GT(old versions) or the newer Intel PRO/1000 CT, they are very good and cheap NICs, under $30. Here are same reviews comparing it with integrated NICs:

http://forum.ncix.com/forums/topic.php?id=1304406
http://www.donutey.com/intelpro.php

Note that the Integrated NICs are evolving and difference is getting narrower but its still good to get one especially if you want to game and torrent at the same time.
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
March 24 2010 20:41 GMT
#11
On March 25 2010 05:26 Excalibur_Z wrote:
EDIT: Although I suppose from that vague description I described what could be either routed peer-to-peer or client/server =/ Regardless, my initial question stands: wouldn't this only have an impact if every player enabled it?

If it was indeed a routed P2P rather than client/server, it would indeed minimize the benefit, but it wouldn't be completely worthless since assuming both sides are data starved the same amount of time, you reduce it 50% by "fixing" it on your end.
AdministratorTwitter: @R1CH_TL
RiGun
Profile Joined February 2010
Argentina155 Posts
March 24 2010 20:43 GMT
#12
On March 25 2010 05:28 Manaldski wrote:
Nice write-up. I tested the custom games and they are also routed through the server. I may also add one thing on how you can improve your latency: By getting a good add-in NIC. Best ones are the Intels: Intel PRO/1000 MT or GT(old versions) or the newer Intel PRO/1000 CT, they are very good and cheap NICs, under $30. Here are same reviews comparing it with integrated NICs:

http://forum.ncix.com/forums/topic.php?id=1304406
http://www.donutey.com/intelpro.php

Note that the Integrated NICs are evolving and difference is getting narrower but its still good to get one especially if you want to game and torrent at the same time.


That's an interesting review, I've always thought that any NIC was enough for gaming, but there are some interesting results in that review.
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
March 24 2010 20:49 GMT
#13
On March 25 2010 05:28 Manaldski wrote:
I may also add one thing on how you can improve your latency: By getting a good add-in NIC. Best ones are the Intels: Intel PRO/1000 MT or GT(old versions) or the newer Intel PRO/1000 CT, they are very good and cheap NICs, under $30. Here are same reviews comparing it with integrated NICs:

Gonna have to disagree there, at the data rates most games use there is very little benefit to offloading. Even in the article you linked the only benefit was when maxing the connection with a torrent, and torrents are wildly erratic in speeds to begin with so I don't consider that a valid test. In any case it isn't a realistic scenario where you'd be gaming with large downloads going on in the background.

The only issue where a NIC really comes into play regarding latency is when running a server, where the amount of outgoing data begins to affect latency based on the link speed - eg 100mbps vs 1gbps. At 100mbps, you have 13107bytes/ms throughput vs 131070bytes/ms. Depending on the number of games, players, etc all hosted on the same server, this can begin to add up.
AdministratorTwitter: @R1CH_TL
AnodyneSea
Profile Blog Joined March 2010
Jamaica757 Posts
March 24 2010 20:50 GMT
#14
awesome post, i think you nailed it. BW used to have servers though back in the day, i remember all those server splits and stuff and i could always join anybody's games. It was probably more cost effective after a certain number of years to get rid of them and make it the way it is now.
Lost within the hope of freedom, not for control but in the light of our cause
Osmoses
Profile Blog Joined October 2008
Sweden5302 Posts
March 24 2010 20:52 GMT
#15
Awsum, I wish I knew jack shit about networking =)
Excuse me hun, but what is your name? Vivian? I woke up next to you naked and, uh, did we, um?
7
Profile Joined February 2010
Canada1218 Posts
March 24 2010 20:53 GMT
#16
Really informative. Thanks for taking the time to explain all this!
I love the sense of camaraderie when an entire line of cars teams up to prevent a dick from cutting in at the front. Stay strong, brothers!
mgj
Profile Blog Joined March 2010
191 Posts
Last Edited: 2010-03-24 21:07:58
March 24 2010 20:55 GMT
#17
Awesome post R1CH, thanks!

Improving Latency
+ Show Spoiler +
As I've mentioned, SC2 uses TCP. TCP is designed for data transfer with latency as a secondary consideration to bandwidth, so isn't really ideal for real-time games. Almost every FPS game in existence uses UDP for this reason. TCP requires reliable delivery - if a packet is lost, it has to be retransmitted, stalling the rest of the data while this happens. There is a small tweak you can make to improve TCP responsiveness for gaming.

Change TcpAckFrequency to 1:

How
Run registry editor (Start, Run, regedit) and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces. You will see a list of random looking keys, find the one that has the "IPAddress" value that matches your current IP. Right click on the right side and go New -> DWORD. Call it TcpAckFrequency with a value of 1.

Why this works
Usually TCP delays sending acknowledgments of received data until either more data has been received OR a timeout period elapses. This timeout period may be because the sending side is waiting for the ack before sending more data. By setting TcpAckFrequency to 1, you send an acknowledgment immediately rather than waiting, preventing miniature "stalls" in the data stream. Note that this WILL reduce your bandwidth, as you will be sending more ack packets, thus using more network resources.

I just want to attach a link for the curious: http://en.wikipedia.org/wiki/Nagle's_algorithm


I've always thought that any NIC was enough for gaming, but there are some interesting results in that review.

Yeah i've seen some pretty amazing results from gaming NIC's before. But honestly? I dont believe it for a second. Your ISP's peering and infrastructure is so much more important than the last router->PC connection.
But hey, stranger things have happend. Someone sponsor me a gaming NIC so i can check for myself =P

Things that MIGHT help
If you use ADSL, your connection may use interleaving which is a method of error resistance that adds latency to your connection.

I dont know about other countries, but where i live this option is not available directly for the end-user. However, a lot of ISP's will enable/disable fast interleave if you specificly request it.

Edit: Should read posts better. You pretty much already covered what i said about interleaving.
Malambis
Profile Joined August 2007
United States20 Posts
March 24 2010 20:55 GMT
#18
Good post R1CH, I had changed TcpAckFrequency on my previous install but had forgotten about it after reinstalling recently.
Polar_Nada
Profile Blog Joined June 2008
United States1548 Posts
March 24 2010 20:57 GMT
#19
wowowow thanks for the info!!
[ReD]NaDa and fnaticMSI.SEn fighting~! ::POlar @ UC Irvine::
Whiplash
Profile Blog Joined October 2008
United States2928 Posts
Last Edited: 2010-03-24 20:57:52
March 24 2010 20:57 GMT
#20
Thanks R1CH, I just did this and I am testing to see if I did it right. My IP address wasn't listed (just the one from my home router, not the one at college) so I used the old one. It was the only IPAddress file that had a number as well.
Cinematographer / Steadicam Operator. Former Starcraft commentator/player
1 2 3 4 5 7 8 9 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 8h 1m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nathanias 185
Nina 38
StarCraft: Brood War
Artosis 703
Noble 73
NaDa 58
KwarK 7
Purpose 6
Icarus 3
Dota 2
NeuroSwarm65
League of Legends
JimRising 682
Counter-Strike
Stewie2K629
Other Games
summit1g6254
Skadoodle157
ViBE118
C9.Mang099
Trikslyr42
Organizations
Other Games
gamesdonequick882
Counter-Strike
PGL118
Other Games
BasetradeTV61
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota2885
League of Legends
• Doublelift3321
• Stunt235
Other Games
• Scarra705
Upcoming Events
WardiTV Invitational
8h 1m
Online Event
13h 1m
RSL Revival
23h 1m
RSL Revival
1d 7h
WardiTV Invitational
1d 8h
OSC
1d 12h
SKillous vs goblin
Spirit vs GgMaChine
ByuN vs MaxPax
Afreeca Starleague
2 days
Snow vs Soma
Sparkling Tuna Cup
2 days
WardiTV Invitational
2 days
CrankTV Team League
2 days
[ Show More ]
RSL Revival
2 days
Wardi Open
3 days
CrankTV Team League
3 days
Replay Cast
4 days
WardiTV Invitational
4 days
CrankTV Team League
4 days
Replay Cast
5 days
CrankTV Team League
5 days
Replay Cast
5 days
The PondCast
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
BSL 21 Non-Korean Championship
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.