26
An Empirical Evaluation An Empirical Evaluation of of TCP Performance in Online TCP Performance in Online Games Games Kuan-Ta Chen National Taiwan University Chun-Ying Huang Polly Huang Chin-Laung Lei Collaborator s: ACE 2006

An Empirical Evaluation of TCP Performance in Online Games

Embed Size (px)

DESCRIPTION

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.

Citation preview

Page 1: An Empirical Evaluation of TCP Performance in Online Games

An Empirical Evaluation of An Empirical Evaluation of TCP Performance in Online TCP Performance in Online

GamesGames

Kuan-Ta Chen

National Taiwan University

Chun-Ying Huang Polly HuangChin-Laung Lei

Collaborators:

ACE 2006

Page 2: An Empirical Evaluation of TCP Performance in Online Games

2An Empirical Evaluation of TCP Performance in Online Games

Talk OutlineTalk Outline

Motivation

Trace collection

Game traffic characteristics

Analysis of TCP performance

Design Implications

Conclusion

Page 3: An Empirical Evaluation of TCP Performance in Online Games

3An Empirical Evaluation of TCP Performance in Online Games

MotivationMotivation

TCP is generally considered not suitable for real-time transmission

All first-person shooting games use UDP

No consensus has been reached for MMORPGs

Heated debate occurs at game developers’ forums

Each protocol has quite a few proponents

Protocol MMORPGs

TCP World of Warcraft, Lineage I/II, Guild Wars, Ragnarok Online, Anarchy Online, Mabinogi

UDP EverQuest, Star Wars Galaxies, City of Heroes, Ultima Online, Asherons Call, Final Fantasy XI

TCP+UDP

Dark Age of Camelot

Page 4: An Empirical Evaluation of TCP Performance in Online Games

4An Empirical Evaluation of TCP Performance in Online Games

Motivation (cont.)Motivation (cont.)

Q1: Is TCP appropriate for MMORPGs?

Q2: If not, how to design a suitable protocol?

We try to answer these problems byempirical evidence.

Page 5: An Empirical Evaluation of TCP Performance in Online Games

5An Empirical Evaluation of TCP Performance in Online Games

Key Contributions / FindingsKey Contributions / Findings

TCP is unwieldy and inappropriate for MMORPGs

Estimate how long users will stay if a more suitable protocol is used (100 minutes 135 minutes)

Proposed a number of design guidelines which exploit the unique characteristics of game traffic

Page 6: An Empirical Evaluation of TCP Performance in Online Games

6An Empirical Evaluation of TCP Performance in Online Games

神州 神州 OnlineOnline

It’s me

ShenZhou Online

A commercial MMORPG in Taiwan

Thousands of players online at anytime

TCP-based client-server architecture

Page 7: An Empirical Evaluation of TCP Performance in Online Games

7An Empirical Evaluation of TCP Performance in Online Games

Trace CollectionTrace Collection

Internet

Traffic Monitor

L3 switch

L2 switchL4 switch

Game & Database servers

Monitoringinterface

Managementinterface

Gig

abit

Eth

erne

t

Port forwarding

Game Traffic

Trace Time

# TCP Conn # Packets # Bytes

20 hours 112,369 1,356 million 58.5 TB

Page 8: An Empirical Evaluation of TCP Performance in Online Games

8An Empirical Evaluation of TCP Performance in Online Games

Game Traffic CharacteristicsGame Traffic Characteristics

Small packet size

Most of client payload < 32 bytes

Average pkt size 84 bytes

Low packet rate

Client packet rate is 8 pkt/sec (avg.)

Most of server packet rate < 5 pkt /sec

Page 9: An Empirical Evaluation of TCP Performance in Online Games

9An Empirical Evaluation of TCP Performance in Online Games

TCP Performance AnalysisTCP Performance Analysis

Protocol overhead

In-order delivery

Congestion control

Loss recovery

Page 10: An Empirical Evaluation of TCP Performance in Online Games

10An Empirical Evaluation of TCP Performance in Online Games

Protocol OverheadProtocol Overhead

38% packets are TCP ACK packets

46% bandwidth are used by TCP/IP headers

Page 11: An Empirical Evaluation of TCP Performance in Online Games

11An Empirical Evaluation of TCP Performance in Online Games

In-Order DeliveryIn-Order Delivery

TCP enforces byte-level in-order delivery

Cons: a dropped packet causes a stall in subsequent network data until that packet is delivered

1 2 3 4 6 75

Game application

Game client

Game server

Internet

TCP Data Buffer

Missing dataCannot be processed until missing data are supplied(thus additional delay will be incurred)

Page 12: An Empirical Evaluation of TCP Performance in Online Games

12An Empirical Evaluation of TCP Performance in Online Games

In-Order Delivery is In-Order Delivery is NotNot Always Always RequiredRequired

Server to client: state updates, dialogue messages, responses to users’ queries

Client to server: many commands are accumulative, e.g., position updates

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

Page 13: An Empirical Evaluation of TCP Performance in Online Games

13An Empirical Evaluation of TCP Performance in Online Games

Overhead of In-Order DeliveryOverhead of In-Order Delivery

Assuming an ideal case that all packets can be processed in any order

The overhead of in-order delivery is measured by

The increase of round-trip times (RTT)

The increase of RTT jitters (std. dev.)

Page 14: An Empirical Evaluation of TCP Performance in Online Games

14An Empirical Evaluation of TCP Performance in Online Games

The Effect of In-Order Delivery on RTTThe Effect of In-Order Delivery on RTT

7% connections incurred more than 20% additional average RTTs.

Page 15: An Empirical Evaluation of TCP Performance in Online Games

