Switch from TCP to UDP Transport Layer Protocol


Doctor Vivian

 

Posted

Back in November of 2007, three TCP ports were in use by COH: 6994, 13094 & 23094.

In mid-2008, UDP ports 7000-7100 were added.

Now in 2009, as far as I can tell, COH uses UDP alone to connect its clients and servers.

UDP, being a non-tracked protocol, has no means for ensuring delivery of its packets, unlike TCP, in which every packet is tracked and can be re-transmitted if lost. With UDP, packet loss really means missing data, not just a slow-down while the missing packets are re-transmitted.

I suspect that it was this transition from TCP to UDP that coincided with the marked increase in rubberbanding and mapserving the user base began experiencing -- so much so that a new command was introduced to combat it -- /sync.

If this was the root cause, would it be possible to switch back to using TCP?

It would seem to stand to reason it would increase the reliability of connections considerably.

-- Vivian


 

Posted

I have no idea what you are talking about, but if it fixes those issues and is actually possible...

Why not?



 

Posted

This question was aimed at the Devs, and it is something that they themselves would need to implement at the client and server level either as a patch or as part of a larger Issue roll-out. There is nothing we, the users can do, if the COH client is currently set to only use UDP.

I can only assume that there was a reason for them to originally shift from TCP to UDP, and I would certainly love to hear it, but I am not really expecting a reply from any of the network engineers. The folks who actually make decisions at this level and do the programming are not (as far as I am aware) the ones who participate and post to the Boards.

I wrote the question in the hope that it might be passed inward at NCsoft, so that perhaps at one point one of these persons might at some point see it, and think about it.

