Andreas Bjärlestam   2012-02-23
SPDY quick overview• An evolution of HTTP• Developed by Google since 2009• Openly available spec
Why the hell would you want to        replace HTTP?
HTTP is fantasticit has totally changed the world
but…
HTTP is over 20 years oldHTTP 1.1 is 12 years old
Webpages in 1999
Webpages in 2012
Mobile internet usagesource: svenskarnaoch internet 2011 https://www.iis.se/docs/SOI2011.pdf
This is how more and more of us        consume the web…
Often it feels a lot like…
People no longer have patience to       wait for slow pages
Web pages February 2012•   www.facebook.com - ca 100 http requests•   www.bostonglobe.com - ca 100 http requests•   www.sv...
What does it look like over thenetwork fetching 100 resources?
Can you spot the problem?
Its all synchronous
How come an advanced page like  facebook.com loads in under 4seconds when its all synchronous?
Hacky optimizations        CSS spritesbase64 images in data-urls    CSS concatenation JavaScript concatenation
6 x HTTP connections       HTTP/TCP       HTTP/TCP       HTTP/TCP       HTTP/TCP       HTTP/TCP       HTTP/TCP
What is the problem with this? Why          not even more?
Wasted resources
TCP Congestion control
2 connections per host recommended          by HTTP 1.1 spec  6 connections in most browsers
Domain sharding• www.bostonglobe.com - 59 connections• www.svtplay.se - 22 connections• www.aftonbladet.se - 118 connectio...
We kind of abuse TCPwhen we open more    connections
and…
New TCP connections are slow
3 way handshake
On my macbook Ping 20ms ≈ 30ms to set up a         connection      On my mobile (3G)Ping 300ms ≈ 450ms to set up a        ...
TCP Slow start    HTTP/TCP    HTTP/TCP    HTTP/TCP    HTTP/TCP    HTTP/TCP    HTTP/TCP
It turns out that page load time for a moderately   complex site is almost no faster over   20mbits/sec than over 2mbits/sec
So… we need to utilize our TCP     connections better
Enter
Don’t we break the web if we replace              HTTP?
Nope
The semantics of HTTP is kept
or in simpler words…SPDY implements the HTTP API
HTTP -> SPDY   GET                        GET   PUT                        PUT              HEADERS                    HEA...
You can switch to SPDY with nochanges to your web application
SPDY runs over TCP and will not  require upgraded network          equipment
HTTP -> SPDY                    HTTP HTTP               SPDYTLS/SSL            TLS/SSLTCP/IP             TCP/IP
Designed with   speed as primary goal
1 TCP connection     HTTP/TCP
But it will be on fire!        HTTP/TCP
SPDY is multiplexed
This is a typical HTTP session             GET            200 OK             GET            200 OK             GET        ...
Multiplexing    GET 1    GET 2    GET 3   200 OK 2   200 OK 3   200 OK 1
Stream priorities
SPDY is binary
Will be difficult to just fire up telnet           and hack away
Every decent site will be encrypted      and gzipped anyways
TLS/SSL is mandatory
Communication should be        secure by defaultUsers should not  have to care
Using SSL ensures thatcommunication over existing   proxies is not broken
..but you will not be able to use proxies for caching etc
Headers are compressed
How will the client know that it can   use SPDY towards a server?
NPNTLS Next Protocol Negotiation
Server Push
Server Push
So is it worth it?
Google tested 25 of the   “top 100” sites
Average speedup  39% - 55%
SPDY could make your life easierLess need for hacky optimizations       like CSS sprites, fileconcatenations, domain shard...
Should I add SPDY support to my     servers on Monday?
Probably not…
Implementations•   Apache mod_spdy•   Nginx – in roadmap•   node_spdy – requires node.js 0.7•   netty•   more…
Example…
Browsers• Chrome (since version 6)• Firefox 11 (turned off by default)• (Amazon silk)
CDNs• Strangeloop• Contendo
CDNs             SPDY     Your webBrowser            Gateway    server
Google• Support SPDY on most of their services• 90% of their SSL traffic is over SPDY
Amazon silk  Silk    SPDY      SPDY     HTTP     TheBrowser            Gateway          Internet
The spec• Draft spec, version 3• Plan is to submit it to IETF as input to HTTP2.0• IETF HTTPbis WG chair recently proposed...
Alternatives
HTTP Pipelining• Not as effective as multiplexing• Hard to implement in browser• Opera is the only desktop browser that ha...
Synchronous   Pipelining     Multiplexing    GET            GET 1          GET 1                   GET 2          GET 2   ...
Alternative transport protocols• SCTP• BEEP
Roundup•   ~ 50% Faster page loads than HTTP•   Backwards compatible with HTTP•   Better utilization of TCP•   Secured by ...
Attributions• http://en.wikipedia.org/wiki/File:US_Robotics_56K_M  odem_Front.JPG• https://www.iis.se/docs/SOI2011.pdf• ht...
SPDY - or maybe HTTP2.0
SPDY - or maybe HTTP2.0
SPDY - or maybe HTTP2.0
Upcoming SlideShare
Loading in …5
×

