1 / 25

The TIME-WAIT state in TCP and its Effect on Busy Servers Theodore Faber University of Southern California

The TIME-WAIT state in TCP and its Effect on Busy Servers Theodore Faber University of Southern California. Xindian Long. Outline. TIME-WAIT state and its function Performance problems on busy web server Solution: move the TIME-WAIT to clients End points negotiation

flower
Download Presentation

The TIME-WAIT state in TCP and its Effect on Busy Servers Theodore Faber University of Southern California

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The TIME-WAIT state in TCP and its Effect on Busy ServersTheodore Faber University of Southern California Xindian Long

  2. Outline • TIME-WAIT state and its function • Performance problems on busy web server • Solution: move the TIME-WAIT to clients • End points negotiation • TCP, HTTP modification • Experiments • Conclusion

  3. Delayed Packet Problem

  4. TIME-WAIT State • Blocking connections between the same address/port pair • Holding a Time-Wait State at one endpoint • 2MSL • The end doing active close holds the TIME-WAIT State

  5. TIME-WAIT State

  6. TIME-WAIT state in the server • The server actively closes the connection, and maintains the TIME-WAIT state • Server sending data • TCP connection closure as end-of-transaction marker • Simple protocol, fast response Otherwise: Knowing the content length Extra end-of-transaction marker requires masking & restoring the marker

  7. Performance Problems on Busy Server • Too many connections in TIME-WAIT State • TCB Consumes memory • Slows active connections • A shorter MSL weaken the protection • Solutions like persistent connection are not enough

  8. Solution: TIME-WAIT in Clients • Blocking at one end is enough • Move the TIME-WAIT to the Client • End points negotiating • TCP Modification • HTTP Modification • Scales better than persistent connection

  9. SYN (TW-Negotiate) SYN, Ack (TW-Negotiate set to its choice) If Acceptable Ack (TW-Negotiate set to the same value) If not Acceptable RST Client Server TIME-WAIT Negotiation Non-simultaneous connection establishment

  10. TIME-WAIT Negotiation Simultaneous connection establishment SYN (TW-Negotiate) SYN (TW-Negotiate) SYN-RCVD SYN-RCVD endpoint1 endpoint2

  11. TIME-WAIT Negotiation • Advantage • Makes post-connection memory requirement explict • Transparent to applications • No hidden performance penalty • Disadvantage • Significant change to TCP state machine • Information from connection establishment affects the closure • Negotiating at closure reduces endpoints’ control over their resource

  12. Final Ack TW RST TW TCP Level Solution • Modify the clients’ TCP implementation • Sends a RST packet to the server • Puts itself into a TIME-WAIT state closed Client Server

  13. Modified TCP State Machine

  14. TCP Level Solution • Only works for system that accepts <RST> in TIME-WAIT state • Performance limited by the way <RST> is processed • Changes the meaning of <RST> packet

  15. Application Level Solution • Decouple the end-of-connection with end-of-transaction indication • HTTP 1.1 Modification • Content Length as the end of transaction • New Extension Request: CLIENT_CLOSE • The client opens a connection • Sending series of requests • Collecting the response • Sending a Client-Close, closing connection • The server closes its end without responding

  16. data Detect the end of data CLIENT_CLOSE close FIN . . . Client Server CLIENT_CLOSE Extention [Conection: close] line Last request: Connection: close data close FIN . . . Client Server

  17. Application Level Solution • CLIENT-WAIT notify the server about the client close • Requires change only on the client side • Conforms to HTTP 1.1 • Requires no change to other protocols • Creates no new security vulnerability • ONLY reduces the load by HTTP

  18. Experiments • Environment • Implemented under SUNOS 4.1.3 • Evaluation using custom benchmark program and WebSTONE benchmark • 640 Mb/s Myrinet LAN • Three Tests • Demonstration of Worst-case Server Loading • HTTP Experiment • Time wait avoidance and Persistent Connections

  19. Demonstration of Worst-CaseServer Loading • Test Configuration • A Server • Two clients doing simultaneous bulk transfer • Server loaded with TIME-WAIT state by a fourth machine • Constructing a worst case scenario • Client connections are put at the end of the list of TCBs • Two clients are used to neutralize the simple caching behavior • Two distinct clients allow bursts from different clients to interleave

  20. Demonstration of Worst-CaseServer Loading

  21. HTTP Load Experiments Two workstations each running 20 clients File Size: 9KB-5MB 8 clients on 4 workstations, small files

  22. TIME-WAIT Avoidance andPersistent Connection 2 Client machine, 1 Server 5 HTTP request bursts 10 request / Connection Throughput vs. Clients

  23. TIME-WAIT Avoidance andPersistent Connection Connection Rate vs. Clients

  24. TIME-WAIT Avoidance andPersistent Connection Memory vs. Clients

  25. Conclusion TCP With TCP With CLIENT_CLOSE TIME-WAIT Client HTTP Negotiation <RST> Extension Reduces TIME-WAIT Loading Yes Yes Yes Compatible With Current Protocols Yes Yes Yes Changes Are Effective If Only No Yes Yes The Client Is Modified Allows System To Prevent Yes No Yes TIME-WAIT Assassination No Changes To Transport Protocol No No Yes No Changes To Application Protocols Yes Yes No Adds No Packet Exchanges To Yes No No Modified Protocol TIME-WAIT Allocation Is A Requirement Yes No No of Connection Establishment

More Related