15An Empirical Evaluation of TCP Performance in Online Games

The Effect of In-Order Delivery on RTT The Effect of In-Order Delivery on RTT JitterJitter

22% connections incurred more than 100% additional RTT jitters.

6% connections incurred more than 200% additional RTT jitters.

(std. dev. of RTTs)

Page 16: An Empirical Evaluation of TCP Performance in Online Games

16An Empirical Evaluation of TCP Performance in Online Games

Unbounded Congestion WindowUnbounded Congestion Window

TCP’s congestion control is designed for network-limited application

Relies on packet loss to adjust its congestion window

Data generation in online games is often application-limited

36% connections never experienced a packet loss

Congestion window may never be reduced unreasonably large window

If the game may occasionally generate a large burst of packets unnecessary network congestion

Page 17: An Empirical Evaluation of TCP Performance in Online Games

17An Empirical Evaluation of TCP Performance in Online Games

Unnecessary Congestion Window Unnecessary Congestion Window ResetReset

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)

The policy prevents inappropriate bursts of packets being sent due to an out-of-date window

But, game packet rate is so low window is occasionally reset (18% of packets faced a window reset)

In this case, a series of three commands following a thinking time will be penalized (the 3rd packet will be delayed until the first two have been delivered)

Page 18: An Empirical Evaluation of TCP Performance in Online Games

18An Empirical Evaluation of TCP Performance in Online Games

Loss Recovery -- Retransmission Loss Recovery -- Retransmission TimeOutTimeOut

Originally, TCP only relies on a timer to detect packet loss and resend packets

Receiver

Time

Data

RetransmissionTimeout (RTO)

XSender

Data Re-transmit

Page 19: An Empirical Evaluation of TCP Performance in Online Games

19An Empirical Evaluation of TCP Performance in Online Games

Loss Recovery -- Fast RetransmitLoss Recovery -- Fast Retransmit

TCP Tahoe/Reno improves loss detection with duplicate acknowledgement packets

Sender Receiver

Time

ACKRetransmissionTimeout (RTO)

XData

Fast-retransmit

DUP ACKs

Page 20: An Empirical Evaluation of TCP Performance in Online Games

20An Empirical Evaluation of TCP Performance in Online Games

The Failure of Fast RetransmitThe Failure of Fast Retransmit

Insufficient duplicate acks

The game packet rate is too low

Required: more than 4 packets in (RTO – RTT) (mostly less than 400 ms)

Actual: < 5 packets per second

Game traffic is bi-directional

Both game clients and servers send out data packets

The definition of “duplication acks” requires each ack packet not contain data

The fast retransmit may not be triggered even sufficient dup acks are generated

More than 99% dropped packets were not detected by fast retransmit

Average latency for non-dropped packets was 180 ms;Average latency for dropped packets was 700 ms

This is why in-order delivery incurred so much overhead in transmission latency and delay jitters

Page 21: An Empirical Evaluation of TCP Performance in Online Games

21An Empirical Evaluation of TCP Performance in Online Games

Performance Impact on User Performance Impact on User ExperienceExperience

Based on the model describing the relationship between player departure rate and RTT, RTT jitter, and packet loss rate [INFOCOM 2006]

RTT jitter is raised from 77ms to 124ms due to in-order delivery

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)

This corresponds to an increase of average game playing time from 100 minutes to 135 minutes

log(departure rate) / 19:2£ rtt +4:54£ rtt:j itter +

0:7£ log(closs) +0:45£ log(sloss)

exp((0.124 – 0.077) × 4.54) ≈ 1.24

Page 22: An Empirical Evaluation of TCP Performance in Online Games

22An Empirical Evaluation of TCP Performance in Online Games

Protocol Design Guidelines (1)Protocol Design Guidelines (1)

Supporting both reliable and unreliable delivery

Some packets can be safely discarded without affecting gaming experience

E.g., A gesture of a character faraway from the notified character may need not to be reliably transmitted

Supporting both in-order and out-of-order delivery

Only ordering packets whenever absolutely necessary

E.g., Ordering is irrelevant for repeated attack actions (fight the same enemy with the same weapon)

Page 23: An Empirical Evaluation of TCP Performance in Online Games

23An Empirical Evaluation of TCP Performance in Online Games

Protocol Design Guidelines (2)Protocol Design Guidelines (2)

Accumulative delivery

A new messages can override all the previous ones

Missing some packets in a series of accumulative commands does not matter (unless the last one in series is also dropped)

E.g., position updates

Multiple streams

Make messages as independent as possible

Messages need to be ordered only when they are in the same stream

E.g., chat messages are independent of game play commands

Page 24: An Empirical Evaluation of TCP Performance in Online Games

24An Empirical Evaluation of TCP Performance in Online Games

Protocol Design Guidelines (3)Protocol Design Guidelines (3)

Coordinated congestion control

Tens of thousands of flows are not unusual

Difficult for all the flows to achieve an efficient bandwidth sharing by competition

Make congestion control in a coordinated, rather than competitive, manner

E.g., avoid dispatching game message synchronously for all game clients alleviate traffic burstiness reduce overall packet loss rate

Page 25: An Empirical Evaluation of TCP Performance in Online Games

25An Empirical Evaluation of TCP Performance in Online Games

SummarySummary

TCP is designed for uni-directional bulk transfer, but game traffic has many unique features:

Tiny packets

Low packet rate

Application-limited traffic generation

Bi-directional traffic

TCP is unwieldy and inappropriate for MMORPGs

The degraded performance did impact users’ willingness to continue playing a game

A number of design guidelines have been proposed

Page 26: An Empirical Evaluation of TCP Performance in Online Games

Thank You!Thank You!

Kuan-Ta Chen