SPDY - or maybe HTTP2.0

9,974 views

Published on

The SPDY protocol has been developed by Google since 2009. It is intended as an evolution of HTTP with better performance and network utilization.

Published in: Technology
0 Comments
13 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
9,974
On SlideShare
0
From Embeds
0
Number of Embeds
39
Actions
Shares
0
Downloads
173
Comments
0
Likes
13
Embeds 0
No embeds

No notes for slide

SPDY - or maybe HTTP2.0

  1. 1. Andreas Bjärlestam 2012-02-23
  2. 2. SPDY quick overview• An evolution of HTTP• Developed by Google since 2009• Openly available spec
  3. 3. Why the hell would you want to replace HTTP?
  4. 4. HTTP is fantasticit has totally changed the world
  5. 5. but…
  6. 6. HTTP is over 20 years oldHTTP 1.1 is 12 years old
  7. 7. Webpages in 1999
  8. 8. Webpages in 2012
  9. 9. Mobile internet usagesource: svenskarnaoch internet 2011 https://www.iis.se/docs/SOI2011.pdf
  10. 10. This is how more and more of us consume the web…
  11. 11. Often it feels a lot like…
  12. 12. People no longer have patience to wait for slow pages
  13. 13. Web pages February 2012• www.facebook.com - ca 100 http requests• www.bostonglobe.com - ca 100 http requests• www.svtplay.se - ca 90 http requests• www.aftonbladet.se - ca 350 http requests source: http://httparchive.org/
  14. 14. What does it look like over thenetwork fetching 100 resources?
  15. 15. Can you spot the problem?
  16. 16. Its all synchronous
  17. 17. How come an advanced page like facebook.com loads in under 4seconds when its all synchronous?
  18. 18. Hacky optimizations CSS spritesbase64 images in data-urls CSS concatenation JavaScript concatenation
  19. 19. 6 x HTTP connections HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
  20. 20. What is the problem with this? Why not even more?
  21. 21. Wasted resources
  22. 22. TCP Congestion control
  23. 23. 2 connections per host recommended by HTTP 1.1 spec 6 connections in most browsers
  24. 24. Domain sharding• www.bostonglobe.com - 59 connections• www.svtplay.se - 22 connections• www.aftonbladet.se - 118 connections source: http://www.webpagetest.org
  25. 25. We kind of abuse TCPwhen we open more connections
  26. 26. and…
  27. 27. New TCP connections are slow
  28. 28. 3 way handshake
  29. 29. On my macbook Ping 20ms ≈ 30ms to set up a connection On my mobile (3G)Ping 300ms ≈ 450ms to set up a connection
  30. 30. TCP Slow start HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
  31. 31. It turns out that page load time for a moderately complex site is almost no faster over 20mbits/sec than over 2mbits/sec
  32. 32. So… we need to utilize our TCP connections better
  33. 33. Enter
  34. 34. Don’t we break the web if we replace HTTP?
  35. 35. Nope
  36. 36. The semantics of HTTP is kept
  37. 37. or in simpler words…SPDY implements the HTTP API
  38. 38. HTTP -> SPDY GET GET PUT PUT HEADERS HEADERS POST POST … …Use of URLs Use of TCP Use of URLs Use of TCP
  39. 39. You can switch to SPDY with nochanges to your web application
  40. 40. SPDY runs over TCP and will not require upgraded network equipment
  41. 41. HTTP -> SPDY HTTP HTTP SPDYTLS/SSL TLS/SSLTCP/IP TCP/IP
  42. 42. Designed with speed as primary goal
  43. 43. 1 TCP connection HTTP/TCP
  44. 44. But it will be on fire! HTTP/TCP
  45. 45. SPDY is multiplexed
  46. 46. This is a typical HTTP session GET 200 OK GET 200 OK GET 200 OK
  47. 47. Multiplexing GET 1 GET 2 GET 3 200 OK 2 200 OK 3 200 OK 1
  48. 48. Stream priorities
  49. 49. SPDY is binary
  50. 50. Will be difficult to just fire up telnet and hack away
  51. 51. Every decent site will be encrypted and gzipped anyways
  52. 52. TLS/SSL is mandatory
  53. 53. Communication should be secure by defaultUsers should not have to care
  54. 54. Using SSL ensures thatcommunication over existing proxies is not broken
  55. 55. ..but you will not be able to use proxies for caching etc
  56. 56. Headers are compressed
  57. 57. How will the client know that it can use SPDY towards a server?
  58. 58. NPNTLS Next Protocol Negotiation
  59. 59. Server Push
  60. 60. Server Push
  61. 61. So is it worth it?
  62. 62. Google tested 25 of the “top 100” sites
  63. 63. Average speedup 39% - 55%
  64. 64. SPDY could make your life easierLess need for hacky optimizations like CSS sprites, fileconcatenations, domain sharding etc
  65. 65. Should I add SPDY support to my servers on Monday?
  66. 66. Probably not…
  67. 67. Implementations• Apache mod_spdy• Nginx – in roadmap• node_spdy – requires node.js 0.7• netty• more…
  68. 68. Example…
  69. 69. Browsers• Chrome (since version 6)• Firefox 11 (turned off by default)• (Amazon silk)
  70. 70. CDNs• Strangeloop• Contendo
  71. 71. CDNs SPDY Your webBrowser Gateway server
  72. 72. Google• Support SPDY on most of their services• 90% of their SSL traffic is over SPDY
  73. 73. Amazon silk Silk SPDY SPDY HTTP TheBrowser Gateway Internet
  74. 74. The spec• Draft 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
  75. 75. Alternatives
  76. 76. HTTP Pipelining• Not as effective as multiplexing• Hard to implement in browser• Opera is the only desktop browser that has a full implementation enabled by default• Android, IOS5 and Opera mobile browsers do some amount of pipelining• Not used by most proxies
  77. 77. Synchronous Pipelining Multiplexing GET GET 1 GET 1 GET 2 GET 2 200 OK GET 3 GET 3 GET 200 OK 200 OK 1 200 OK 2 GET 200 OK 2 200 OK 3 200 OK 3 200 OK 1 200 OK
  78. 78. Alternative transport protocols• SCTP• BEEP
  79. 79. Roundup• ~ 50% Faster page loads than HTTP• Backwards compatible with HTTP• Better utilization of TCP• Secured by default• Binary + compressed• Will likely be the base for HTTP2.0
  80. 80. Attributions• http://en.wikipedia.org/wiki/File:US_Robotics_56K_M odem_Front.JPG• https://www.iis.se/docs/SOI2011.pdf• http://www.flickr.com/photos/howi/6366423373/• http://www.flickr.com/photos/wwarby/5110037138/• http://www.flickr.com/photos/alicetragedy/497729529 8/• http://www.flickr.com/photos/koltregaskes/624914973 /in/photostream/

×