SlideShare a Scribd company logo
1 of 19
Download to read offline
SPDY, TCP,
         and the
Single Connection Throttle

         Mike Belshe
     mbelshe@google.com
           04/01/11
A New Protocol? What for?

               Speed.
State of the Web Page

 An average Web Page Consists of:
     ~44 resources
     ~7 hosts
     ~320KB
     ~66% compressed (top sites are ~90% compressed)
     Note: HTTPS is < 50% compressed.
 Incremental improvements to HTTP don't move the needle
     Transparent proxies change the content.
     Example: pipelining
     Example: stripped "Accept-Encoding" headers
        we can't even improve "negotiated" compression!
Quick SPDY Background
 Goals:
    Faster web page downloads
    Always secure
    Deployable
    Open
 Features (No rocket science here!)
    Single-connection, Multiplexed, prioritized streams
    Mandatory header compression
    Supports server-push
 SPDY is Basic Networking "blocking and tackling"
    Use fewer connections
    Send fewer bytes
HTTP Connection Use Today




Average: 29 connections per page.

25%-tile = 10   50%-tile = 20   75%-tile = 39   95%-tile = 78
Reducing Upload Bytes
Reducing Download Bytes
Reducing Total Packets
Increasing Parallelism
The Single Connection Throttle
Throttle #1: CWND

Problem:
   Server-side slow start limits server to N packets. (in flux)

Workaround:
  Use more client connections.
  Update server to go beyond spec.
  SPDY can use a cookie based cwnd.

Note:
   HTTP's per-domain cwnd is currently ~24 (6*4).
   draft-ietf-tcpm-initcwnd-00.txt helps
Throttle #1 CWND vs # connections
Throttle #2: Receive Windows
Problem:
   Some clients set initial rwnd to 5840 bytes (4 pkts)
   Trumps larger cwnd on servers.
   Patch just shipped this month in linux mainline
Workaround:
   Use more client connections.
Throttle #2: Init rwnd
Throttle #3: Intermediaries
Problem:
   "Just a bug"... but... Intermediaries can (and do) tamper.
   window scale enables large receive windows.
Workaround:
   Use more client connections.



Client Side                     Server Side
// Client wants window          // Server recvs window
// scaling 6.                   // scale 3. Someone
                                // tampered with this.
SYN -> w=5840, ws=6             SYN -> w=5840, ws=3
// Client receives server       // Server sends its own
// ws as sent.                  // ws of 6.
SYNACK <- w=5840, ws=6          SYNACK <- w=5840, ws=6

// going to be slow....
Throttle #4: Congestion Control

Problem:
   Congestion detection decreases the send rate.
   But congestion signals can be erroneous.
   Applied to the connection, not the path:
      1 connection: single packet loss cuts send rate by N
      (typically 0.5/0.7).
      6 connections: single packet loss cuts send rate by
      1/6*(1/N) == (~1/9th to 1/12th)

Workaround:
  Use more client connections.
Too Obsessed With 1 Connection?

 Could we use 2? 3?
    Sure, but it neutralizes many of our benefits.
 Disadvantages of multiple connections:
    Sharing state across connections is hard.
    Server farms would be required to do sticky load
    balancing
    Compression worsens (we use stateful compression)
    Prioritization becomes impossible
    Server push difficult
 But it shouldn't be this hard...
