An Empirical Evaluation of TCP Performance in Online Games

4,535 views

Published on

A fundamental design question to ask in the development of a network game is—Which transport protocol should be used—TCP, UDP, or some other protocols? Seeking an objective answer to the choice of communication protocol for MMORPGs, we assess whether TCP, a popular choice, is suitable for MMORPGs based on empirical evidence. To the best of our knowledge, this work is the first evaluation of transport protocol performance using real-life game traces.

We analyze a 1, 356-million-packet trace from ShenZhou Online, a TCP-based, commercial, mid-sized MMORPG. Our analysis indicates that TCP is unwieldy and inappropriate for MMORPGs. This is due to four distinctive characteristics of MMORPG traffic: 1) tiny packets, 2) low packet rate, 3) application-limited traffic generation, and 4) bidirectional traffic. We show that because TCP was originally designed for unidirectional and network-limited bulk data transfers, it cannot adapt well to MMORPG traffic. In particular, the window-based congestion control and the fast retransmit algorithm for loss recovery are ineffective. Furthermore, TCP is overkill, as not every game packet needs to be transmitted in a reliably and orderly manner. We also show that the degraded network performance did impact users’ willingness to continue a game. Finally, we discuss guidelines in designing transport protocols for online games.

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,535
On SlideShare
0
From Embeds
0
Number of Embeds
1,832
Actions
Shares
0
Downloads
38
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

