Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SPDY or maybe HTTP2.0

SPDY or maybe HTTP2.0

An introduction to the SPDY protocol

Andreas Bjärlestam

February 23, 2012

Transcript

85 slides
  1. SPDY  quick  overview   •  An  evolu?on  of  HTTP  

    •  Developed  by  Google  since  2009   •  Proprietary   •  But  open  
  2. Web  pages  February  2012   •  www.facebook.com  -­‐  ca  100

     hPp  requests   •  www.bostonglobe.com  -­‐  ca  100  hPp  requests   •  www.svtplay.se  -­‐  ca  90  hPp  requests   •  www.aSonbladet.se  -­‐  ca  350  hPp  requests   source:  hPp://hPparchive.org/    
  3. How  come  an  advanced  page  like   facebook.com  loads  in

     under  4   seconds  when  its  all  synchronous?  
  4. Hacky  op?miza?ons   CSS  sprites   base64  images  in  data-­‐urls

      CSS  concatena?on   JavaScript  concatena?on  
  5. HTTP/TCP   HTTP/TCP   HTTP/TCP   HTTP/TCP   HTTP/TCP  

    HTTP/TCP   6  x  HTTP  connec?ons  
  6. 2  connec?ons  per  host  recommended   by  HTTP  1.1  spec

      6  connec?ons  in  most  browsers    
  7. Domain  sharding   •  www.bostonglobe.com  -­‐  59  connec?ons   • 

    www.svtplay.se  -­‐  22  connec?ons   •  www.aSonbladet.se  -­‐  118  connec?ons   source:    hPp://www.webpagetest.org  
  8. On  my  macbook   Ping  20ms  ≈  30ms  to  set

     up  a   connec?on   On  my  mobile  (3G)   Ping  300ms  ≈  450ms  to  set  up  a   connec?on  
  9. It  turns  out  that  page  load  ?me  for  a  moderately

      complex  site  is  almost  no  faster  over  20mbits/ sec  than  over  2mbits/sec  
  10. HTTP  -­‐>  SPDY   GET   PUT   POST  

    …   HEADERS   Use  of  URIs   Use  of  TCP   GET   PUT   POST   …   HEADERS   Use  of  URIs   Use  of  TCP  
  11. HTTP  -­‐>  SPDY   TCP/IP   TLS/SSL   HTTP  

    TCP/IP   TLS/SSL   SPDY   HTTP  
  12. This  is  a  typical  HTTP  session   GET   GET

      GET   200  OK   200  OK   200  OK  
  13. Mul?plexing   GET  1   GET  2   GET  3

      200  OK  2   200  OK  3   200  OK  1  
  14. SPDY  could  make  your  life  easier   •  Less  important

     to  concatenate  JavaScripts   •  Less  important  to  concatenate  CSS  files   •  Less  need  for  CSS  sprites   •  No  need  for  domain  sharding  
  15. Implementa?ons   •  mod_spdy   •  Nginx  –  in  roadmap

      •  node_spdy  –  with  special  openssl  build  etc   •  express_spdy  –    with  node  0.7  etc   •  nePy   •  more…  
  16. Browsers   •  Chrome  (since  version  6)   •  Firefox

     11  (turned  off  by  default)   •  (Amazon  silk)  
  17. Google   •  Support  SPDY  on  most  of  their  services

      •  90%  of  their  SSL  traffic  is  over  SPDY  
  18. Amazon  silk   Silk   Browser   SPDY   Gateway

      The   Internet   SPDY   HTTP  
  19. The  spec   •  DraS  spec,  version  3   • 

    Plan  is  to  submit  it  to  IETF  as  input  to  HTTP2.0   •  IETF  HTTPbis  WG  chair  recently  proposed  to   start  work  on  HTTP2.0  
  20. Cri?cism   •  Going  over  SSL  means  no  proxies  

    •  More  difficult  to  debug  since  it  is  binary  and   compressed  
  21. HTTP  Pipelining   •  Not  as  effec?ve  as  mul?plexing  

    •  Hard  to  implement  in  browser   •  Opera  is  the  only  desktop  browser  that  has  a   full  implementa?on  enabled  by  default   •  Android,  IOS5  and  Opera  mobile  browsers  do   some  amount  of  pipelining   •  Not  used  by  most  proxies  
  22. Pipelining   GET  1   GET  2   GET  3

      200  OK  1   200  OK  2   200  OK  3   GET  1   GET  2   GET  3   200  OK  2   200  OK  3   200  OK  1   Mul?plexing   GET   GET   GET   200  OK   200  OK   200  OK   Synchronous  
  23. Roundup   •  ~  50%  Faster  page  loads  than  HTTP

      •  Backwards  compa?ble  with  HTTP   •  BePer  u?liza?on  of  TCP   •  Secured  by  default   •  Binary  +  compressed   •  Will  likely  be  the  base  for  HTTP2.0  
  24. APribu?ons   •  hPp://en.wikipedia.org/wiki/ File:US_Robo?cs_56K_Modem_Front.JPG   •  hPps://www.iis.se/docs/SOI2011.pdf   • 

    hPp://www.flickr.com/photos/howi/6366423373/   •  hPp://www.flickr.com/photos/wwarby/5110037138/   •  hPp://www.flickr.com/photos/alicetragedy/ 4977295298/   •  hPp://www.flickr.com/photos/koltregaskes/ 624914973/in/photostream/  

More Decks by Andreas Bjärlestam

Other Decks in Technology