46
SPDY SPDY

SPDY

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: SPDY

SPDYSPDY

Page 2: SPDY

Daniel Stenberg

Email: [email protected]: @bagderWeb: daniel.haxx.seBlog: daniel.haxx.se/blog

● Free Software● Network hacker● Embedded developer● Consultant

Page 3: SPDY

network and protocols● created curl● lead c­ares and libssh2● participate within IETF's HTTPbis, 

ftpext2, httpstate, hybi and more

Page 4: SPDY

Agenda● Why SPDY

● Goals

● Who makes SPDY

● Basic features

● Some Numbers

● Critiques

● Implementations

● Alternatives

● can TCP improve?

● SPDY for curl

● Future

Page 5: SPDY

Questions?● interrupt!● comment!● remark!

Page 6: SPDY

Why SPDY● Growing HTTP requests – 

uncompressed headers

● HTTP pipelining problems

● Desire for multiple simultaneous transfers

● TCP 3­way handshake

● TCP slow start

● Client­only initiated requests

● HTTP has Optional compression

● Mozilla bug 264354 open since Oct 2004

Page 7: SPDY

Goals● 50% reduction in page load time

● minimize deployment complexity – done over TCP

● avoid the need for any changes to content

● allow many concurrent HTTP requests over a single TCP session

● reduce bandwidth use

● make TLS the underlying transport protocol

Page 8: SPDY

Who makes SPDY● Created by Google in 2009● Pioneered in Chrome● Discussed in the open● Several independent 

implementations

Page 9: SPDY

Basic features● Multiplexed streams● Request prioritization● HTTP header compression● Server­initiated streams

Page 10: SPDY

Multiplexed streams

Single TCP

Page 11: SPDY

Multiple streams● Cheap to create new● Amount limit can be set by peer 

but it is unlimited by default● Per­stream flow­control (hello 

SCTP!)

Page 12: SPDY

Request prioritization● Each stream has a 0­7 priority● sender and recipient SHOULD use 

best­effort to process streams in prio order

Page 13: SPDY

HTTP header compression● zlib compression● pre­populated compression 

dictionary● request headers: ~88% reduction● response headers: ~85% 

reduction

Page 14: SPDY

Some Google numbers● 25 of the "top 100" websites● simulated home network connections● 1% packet loss● speedups over HTTP of 27% ­ 60% in page 

load time over plain TCP (without SSL)● and 39% ­ 55% over SSL

Page 15: SPDY

Critiques● SSL makes hard to debug and prevents 

use in some schools and companies

● header compression prevents single header extraction, makes adding headers expensive adds memory use per connection

● server push is potentially wasteful when contents already cached

Page 16: SPDY

Some implementations● Chrome● Firefox● Amazon Kindle Fire● more!

Page 17: SPDY

Alternative paths● Waka ­ 2002● HTTP­MPLEX ­ 2008● HTTP pipelining with several TCP 

connections● SCTP● SSH?● MPTCP

Page 18: SPDY

TCP initial congestion Window

● ICW is 4K today● ICW 10K: “average latency of HTTP responses 

improved by approximately 10%”● “compounding HTTP pipelining with increasing 

the ICW size can lead to reduction in page load times by up to 80%” ­ Yahoo!

Page 19: SPDY

TCP Fast Open● IETF I­D● transfer data in SYN and SYN­ACK● 1 RTT savings on 35% of HTTP requests 

(10­40% have 400+ms RTT)● Cookie to mitigate security 

vulnerabilities

Page 20: SPDY

SPDY for curl?● SPDY is here to speed up the web● curl's supposed to be speedy● SPDY fits the spirit of curl● multi interface, appear as 

separate  ­ use the same● libspdy

Page 21: SPDY

the Future● will SPDY replace HTTP?● will there be a HTTP 2.0? 

websockets etc pushes it further away

● will there be a TCP replacement?

Page 22: SPDY

Summary● SPDY speeds up the web● There's no viable alternatives● It will not replace HTTP within a 

foreseeable future

Page 24: SPDY

SPDYSPDY

Page 25: SPDY

Daniel Stenberg

Email: [email protected]: @bagderWeb: daniel.haxx.seBlog: daniel.haxx.se/blog

● Free Software● Network hacker● Embedded developer● Consultant

Page 26: SPDY