How Much Does A Handshake Cost?
What's Next?
 Before SPDY, we could blame the app layer (HTTP).
 With SPDY, we're on the verge of proving that the transport
 is the new bottleneck.
 TCP needs to address 2 performance obstacles:
     Data in initial handshake.
     Single connection taxes.
 TCP needs to address security
     Both Server Auth & Encryption
     (Sorry I didn't have time to discuss in this talk!)

 How can we iterate on the transport when it is buried in the
 kernel? Can we auto-update the network stack?

More Related Content

What's hot

What HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For YouWhat HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For YouMark Nottingham
 
GlobalDots - How Latency & Bandwidth Influence your Web Performance
GlobalDots - How Latency & Bandwidth Influence your Web PerformanceGlobalDots - How Latency & Bandwidth Influence your Web Performance
GlobalDots - How Latency & Bandwidth Influence your Web PerformanceGlobalDots
 
HTTP2 & HPACK #pyfes 2013-11-30
HTTP2 & HPACK #pyfes 2013-11-30HTTP2 & HPACK #pyfes 2013-11-30
HTTP2 & HPACK #pyfes 2013-11-30Jxck Jxck
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 IntroductionWalter Liu
 
HTTP/2 for Developers
HTTP/2 for DevelopersHTTP/2 for Developers
HTTP/2 for DevelopersSvetlin Nakov
 
Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)Viktor Turskyi
 
HTTP/2 standard for video streaming
HTTP/2 standard for video streamingHTTP/2 standard for video streaming
HTTP/2 standard for video streamingHung Thai Le
 
HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and WhyAdrian Cole
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
Web Performance Optimization @Develer
Web Performance Optimization @DevelerWeb Performance Optimization @Develer
Web Performance Optimization @DevelerMassimo Iacolare
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
Taking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketTaking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketShahriar Hyder
 
Reaching 5 Million Messaging Connections: Our Journey with Kubernetes
Reaching 5 Million Messaging Connections:  Our Journey with KubernetesReaching 5 Million Messaging Connections:  Our Journey with Kubernetes
Reaching 5 Million Messaging Connections: Our Journey with KubernetesConnected
 
Using RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolUsing RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolTho Q Luong Luong
 
NetScaler Web2.0 Push Technology Overview
NetScaler Web2.0 Push Technology OverviewNetScaler Web2.0 Push Technology Overview
NetScaler Web2.0 Push Technology Overviewkvamsi
 

What's hot (20)

Http smuggling 1 200523064027
Http smuggling 1 200523064027Http smuggling 1 200523064027
Http smuggling 1 200523064027
 
What HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For YouWhat HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For You
 
GlobalDots - How Latency & Bandwidth Influence your Web Performance
GlobalDots - How Latency & Bandwidth Influence your Web PerformanceGlobalDots - How Latency & Bandwidth Influence your Web Performance
GlobalDots - How Latency & Bandwidth Influence your Web Performance
 
Http2 right now
Http2 right nowHttp2 right now
Http2 right now
 
HTTP2 & HPACK #pyfes 2013-11-30
HTTP2 & HPACK #pyfes 2013-11-30HTTP2 & HPACK #pyfes 2013-11-30
HTTP2 & HPACK #pyfes 2013-11-30
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
 
HTTP/2 for Developers
HTTP/2 for DevelopersHTTP/2 for Developers
HTTP/2 for Developers
 
Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)
 
HTTP/2 standard for video streaming
HTTP/2 standard for video streamingHTTP/2 standard for video streaming
HTTP/2 standard for video streaming
 
HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and Why
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Web Performance Optimization @Develer
Web Performance Optimization @DevelerWeb Performance Optimization @Develer
Web Performance Optimization @Develer
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Websocket
WebsocketWebsocket
Websocket
 
Taking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketTaking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocket
 
Reaching 5 Million Messaging Connections: Our Journey with Kubernetes
Reaching 5 Million Messaging Connections:  Our Journey with KubernetesReaching 5 Million Messaging Connections:  Our Journey with Kubernetes
Reaching 5 Million Messaging Connections: Our Journey with Kubernetes
 
What is SPDY
What is SPDYWhat is SPDY
What is SPDY
 
Using RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolUsing RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocol
 
SPDY @Zynga
SPDY @ZyngaSPDY @Zynga
SPDY @Zynga
 
NetScaler Web2.0 Push Technology Overview
NetScaler Web2.0 Push Technology OverviewNetScaler Web2.0 Push Technology Overview
NetScaler Web2.0 Push Technology Overview
 

