• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 20:28
CET 02:28
KST 10:28
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3
StarCraft 2
General
Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win
Tourneys
StarCraft2.fi 15th Anniversary Cup RSL Offline Finals Info - Dec 13 and 14! Tenacious Turtle Tussle Sparkling Tuna Cup - Weekly Open Tournament StarCraft Evolution League (SC Evo Biweekly)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night
Brood War
General
Let's talk about Metropolis [ASL20] Ask the mapmakers — Drop your questions BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Foreign Brood War
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread EVE Corporation Path of Exile ZeroSpace Megathread
Dota 2
Official 'what is Dota anymore' discussion
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
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
YouTube Thread Russo-Ukrainian War Thread US Politics Mega-thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream? The Automated Ban List
Blogs
I decided to write a webnov…
DjKniteX
Physical Exertion During Gam…
TrAiDoS
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1853 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
TL+ Member
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 States12240 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
TL+ Member
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 States12240 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
TL+ Member
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
TL+ Member
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
PiGosaur Monday
01:00
#61
PiGStarcraft419
SteadfastSC56
CranKy Ducklings48
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft520
PiGStarcraft419
elazer 172
SteadfastSC 56
CosmosSc2 46
StarCraft: Brood War
Artosis 632
Shuttle 620
NaDa 42
ggaemo 25
League of Legends
C9.Mang0294
Nathanias8
Counter-Strike
minikerr35
Other Games
summit1g6844
Day[9].tv815
JimRising 340
XaKoH 172
ToD128
Maynarde108
ViBE104
Livibee60
Organizations
Other Games
gamesdonequick659
BasetradeTV123
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Hupsaiya 96
• davetesta43
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• intothetv
• IndyKCrew
• Kozan
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota22177
League of Legends
• Doublelift5338
Other Games
• imaqtpie2234
• Day9tv815
• Shiphtur83
Upcoming Events
StarCraft2.fi
15h 32m
Tenacious Turtle Tussle
22h 32m
The PondCast
1d 8h
WardiTV 2025
1d 10h
StarCraft2.fi
1d 15h
WardiTV 2025
2 days
StarCraft2.fi
3 days
RSL Revival
3 days
IPSL
3 days
Sziky vs JDConan
RSL Revival
4 days
Classic vs TBD
herO vs Zoun
[ Show More ]
WardiTV 2025
4 days
IPSL
4 days
Tarson vs DragOn
Wardi Open
5 days
Monday Night Weeklies
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Acropolis #4 - TS3
RSL Revival: Season 3
Kuram Kup

Ongoing

IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
WardiTV 2025
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
RSL Offline Finals
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 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.