• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 04:46
CEST 10:46
KST 17:46
  • 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
BGE Stara Zagora 2025: Info & Preview27Code S RO12 Preview: GuMiho, Bunny, SHIN, ByuN3The Memories We Share - Facing the Final(?) GSL47Code S RO12 Preview: Cure, Zoun, Solar, Creator4[ASL19] Finals Preview: Daunting Task30
Community News
Weekly Cups (June 2-8): herO doubles down1[BSL20] ProLeague: Bracket Stage & Dates9GSL Ro4 and Finals moved to Sunday June 15th13Weekly Cups (May 27-June 1): ByuN goes back-to-back0EWC 2025 Regional Qualifier Results26
StarCraft 2
General
StarCraft 1 & 2 Added to Xbox Game Pass The SCII GOAT: A statistical Evaluation Jim claims he and Firefly were involved in match-fixing CN community: Firefly accused of suspicious activities How does the number of casters affect your enjoyment of esports?
Tourneys
Bellum Gens Elite: Stara Zagora 2025 $3,500 WardiTV European League 2025 Sparkling Tuna Cup - Weekly Open Tournament SOOPer7s Showmatches 2025 Master Swan Open (Global Bronze-Master 2)
Strategy
[G] Darkgrid Layout Simple Questions Simple Answers [G] PvT Cheese: 13 Gate Proxy Robo
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 477 Slow and Steady Mutation # 476 Charnel House Mutation # 475 Hard Target Mutation # 474 Futile Resistance
Brood War
General
FlaSh Witnesses SCV Pull Off the Impossible vs Shu BW General Discussion StarCraft & BroodWar Campaign Speedrun Quest BGH auto balance -> http://bghmmr.eu/ Will foreigners ever be able to challenge Koreans?
Tourneys
[ASL19] Grand Finals NA Team League 6/8/2025 [Megathread] Daily Proleagues [BSL20] ProLeague Bracket Stage - Day 2
Strategy
I am doing this better than progamers do. [G] How to get started on ladder as a new Z player
Other Games
General Games
Stormgate/Frost Giant Megathread What do you want from future RTS games? Armies of Exigo - YesYes? Nintendo Switch Thread Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
LiquidLegends to reintegrate into TL.net
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Vape Nation Thread European Politico-economics QA Mega-thread
Fan Clubs
Maru Fan Club Serral Fan Club
Media & Entertainment
Korean Music Discussion [Manga] One Piece
Sports
2024 - 2025 Football Thread Formula 1 Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
A Better Routine For Progame…
TrAiDoS
StarCraft improvement
iopq
Heero Yuy & the Tax…
KrillinFromwales
I was completely wrong ab…
jameswatts
Need Your Help/Advice
Glider
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 34139 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
Netherlands10340 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 States12235 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
Netherlands10340 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 States12235 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
Netherlands10340 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
Netherlands10340 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 1h 14m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 155
ProTech65
StarCraft: Brood War
Britney 33724
Sea 4784
GoRush 232
Sharp 136
ajuk12(nOOB) 134
Leta 67
BeSt 67
Dewaltoss 63
EffOrt 57
Movie 51
[ Show more ]
Sacsri 24
Dota 2
XcaliburYe560
BananaSlamJamma359
League of Legends
JimRising 571
Counter-Strike
Stewie2K1769
shoxiejesuss939
ceh9558
Super Smash Bros
Westballz4
Other Games
Happy533
WinterStarcraft527
Mew2King262
crisheroes238
Organizations
Dota 2
PGL Dota 2 - Secondary Stream3968
Other Games
gamesdonequick691
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Berry_CruncH309
• LUISG 26
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Airneanach6
• Rasowy 2
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota283
League of Legends
• Stunt614
Upcoming Events
Replay Cast
1h 14m
WardiTV Invitational
2h 14m
PiGosaur Monday
15h 14m
GSL Code S
1d
Rogue vs GuMiho
Maru vs Solar
Online Event
1d 15h
Replay Cast
1d 17h
GSL Code S
2 days
herO vs Zoun
Classic vs Bunny
The PondCast
2 days
Replay Cast
2 days
WardiTV Invitational
3 days
[ Show More ]
OSC
3 days
Korean StarCraft League
3 days
CranKy Ducklings
4 days
WardiTV Invitational
4 days
Cheesadelphia
4 days
CSO Cup
4 days
GSL Code S
4 days
Sparkling Tuna Cup
5 days
Replay Cast
5 days
Wardi Open
6 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL Season 17: Qualifier 2
BGE Stara Zagora 2025
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL 17: 2025 SUMMER
2025 GSL S2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025
PGL Bucharest 2025
BLAST Open Spring 2025

Upcoming

Copa Latinoamericana 4
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
SEL Season 2 Championship
Esports World Cup 2025
HSC XXVII
Championship of Russia 2025
Murky Cup #2
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.