An Empirical Evaluation of TCP Performance in Online Games

  1. 1. An Empirical Evaluation of TCP Performance in Online Games Kuan-Ta Chen National Taiwan University Chun-Ying Huang Polly Huang Chin-Laung Lei Collaborators: ACE 2006
  2. 2. Talk Outline <ul><li>Motivation </li></ul><ul><li>Trace collection </li></ul><ul><li>Game traffic characteristics </li></ul><ul><li>Analysis of TCP performance </li></ul><ul><li>Design Implications </li></ul><ul><li>Conclusion </li></ul>
  3. 3. Motivation <ul><li>TCP is generally considered not suitable for real-time transmission </li></ul><ul><li>All first-person shooting games use UDP </li></ul><ul><li>No consensus has been reached for MMORPGs </li></ul><ul><ul><li>Heated debate occurs at game developers’ forums </li></ul></ul><ul><ul><li>Each protocol has quite a few proponents </li></ul></ul>Dark Age of Camelot TCP+UDP EverQuest, Star Wars Galaxies, City of Heroes, Ultima Online, Asherons Call, Final Fantasy XI UDP World of Warcraft, Lineage I/II, Guild Wars, Ragnarok Online, Anarchy Online, Mabinogi MMORPGs TCP Protocol
  4. 4. Motivation (cont.) Q1: Is TCP appropriate for MMORPGs? Q2: If not, how to design a suitable protocol? We try to answer these problems by empirical evidence.
  5. 5. Key Contributions / Findings <ul><li>TCP is unwieldy and inappropriate for MMORPGs </li></ul><ul><li>Estimate how long users will stay if a more suitable protocol is used ( 100 minutes  135 minutes ) </li></ul><ul><li>Proposed a number of design guidelines which exploit the unique characteristics of game traffic </li></ul>
  6. 6. 神州 Online <ul><li>A commercial MMORPG in Taiwan </li></ul><ul><li>Thousands of players online at anytime </li></ul><ul><li>TCP-based client-server architecture </li></ul>It’s me ShenZhou Online
  7. 7. Trace Collection 20 hours Trace Time 58.5 TB # Bytes 1,356 million # Packets 112,369 # TCP Conn
  8. 8. Game Traffic Characteristics <ul><li>Small packet size </li></ul><ul><ul><li>Most of client payload < 32 bytes </li></ul></ul><ul><ul><li>Average pkt size 84 bytes </li></ul></ul><ul><li>Low packet rate </li></ul><ul><ul><li>Client packet rate is 8 pkt/sec (avg.) </li></ul></ul><ul><ul><li>Most of server packet rate < 5 pkt /sec </li></ul></ul>
  9. 9. TCP Performance Analysis <ul><li>Protocol overhead </li></ul><ul><li>In-order delivery </li></ul><ul><li>Congestion control </li></ul><ul><li>Loss recovery </li></ul>
  10. 10. Protocol Overhead 38% packets are TCP ACK packets 46% bandwidth are used by TCP/IP headers
  11. 11. In-Order Delivery <ul><li>TCP enforces byte-level in-order delivery </li></ul><ul><li>Cons: a dropped packet causes a stall in subsequent network data until that packet is delivered </li></ul>1 2 3 4 6 7 5 Game application Game client Game server Internet TCP Data Buffer Missing data Cannot be processed until missing data are supplied (thus additional delay will be incurred)
  12. 12. In-Order Delivery is Not Always Required <ul><li>Server to client: state updates, dialogue messages, responses to users’ queries </li></ul><ul><li>Client to server: many commands are accumulative , e.g., position updates </li></ul>Packet 1 (X=10, Y=10) Processing packet 3 without waiting for packet 2 is OK and leads to more smooth game play Packet 2 (X=20, Y=12) Packet 3 (X=40, Y=5) X
  13. 13. Overhead of In-Order Delivery <ul><li>Assuming an ideal case that all packets can be processed in any order </li></ul><ul><li>The overhead of in-order delivery is measured by </li></ul><ul><ul><li>The increase of round-trip times (RTT) </li></ul></ul><ul><ul><li>The increase of RTT jitters (std. dev.) </li></ul></ul>
  14. 14. The Effect of In-Order Delivery on RTT 7% connections incurred more than 20% additional average RTTs .
  15. 15. The Effect of In-Order Delivery on RTT Jitter 22% connections incurred more than 100% additional RTT jitters . 6% connections incurred more than 200% additional RTT jitters . (std. dev. of RTTs)
  16. 16. Unbounded Congestion Window <ul><li>TCP’s congestion control is designed for network-limited application </li></ul><ul><ul><li>Relies on packet loss to adjust its congestion window </li></ul></ul><ul><li>Data generation in online games is often application-limited </li></ul><ul><ul><li>36% connections never experienced a packet loss </li></ul></ul><ul><li>Congestion window may never be reduced  unreasonably large window </li></ul><ul><li>If the game may occasionally generate a large burst of packets  unnecessary network congestion </li></ul>
  17. 17. Unnecessary Congestion Window Reset <ul><li>The “restart after idle periods” policy: TCP resets its window to 2 if a connection stops sending data for a short interval (usually < 1 second) </li></ul><ul><li>The policy prevents inappropriate bursts of packets being sent due to an out-of-date window </li></ul><ul><li>But, game packet rate is so low  window is occasionally reset (18% of packets faced a window reset) </li></ul><ul><li>In this case, a series of three commands following a thinking time will be penalized (the 3 rd packet will be delayed until the first two have been delivered) </li></ul>
  18. 18. Loss Recovery -- Retransmission TimeOut <ul><li>Originally, TCP only relies on a timer to detect packet loss and resend packets </li></ul>Receiver Time Data Retransmission Timeout (RTO) X Sender Data Re-transmit
  19. 19. Loss Recovery -- Fast Retransmit <ul><li>TCP Tahoe/Reno improves loss detection with duplicate acknowledgement packets </li></ul>Sender Receiver Time ACK Retransmission Timeout (RTO) X Data Fast-retransmit DUP ACKs
  20. 20. The Failure of Fast Retransmit <ul><li>Insufficient duplicate acks </li></ul><ul><ul><li>The game packet rate is too low </li></ul></ul><ul><ul><li>Required: more than 4 packets in (RTO – RTT) (mostly less than 400 ms) </li></ul></ul><ul><ul><li>Actual: < 5 packets per second </li></ul></ul><ul><li>Game traffic is bi-directional </li></ul><ul><ul><li>Both game clients and servers send out data packets </li></ul></ul><ul><ul><li>The definition of “duplication acks” requires each ack packet not contain data </li></ul></ul><ul><ul><li>The fast retransmit may not be triggered even sufficient dup acks are generated </li></ul></ul><ul><li>More than 99% dropped packets were not detected by fast retransmit </li></ul><ul><li>Average latency for non-dropped packets was 180 ms ; Average latency for dropped packets was 700 ms </li></ul><ul><li>This is why in-order delivery incurred so much overhead in transmission latency and delay jitters </li></ul>
  21. 21. Performance Impact on User Experience <ul><li>Based on the model describing the relationship between player departure rate and RTT, RTT jitter, and packet loss rate [INFOCOM 2006] </li></ul><ul><li>RTT jitter is raised from 77ms to 124ms due to in-order delivery </li></ul><ul><li>Assuming the additional RTT jitters due to TCP in-order delivery can be avoided, the player departure rate is expected to decrease by 20% (1/1.24 ≈ 0.8) </li></ul><ul><li>This corresponds to an increase of average game playing time from 100 minutes to 135 minutes </li></ul>exp((0.124 – 0.077) × 4.54 ) ≈ 1.24 l o g ( d e p a r t u r e r a t e ) / 1 9 : 2 £ r t t + 4 : 5 4 £ r t t : j i t t e r + 0 : 7 £ l o g ( c l o s s ) + 0 : 4 5 £ l o g ( s l o s s )
  22. 22. Protocol Design Guidelines (1) <ul><li>Supporting both reliable and unreliable delivery </li></ul><ul><ul><li>Some packets can be safely discarded without affecting gaming experience </li></ul></ul><ul><ul><li>E.g., A gesture of a character faraway from the notified character may need not to be reliably transmitted </li></ul></ul><ul><li>Supporting both in-order and out-of-order delivery </li></ul><ul><ul><li>Only ordering packets whenever absolutely necessary </li></ul></ul><ul><ul><li>E.g., Ordering is irrelevant for repeated attack actions (fight the same enemy with the same weapon) </li></ul></ul>
  23. 23. Protocol Design Guidelines (2) <ul><li>Accumulative delivery </li></ul><ul><ul><li>A new messages can override all the previous ones </li></ul></ul><ul><ul><li>Missing some packets in a series of accumulative commands does not matter (unless the last one in series is also dropped) </li></ul></ul><ul><ul><li>E.g., position updates </li></ul></ul><ul><li>Multiple streams </li></ul><ul><ul><li>Make messages as independent as possible </li></ul></ul><ul><ul><li>Messages need to be ordered only when they are in the same stream </li></ul></ul><ul><ul><li>E.g., chat messages are independent of game play commands </li></ul></ul>
  24. 24. Protocol Design Guidelines (3) <ul><li>Coordinated congestion control </li></ul><ul><ul><li>Tens of thousands of flows are not unusual </li></ul></ul><ul><ul><li>Difficult for all the flows to achieve an efficient bandwidth sharing by competition </li></ul></ul><ul><ul><li>Make congestion control in a coordinated , rather than competitive , manner </li></ul></ul><ul><ul><li>E.g., avoid dispatching game message synchronously for all game clients  alleviate traffic burstiness  reduce overall packet loss rate </li></ul></ul>
  25. 25. Summary <ul><li>TCP is designed for uni-directional bulk transfer, but game traffic has many unique features: </li></ul><ul><ul><li>Tiny packets </li></ul></ul><ul><ul><li>Low packet rate </li></ul></ul><ul><ul><li>Application-limited traffic generation </li></ul></ul><ul><ul><li>Bi-directional traffic </li></ul></ul><ul><li>TCP is unwieldy and inappropriate for MMORPGs </li></ul><ul><li>The degraded performance did impact users’ willingness to continue playing a game </li></ul><ul><li>A number of design guidelines have been proposed </li></ul>
  26. 26. Thank You! Kuan-Ta Chen

×