$30 off During Our Annual Pro Sale. View Details »

SPDY

 SPDY

SPDY - a new open networking protocol

Avatar for HakumaNatata

HakumaNatata

April 22, 2013
Tweet

More Decks by HakumaNatata

Other Decks in Technology

Transcript

  1. HTTP  &  TCP •  Hypertext  Transfer  Protocol  (HTTP)   – h;p://en.wikipedia.org/wiki/

    Hypertext_Transfer_Protocol   •  Transmission  Control  Protocol  (TCP)   – h;p://en.wikipedia.org/wiki/ Transmission_Control_Protocol 3  
  2. HTTP  有什麼問題? •  One  request,  one  connecLon   •  Exclusively

     client-­‐iniLated  requests   •  Uncompressed  request  and  response  headers   •  Redundant  headers   •  OpLonal  data  compression 4  
  3. MulLple  TCP  connecLons  (cont.) 8   Request  HTML Request  JS

    Request  CSS Request  CSS Request  image Request  image Request  image Request  image Request  image Request  image Request  image Request  image Request  image
  4. MulLple  TCP  connecLons  (cont.) 11   Request  HTML Request  JS

    Request  CSS Request  CSS Request  image Request  image Request  image Request  image Request  image Request  image Request  image Request  image Request  image
  5. 研究指出 •  Amazon  的網頁載入時間每多一秒,該公司 的年度營收就減少 16  億美元   •  Google

     的搜尋時間每多 0.4  秒,每天的搜尋 次數就會減少 8  百萬。   15  
  6. SPDY  是什麼? •  Open  networking  protocol •  Developed  primarily  at

     Google •  For  transporLng  web  content   •  Improve  latency  at  the  transport  layer   17  
  7. Goal  of  SPDY •  減少 50% 網頁載入時間   •  降低佈署複雜度

      •  避免網頁做任何修改   •  減少 HTTP  同時使用的頻寬   18  
  8. 特點 •  SSL   •  可透過單一 TCP  session  同時傳送多個 HTTP

      request   •  壓縮 (header  &  data)   •  Server  push   19  
  9. Control  frame •  Control  bit  :  Control  frame(1)  or  data

     frame(0)   •  Version:  SPDY  的版本   •  Type:  control  frame  的種類   •  Flags   •  Length   •  Data 23  
  10. Data  frame •  Control  bit   •  Stream-­‐ID:  31-­‐bit.  偶數:

     server,  奇數:  client   •  Flags  :  0x01  =  FLAG_FIN     •  Length   •  Data   24  
  11. SPDY 優點 •  Frame  可以混雜   •  一個 TCP  connecLon

      •  Slow  start  一次   •  記住上次的 CWND   28  
  12. 誰在用 SPDY? •  Google     •  Twi;er   • 

    Wordpress.com   •  LINE   •  Facebook   •  …etc   29  
  13. Server   •  Apache  mod_spdy   – h;ps://code.google.com/p/mod-­‐spdy/   •  Nginx

      – h;p://nginx.org/patches/spdy/README.txt   •  Node-­‐spdy   – h;ps://github.com/indutny/node-­‐spdy   30