340 likes | 424 Views
TCP Behavior of a Busy Web Server: Analysis and Improvements. Nitin Gupta Sandhya Gupta. Outline. TCP basics Problems with Internet Key observations Integrated Congestion & Loss Management Congestion Manager Implementation Some issues for discussion. Overall TCP Behavior.
E N D
TCP Behavior of a Busy Web Server:Analysis and Improvements Nitin Gupta Sandhya Gupta
Outline • TCP basics • Problems with Internet • Key observations • Integrated Congestion & Loss Management • Congestion Manager Implementation • Some issues for discussion
Overall TCP Behavior Congestion Avoidance Congestion Window Slow Start ssthresh Time • Slow Start – Double window every RTT • Congestion Avoidance – Increase window by 1 MSS every RTT
Retransmissions • Timeout • RTO = b * RTT, where b = 2 • Many TCP implementations set RTO in multiples of 200,500,1000ms • Fast Retransmit • Use receipt of 3 or more dupacks* as indication of loss • Don’t wait for timeout to retransmit packet * Dupacks (Duplicate acks) - Repeated acks for the same sequence
Fast Retransmit Retransmission X Duplicate Acks Sequence No Data packets Acks Time
Two Questions Internet • Q2: Can we remain sanguine about the future outlook? Router Shared infrastructure and overload causes congestion • Q1: Why has the Internet not crumbled under its own load in recent years? • A: Soundness of TCP congestion control + friendly TCP workload A: Not Really!!!
Internet Problem #1: The Web r1 • Multiple reliable streams • Individual objects are small • So what? • N “slow starts” =Far too inefficient! • No shared learning =Far too aggressive! r2 r3 Server Client r-n
Internet Problem #2: Application Heterogeneity u1 r1 u2 • New applications (e.g., real-time streams) • The world isn’t only about HTTP or even TCP! • So what? Applications do not adapt to congestion Long-term Internet stability is threatened r2 u3 r3 Server Client u-m r-n
Motivation • Understand TCP behavior and performance in the Internet today, in the context of HTTP • Identify problems and shortcomings in TCP • Identify any possible protocol improvements • Focus primarily on sender-side changes to TCP, to enable easy deployment • Testbed: IBM’s 1996 Olympic WWW server • Hundreds of thousands of clients • Tens of millions of hits per day
Trace Collector Web Server Setup Token Ring Load Balancing Router Web Client Router Token Ring Client Request Server Response Internet ATM Switch Server Nodes HTTP Request, TCP acks TCP data packets
Data Collection Methodology • Had access only to incoming traffic, i.e., all HTTP request packets and TCP acks but not data sent • Modified Web servers to announce when TCP performed a retransmission • TCP emulation engine reconstructs precise sender behavior and evolution of TCP state variables
Receiver Socket Buffer • Receiver Buffer was Bottleneck in 14% of connections • Should increase from a default value of 4k
Analysis of Individual Connections • Strong correlation between loss probability and Ack bandwidth ratio / Ack compression • Ack compression factor easier to compute
Analysis of Concurrent Connections • Effective multiplicative decrease of concurrent connections is 0.6-0.75 • Concurrent connections window behavior is more aggressive than standard TCP Reno
Enhanced TCP Loss Recovery • Send a new packet when first or second duplicate ack arrives as enablesbetter data-driven loss recovery. • Avoided 25% of all coarsetimeouts (compared to only 4% with basic SACKs).
“Solution” #1: Persistent Connections r1 Put everyone on same ordered byte stream r2 r3 Server Client r-n While this fixes some of the problems of independent connections, it really is a step in the wrong direction! 1. Far too much coupling between objects 2. Far too application-specific 3. Does not enable application adaptation
“Solution” #2: Integrated TCP Sessions r1 r2 r3 Server Client r-n • Independent TCP connections, but shared control parameters • But many applications don’t want a connection-oriented reliable in-order stream of data
Internet What is the World Heading Toward? u1 r1 u2 r2 u3 r3 Server Client u-m r-n • The world won’t be just HTTP • The world won’t be just TCP Logically different streams (objects) should be kept separate, yet efficient congestion management must be performed.
Congestion Manager What We Really Need… HTTP Audio Video1 Video2 An integrated approach to end-to-end congestion management for the Internet using the CM TCP1 TCP2 UDP IP
Integrated Congestion Control • Problem: poor congestion control and loss recovery by short, concurrent connections • Solution: integrated congestion control and loss recovery across multiple concurrent connections • One Congestion wnd per macro-flow • AIMD • Congestion wnd halved on a packet loss • Exponential aging when feedback low • Halve window every RTT (minimum)
Integrated Loss Recovery 1 2 Router Server 3 2 3 1 Client Later acks Router Server Client 1 1 1 2 3 dupack Router 2 Server Client 3 Acknowledgments Data Packets
TCP Sack vs TCP-INT • Integrated loss recovery helps prevent coarse timeouts • Integrated congestion control allows different connections to obtain equal share of bandwidth • Later connections do not have to slow start
Results: Integrated Congestion Control • TCP-SACK does per-connection congestion control, TCP-INT does per-host • TCP-INT connection C avoids performing slow-start
CM Linux Implementation App stream Stream requests, updates cmapp_*() libcm.a User-level library; implements API System calls (e.g., ioctl) Control socket for callbacks UDP-CC TCP CM macroflows, kernel API Congestion controller Scheduler Prober ip_output() ip_output() cm_notify() IP
CM TCP Performance TCP Newreno Flows using CM show good social behavior Sequence number With CM Time (s) CM greatly improves performance predictability and consistency
System Performance
Summary • CM enables proper and stable congestion behavior • Simple API to enable application to learn and adapt to network state • Improves consistency and predictability of network transfers • CM provides benefit even when deployed at senders alone
Some Issues for Discussion • Why should anyone deploy it? (Given that total throughput is less than sum of individual throughputs). • How much is the system overhead if a user-space application uses the provided APIs? • What are the other possible ways of forming macro-flows? • How practical is CM’s deployment? (presently implemented only in kernel version 2.2.9) • CM is specific to unicast flows but what about multicast?
Multiple Losses X X Now what? X Retransmission X Duplicate Acks Sequence No Time
Tahoe X X X X Sequence No Time
Reno X X X Now what? - timeout X Sequence No Time
NewReno X X X Now what? – partial ack recovery X Sequence No Time
SACK X X X Now what? – send retransmissions as soon as detected X Sequence No Time