network and protocols● created curl● lead c­ares and libssh2● participate within IETF's HTTPbis, 

ftpext2, httpstate, hybi and more

Page 27: SPDY

Agenda● Why SPDY

● Goals

● Who makes SPDY

● Basic features

● Some Numbers

● Critiques

● Implementations

● Alternatives

● can TCP improve?

● SPDY for curl

● Future

Page 28: SPDY

Questions?● interrupt!● comment!● remark!

Page 29: SPDY

Why SPDY● Growing HTTP requests – 

uncompressed headers

● HTTP pipelining problems

● Desire for multiple simultaneous transfers

● TCP 3­way handshake

● TCP slow start

● Client­only initiated requests

● HTTP has Optional compression

● Mozilla bug 264354 open since Oct 2004

Page 30: SPDY

Goals● 50% reduction in page load time

● minimize deployment complexity – done over TCP

● avoid the need for any changes to content

● allow many concurrent HTTP requests over a single TCP session

● reduce bandwidth use

● make TLS the underlying transport protocol

Page 31: SPDY

Who makes SPDY● Created by Google in 2009● Pioneered in Chrome● Discussed in the open● Several independent 

implementations

Page 32: SPDY

Basic features● Multiplexed streams● Request prioritization● HTTP header compression● Server­initiated streams

Page 33: SPDY

Multiplexed streams

Single TCP

Page 34: SPDY

Multiple streams● Cheap to create new● Amount limit can be set by peer 

but it is unlimited by default● Per­stream flow­control (hello 

SCTP!)

Page 35: SPDY

Request prioritization● Each stream has a 0­7 priority● sender and recipient SHOULD use 

best­effort to process streams in prio order

Page 36: SPDY

HTTP header compression● zlib compression● pre­populated compression 

dictionary● request headers: ~88% reduction● response headers: ~85% 

reduction

Page 37: SPDY

Some Google numbers● 25 of the "top 100" websites● simulated home network connections● 1% packet loss● speedups over HTTP of 27% ­ 60% in page 

load time over plain TCP (without SSL)● and 39% ­ 55% over SSL

Page 38: SPDY

Critiques● SSL makes hard to debug and prevents 

use in some schools and companies

● header compression prevents single header extraction, makes adding headers expensive adds memory use per connection

● server push is potentially wasteful when contents already cached

Page 39: SPDY

Some implementations● Chrome● Firefox● Amazon Kindle Fire● more!

Page 40: SPDY

Alternative paths● Waka ­ 2002● HTTP­MPLEX ­ 2008● HTTP pipelining with several TCP 

connections● SCTP● SSH?● MPTCP

Page 41: SPDY

TCP initial congestion Window

● ICW is 4K today

● ICW 10K: “average latency of HTTP responses improved by approximately 10%”

● “compounding HTTP pipelining with increasing the ICW size can lead to reduction in page load times by up to 80%” ­ Yahoo!

Page 42: SPDY

TCP Fast Open● IETF I­D● transfer data in SYN and SYN­ACK● 1 RTT savings on 35% of HTTP requests 

(10­40% have 400+ms RTT)● Cookie to mitigate security 

vulnerabilities

Page 43: SPDY

SPDY for curl?● SPDY is here to speed up the web● curl's supposed to be speedy● SPDY fits the spirit of curl● multi interface, appear as 

separate  ­ use the same● libspdy

Page 44: SPDY

the Future● will SPDY replace HTTP?● will there be a HTTP 2.0? 

websockets etc pushes it further away

● will there be a TCP replacement?

Page 45: SPDY

Summary● SPDY speeds up the web● There's no viable alternatives● It will not replace HTTP within a 

foreseeable future

Page 46: SPDY

Stuff to read

http://www.blaze.io/mobile/http-pipelining-big-in-mobile/http://www.blaze.io/technical/http-pipelining-request-distribution-algorithms/http://www.mnot.net/blog/2011/08/05/pipeline_nowhttp://tools.ietf.org/html/draft-cheng-tcpm-fastopen-00http://code.google.com/speed/articles/tcp_initcwnd_paper.pdfhttp://conferences.sigcomm.org/imc/2011/docs/p569.pdfhttp://www.chromium.org/spdyhttp://www.libspdy.org/http://daniel.haxx.se/blog/2011/10/18/libspdy/