The actual process of changing anything would be much more convoluted. After several meetings, discussions, tests and evaluation, the Network Engineer(s) would determine if switching back to TCP would produce more reliable connections. If it did, that find would be followed by many more meetings and at some point an Executive needing to greenlight the change, etc., etc. (which is why it's easier to lump in with an Issue, it's easier to allocate programmer time to it as a task when it's mixed in with 1,000 other tasks). So a year from now we might see it happen, if at all. (I.e., "if it ain't really broke, don't fix it" usually applies)

-- Vivian


 

Posted

UDP packets being completely discardable is a good feature when the bulk of the packets are time sensitive.

Very few live/faster twitch action games use TCP, slower simpler click games do.

The quick summary is that if you get a lost packet or transmit too fast the TCP retrans or throttling can be excruciatingly long in game time (exponential backoff etc) and the entire receive queue sits there doing nothing till the lost packet is retransmitted and by that time its generally way out of date and useless.

Its generally more efficient to build a simple reliability layer where required on top of UDP for faster games.

Some reading:
http://gafferongames.com/networking-...rs/udp-vs-tcp/

http://simula.no/research/networks/p...imula_pdf_file


 

Posted

[ QUOTE ]
UDP packets being completely discardable is a good feature when the bulk of the packets are time sensitive. Very few live/faster twitch action games use TCP, slower simpler click games do.

[/ QUOTE ]

Yes, I agree that is true in principle. However, back in 2007, COH used TCP. And when it used it, the user base experienced a far lower amount of rubber-banding and mapserving than they began to see when the client connections were shifted to UDP.

So in this case, while the switch to UDP may have marginally improved responsiveness for users with slow connections, it caused other problems for a lot of folks.

Although I don't have the actual stats, I would hazard to guess that most folks who use COH are using a broadband data connection, whether that's DSL, Cable or Fiber. Bandwidth and latency are not major issues for them. They're not benefitting from the switch to UDP. They're only seeing the bad side of it -- the rubber-banding and mapserving -- whatever that's being caused by.

It may be that the reliability layer -- if one was implemented in COH -- needs further optimizing to help eliminate these problems, and with that bit of refinement, UDP would work just fine. In fact, that may be one of many features coming in Issue 15, for all we know.

-- Vivian

PS: Thanks for the article links. The TCP-vs-UDP article by Glenn does indeed have a strong emphasis on using only UDP, but if you read it all the way through, you realize he is focused on First-Person-Shooters and not MMOs. The comments at the end of the article were actually very informative -- top MMOs like World of Warcraft, Lineage I/II, Guild Wars, Ragnarok Online, Anarchy Online, Mabinogi and Age of Conan all use only TCP.


 

Posted

It has far less to do with the endpoint connection speed and latency than the fundamentals of TCPIP. Sure on a slower connection the average 5% packet loss on the NA internet turns out to be a pain in the butt eating up the precious bandwidth, but on high speed its unimportant, the important part is the time to retransmit and the queue waiting, that is a fixed value independent of connection rate and the fundamental problem with TCP and faster games.

edit You read the links

Faster games where timing and accuracy are important use UDP.

Slower simpler games use TCP.

We have to assume that the Devs feel the game is fast enough for UDP and on top of that I don't believe that the game was ever TCP only, I'm not aware of the ports and protocols being changed ever in the 5 years I have been playing.


 

Posted

What you said -- "Faster games where timing and accuracy are important use UDP" -- is exactly my point. COH is not a First-Person-Shooter. Timing and Accuracy have very little to do with anything in COH except in some rarified PVP situations with people leaping around trying to make it hard to hit them with in-range melee attacks. You can't "dodge" an attack in COH. You can't "strafe". You don't need to aim, even when sniping. There is no real FPS element to the game.

Where then is the benefit of UDP?

-- Vivian

PS: If you take the time and courtesy to provide links, I will of course take the time to read them.

PPS: The Ports were taken from the NCsoft Knowledgebase, HERE.


 

Posted

I disagree, its certainly not an FPS by any stretch but it has elements of fast action power choices and positioning/player movement.

It is a Superhero game you know, not a slogging through the mud Chivalry and Sorcery thing!

Does it require UDP? I dunno for sure, my opinion is that its probably better to err on the side of UDP.


 

Posted

[ QUOTE ]

PPS: The Ports were taken from the NCsoft Knowledgebase, HERE.

[/ QUOTE ]

Oh I know but I seriously don't remember those ever changing in 5 years and I have been helping people with firewall/router settings since 2004.

(tech note not necessarily for you: don't open any ports on a NAT Router for this game, its a waste of time, the port information is only for an actual active firewall.)


 

Posted

Whatever the solution is, I think we both share the same wish -- that they will be able to reduce the rubber-banding, mapserving and ghosting problems we're all experiencing at some point soon.

-- Vivian


 

Posted

<QR>

Like you said, the change was supposedly implemented in mid-2008.

i12 was released in May 2008. That's when people really started being affected by instability, and the /sync command soon followed. IIRC, they then added some kind of "auto-sync" a few seconds after zoning to prevent any issues.

Since then.. I personally have not had any problems other than server stability itself knocking people offline on rare occasions.

I don't know if it's related to the protocol change or not.... and some people had pointed out before.. there were similar stability issues for some people way before there was ever a /sync command, which would have been using the old protocol methods... and there are many people like myself that are no longer having any issues since the supposed change. (I use cable broadband if that makes any difference).


 

Posted

[ QUOTE ]
Faster games where timing and accuracy are important use UDP.

[/ QUOTE ]

Timing and accuracy seemed to be more important in Age of Conan (which was in the OP's list of games that are TCP only) than this game.


Goodbye may seem forever
Farewell is like the end
But in my heart's the memory
And there you'll always be
-- The Fox and the Hound

 

Posted

In regards to the question being for the Devs, they *never* post in here. Ever. I have never seen even one Dev answer to these posts.

And yeah, I'm all for UDP if it solves some rubberbanding issues. As long as the game works, I'm good.

/Yep, another calling out from houtex, Devs. C'mon Castle, Babs, Posi, whoever... do it!
//I *Triple* Dog Dare ya!


August 31, 2012. A Day that will Live in Infamy. Or Information. Possibly Influence. Well, Inf, anyway. Thank you, Paragon Studios, for what you did, and the enjoyment and camaraderie you brought.
This is houtex, aka Mike, signing off the forums. G'night all. - 10/26/2012
Well... perhaps I was premature about that whole 'signing off' thing... - 11-9-2012

 

Posted

[ QUOTE ]
In regards to the question being for the Devs, they *never* post in here. Ever. I have never seen even one Dev answer to these posts.

And yeah, I'm all for UDP if it solves some rubberbanding issues. As long as the game works, I'm good.

/Yep, another calling out from houtex, Devs. C'mon Castle, Babs, Posi, whoever... do it!
//I *Triple* Dog Dare ya!

[/ QUOTE ]

Silly houtex, the point is that UDP SOLVES rubberbanding and disconnects because its more flexible than TCP.

And I don't think there ever was a switch 'away' from TCP in the first place.


 

Posted

[ QUOTE ]
[ QUOTE ]
Faster games where timing and accuracy are important use UDP.

[/ QUOTE ]

Timing and accuracy seemed to be more important in Age of Conan (which was in the OP's list of games that are TCP only) than this game.

[/ QUOTE ]

I think Age of Conan is probably more of a perfect example of when NOT to use TCP. TCP is easier to implement for an MMO or anything really, its was probably done to speed up the release, and it appears they have had serious lag/latency issues since day 1.


 

Posted

[ QUOTE ]
[ QUOTE ]
UDP packets being completely discardable is a good feature when the bulk of the packets are time sensitive. Very few live/faster twitch action games use TCP, slower simpler click games do.

[/ QUOTE ]

Yes, I agree that is true in principle. However, back in 2007, COH used TCP. And when it used it, the user base experienced a far lower amount of rubber-banding and mapserving than they began to see when the client connections were shifted to UDP.

So in this case, while the switch to UDP may have marginally improved responsiveness for users with slow connections, it caused other problems for a lot of folks.

Although I don't have the actual stats, I would hazard to guess that most folks who use COH are using a broadband data connection, whether that's DSL, Cable or Fiber. Bandwidth and latency are not major issues for them. They're not benefitting from the switch to UDP. They're only seeing the bad side of it -- the rubber-banding and mapserving -- whatever that's being caused by.

It may be that the reliability layer -- if one was implemented in COH -- needs further optimizing to help eliminate these problems, and with that bit of refinement, UDP would work just fine. In fact, that may be one of many features coming in Issue 15, for all we know.

-- Vivian

PS: Thanks for the article links. The TCP-vs-UDP article by Glenn does indeed have a strong emphasis on using only UDP, but if you read it all the way through, you realize he is focused on First-Person-Shooters and not MMOs. The comments at the end of the article were actually very informative -- top MMOs like World of Warcraft, Lineage I/II, Guild Wars, Ragnarok Online, Anarchy Online, Mabinogi and Age of Conan all use only TCP.

[/ QUOTE ]

TCP protocol determines effective bandwidth of connection as this: effective_bandwidth = recv_tcp_window_size / round_trip_time(RTT)

With standard 17.5K recv_tcp_window_size and RTT of 100 milliseconds, bandwidth will be restricted to 175 kilobytes/sec (T1). So if you have broadband connection then only fraction of that bandwidth can be utilized by TCP, where UDP can utilize whole available bandwidth.

BTW, 100 milliseconds rtt is what you have between East coast and West coast of USA. People connecting from Europe, NZ and Australia going to have much higher RTT, slowing TCP connection even more.


 

Posted

[ QUOTE ]

BTW, 100 milliseconds rtt is what you have between East coast and West coast of USA. People connecting from Europe, NZ and Australia going to have much higher RTT, slowing TCP connection even more.

[/ QUOTE ]

There are more layers on top that as well, server side TCP maintains the connection table at the stack/OS level vs just streaming UDP controlled from the 'application'.

So TCP will tend to put a cap on the maximum number of supported concurrent connections, and it will not degrade in performance gracefully (for the purposes of an online game) as you approach that limit.

2nd Life for example (not a fast twitch scenario by any means) had a TCP queue problem they fixed by switching to UDP, the problem was rooted in the servers TCP send queue filling up, but I forget exactly why.


 

Posted

TCP is reliable but slow, UDP is much faster but has no built-in reliability instead relying on the application to handle retransmits. Nothing to see here move along.


Infinity and Victory mostly
dUmb, etc.
lolz PvP anymore, Market PvP for fun and profit

 

Posted

The basic data in this game has been transmitted via UDP since at least Issue 10, mid-2007. That was when Leandro ran tests using a packet sniffer to help find the root cause of what those of us unfortunate enough to live in rural areas where dial-up is the only option (satellite being absolutely horrible in reliability, and having a built-in latency problem that makes it difficult to even connect to the CoH servers) called the "Dark Astoria bug", an overwhelming lag to the point of being knocked off of the server around all of the large spawns in Dark Astoria, among other places. There may have been a little bit of TCP used to send the initial placement on each zone map during the loading process, but that was all.

The "Ghost Zone bug", which was the initial iteration of the out of sync with the zone issue, began to be reported by players using a wide range of connection speeds during 2007. It just took a good while before the command to resync was added to give the players a tool to combat it.


"I wish my life was a non-stop Hollywood movie show,
A fantasy world of celluloid villains and heroes."

 

Posted

[ QUOTE ]
TCP is reliable but slow, UDP is much faster but has no built-in reliability instead relying on the application to handle retransmits. Nothing to see here move along.

[/ QUOTE ]

basically. Since coh seems to have both ports, I 'assume' it uses UDP for the game itself and TCP for QoL monitoring. That would be the smart thing to do.


50 Tanks: Invul/ss, Fire/ice/fire, Ice/em, Stone/fire
WP/Stone, dark/dark, shld/mace

50 Other: WS, SS/dark/sc brute, BS/Regen/WM scrpr, fire/fire/force blaster, rad/kin corr, mind/rad ctrl, ill/storm cntrl

 

Posted

CoH has been using UDP ever since I started playing it, back in early 2006. (I know this because I run a default deny all firewall, and have to explicitly open ports for everything I do. My port/protocol/IP allow list for CoH hasn't been touched since I started playing it.) At a guess, it hasn't been changed, ever.

As for other games using TCP, that doesn't stop them having problems (for instance, WoW - at least up until I stopped playing it in September last year - had a *serious* low level networking problem that considerably increased latency (and more problematically jitter) for everyone playing it, and the increased latency was worse the further you were from WoW's servers). Finally CoH isn't the only major MMO that uses UDP; to my certain knowledge, LoTRO also does so.


 

Posted

break out the packet sniffer and see if your lag is really network related. I find most complaints about lag are on the end machine. I've never had to open/forward any ports on my ASA or my tippingpoint IPS.


Horatus - lvl 50 Fire/Elec Blaster

 

Posted

Kind chopping things here...
[ QUOTE ]
[ QUOTE ]
And yeah, I'm all for UDP if it solves some rubberbanding issues. As long as the game works, I'm good.

[/ QUOTE ]
Silly houtex, the point is that UDP SOLVES rubberbanding and disconnects because its more flexible than TCP.

[/ QUOTE ]
o.0

I'm confused... did we just sorta agree?


August 31, 2012. A Day that will Live in Infamy. Or Information. Possibly Influence. Well, Inf, anyway. Thank you, Paragon Studios, for what you did, and the enjoyment and camaraderie you brought.
This is houtex, aka Mike, signing off the forums. G'night all. - 10/26/2012
Well... perhaps I was premature about that whole 'signing off' thing... - 11-9-2012

 

Posted

[ QUOTE ]
...I wrote the question in the hope that it might be passed inward at NCsoft, so that perhaps at one point one of these persons might at some point see it, and think about it.


[/ QUOTE ]
Cool, You may be right!

You may be right! The devs may have made these changes randomly, for no reason.
You may be right! They may not have planned and tested first.
You may be right! They may not still test or consider configuration alternatives occasionally.
You may be right! If your suggestion gets to them, they may slap their foreheads, and say "Wow!! Why didn't we think of that!?!"

You may be right! But I sort of somehow doubt it.

.


 

Posted

(QR)
Back in November of 2007, it did no good to run away from the Ghost of Scrapyard or the Clockwork Paladin - the (presumably TCP) packets would chase you everywhere until your computer processed them. Players with slow connections might as well restart the game when hit with lag, because it would be faster than waiting for all the obsolete messages they didn't care about in the first place to clear out of the queue.

Today, I still get huge piles of lag in situations that were lag-free in 2006, but e.g. quitting an AE arc that suddenly fills my netgraph with red bars will turn that netgraph back to a neatly trimmed green lawn almost as soon as the quit task force dialogs are processed.

As far as I'm concerned, going back to the unresponsiveness of TCP would be a step in the wrong direction. I'd rather the devs figure out why thousands of bytes have to be transmitted per second in some situations even though there's nothing apparently happening.