Similar to SPDY, TCP, and the Single Connection Throttle

Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IPvijai s
 
What every Java developer should know about network?
What every Java developer should know about network?What every Java developer should know about network?
What every Java developer should know about network?aragozin
 
NY Web Perf Meetup: Peeling the Web Performance Onion
NY Web Perf Meetup: Peeling the Web Performance OnionNY Web Perf Meetup: Peeling the Web Performance Onion
NY Web Perf Meetup: Peeling the Web Performance OnionCatchpoint Systems
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser NetwrokingShuya Osaki
 
SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012Fabian Lange
 
Network and TCP performance relationship workshop
Network and TCP performance relationship workshopNetwork and TCP performance relationship workshop
Network and TCP performance relationship workshopKae Hsu
 
Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocolsDaniel Austin
 
加快互联网核心协议,提高Web速度yuchungcheng
加快互联网核心协议,提高Web速度yuchungcheng加快互联网核心协议,提高Web速度yuchungcheng
加快互联网核心协议,提高Web速度yuchungchengMichael Zhang
 
HTTP at your local BigCo
HTTP at your local BigCoHTTP at your local BigCo
HTTP at your local BigCopgriess
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebSteffen Gebert
 
HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612
HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612
HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612Avenga Germany GmbH
 
Web Performance Automation - NY Web Performance Meetup
Web Performance Automation - NY Web Performance MeetupWeb Performance Automation - NY Web Performance Meetup
Web Performance Automation - NY Web Performance MeetupStrangeloop
 
A SPDYier Experience by Olaniyi Jinadu
A SPDYier Experience by Olaniyi JinaduA SPDYier Experience by Olaniyi Jinadu
A SPDYier Experience by Olaniyi JinaduOlaniyi Jinadu
 
UAV Data Link Design for Dependable Real-Time Communications
UAV Data Link Design for Dependable Real-Time CommunicationsUAV Data Link Design for Dependable Real-Time Communications
UAV Data Link Design for Dependable Real-Time CommunicationsGerardo Pardo-Castellote
 

Similar to SPDY, TCP, and the Single Connection Throttle (20)

The SPDY Protocol
The SPDY ProtocolThe SPDY Protocol
The SPDY Protocol
 
Tieu luan qo s
Tieu luan qo sTieu luan qo s
Tieu luan qo s
 
Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IP
 
What every Java developer should know about network?
What every Java developer should know about network?What every Java developer should know about network?
What every Java developer should know about network?
 
NY Web Perf Meetup: Peeling the Web Performance Onion
NY Web Perf Meetup: Peeling the Web Performance OnionNY Web Perf Meetup: Peeling the Web Performance Onion
NY Web Perf Meetup: Peeling the Web Performance Onion
 
NE #1.pptx
NE #1.pptxNE #1.pptx
NE #1.pptx
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser Netwroking
 
SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012
 
Network and TCP performance relationship workshop
Network and TCP performance relationship workshopNetwork and TCP performance relationship workshop
Network and TCP performance relationship workshop
 
Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocols
 
加快互联网核心协议,提高Web速度yuchungcheng
加快互联网核心协议,提高Web速度yuchungcheng加快互联网核心协议,提高Web速度yuchungcheng
加快互联网核心协议,提高Web速度yuchungcheng
 
HTTP at your local BigCo
HTTP at your local BigCoHTTP at your local BigCo
HTTP at your local BigCo
 
Internet
InternetInternet
Internet
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
 
HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612
HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612
HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612
 
Http2 kotlin
Http2   kotlinHttp2   kotlin
Http2 kotlin
 
Web Performance Automation - NY Web Performance Meetup
Web Performance Automation - NY Web Performance MeetupWeb Performance Automation - NY Web Performance Meetup
Web Performance Automation - NY Web Performance Meetup
 
A SPDYier Experience by Olaniyi Jinadu
A SPDYier Experience by Olaniyi JinaduA SPDYier Experience by Olaniyi Jinadu
A SPDYier Experience by Olaniyi Jinadu
 
SPDY Talk
SPDY TalkSPDY Talk
SPDY Talk
 
UAV Data Link Design for Dependable Real-Time Communications
UAV Data Link Design for Dependable Real-Time CommunicationsUAV Data Link Design for Dependable Real-Time Communications
UAV Data Link Design for Dependable Real-Time Communications
 

SPDY, TCP, and the Single Connection Throttle

  • 1. SPDY, TCP, and the Single Connection Throttle Mike Belshe mbelshe@google.com 04/01/11
  • 2. A New Protocol? What for? Speed.
  • 3. State of the Web Page An average Web Page Consists of: ~44 resources ~7 hosts ~320KB ~66% compressed (top sites are ~90% compressed) Note: HTTPS is < 50% compressed. Incremental improvements to HTTP don't move the needle Transparent proxies change the content. Example: pipelining Example: stripped "Accept-Encoding" headers we can't even improve "negotiated" compression!
  • 4. Quick SPDY Background Goals: Faster web page downloads Always secure Deployable Open Features (No rocket science here!) Single-connection, Multiplexed, prioritized streams Mandatory header compression Supports server-push SPDY is Basic Networking "blocking and tackling" Use fewer connections Send fewer bytes
  • 5. HTTP Connection Use Today Average: 29 connections per page. 25%-tile = 10 50%-tile = 20 75%-tile = 39 95%-tile = 78
  • 11. Throttle #1: CWND Problem: Server-side slow start limits server to N packets. (in flux) Workaround: Use more client connections. Update server to go beyond spec. SPDY can use a cookie based cwnd. Note: HTTP's per-domain cwnd is currently ~24 (6*4). draft-ietf-tcpm-initcwnd-00.txt helps
  • 12. Throttle #1 CWND vs # connections
  • 13. Throttle #2: Receive Windows Problem: Some clients set initial rwnd to 5840 bytes (4 pkts) Trumps larger cwnd on servers. Patch just shipped this month in linux mainline Workaround: Use more client connections.
  • 15. Throttle #3: Intermediaries Problem: "Just a bug"... but... Intermediaries can (and do) tamper. window scale enables large receive windows. Workaround: Use more client connections. Client Side Server Side // Client wants window // Server recvs window // scaling 6. // scale 3. Someone // tampered with this. SYN -> w=5840, ws=6 SYN -> w=5840, ws=3 // Client receives server // Server sends its own // ws as sent. // ws of 6. SYNACK <- w=5840, ws=6 SYNACK <- w=5840, ws=6 // going to be slow....
  • 16. Throttle #4: Congestion Control Problem: Congestion detection decreases the send rate. But congestion signals can be erroneous. Applied to the connection, not the path: 1 connection: single packet loss cuts send rate by N (typically 0.5/0.7). 6 connections: single packet loss cuts send rate by 1/6*(1/N) == (~1/9th to 1/12th) Workaround: Use more client connections.
  • 17. Too Obsessed With 1 Connection? Could we use 2? 3? Sure, but it neutralizes many of our benefits. Disadvantages of multiple connections: Sharing state across connections is hard. Server farms would be required to do sticky load balancing Compression worsens (we use stateful compression) Prioritization becomes impossible Server push difficult But it shouldn't be this hard...
  • 18. How Much Does A Handshake Cost?
  • 19. What's Next? Before SPDY, we could blame the app layer (HTTP). With SPDY, we're on the verge of proving that the transport is the new bottleneck. TCP needs to address 2 performance obstacles: Data in initial handshake. Single connection taxes. TCP needs to address security Both Server Auth & Encryption (Sorry I didn't have time to discuss in this talk!) How can we iterate on the transport when it is buried in the kernel? Can we auto-update the network stack?