http/2 入門

33
HTTP/2

Upload: yahoo

Post on 15-Jan-2015

19.572 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

  • 1. HTTP/2

2. CMO 3. HTTP/2 HTTP/2 HTTP/2 4. HTTP/2 5. 2012/01: IETF HTTPbis WGHTTP 2012/06: HTTP/2 2012/11: SPDY 2013/01: 2013/08: 2014/05: ! 2014/07: (WG) () 6. SPDY Web Google ! GoogleChromeSPDY HTTP/2 SPDY ! TwitterFacebookFirefox Internet ExplorerSPDY 7. HTTP ? 8. () 9. This document addresses these issues by dening an optimized mapping of HTTP's semantics to an underlying connection. HTTP/2 Draft, Introduction 10. HTTP/2 HTTPHTTP 11. HTTP/2 12. ALPN https:// URLSSL ! HTTP Upgrade http:// URLHTTP/1.1 HTTP/2 HTTP/2 http:// https:// URL HTTP/2 13. Application Layer Protocol Negotiation (ALPN) SSL ClientHello ServerHello ALPN Extension HTTP/1 SPDY/3 h2 ALPN Extension Selected Protocol h2 14. HTTP Upgrade HTTP Upgrade GET /index.html HTTP/1.1 Host: www.yahoo.co.jp Connection: Upgrade, HTTP2-Settings Upgrade: h2c HTTP2-Settings: 4389978938ab379 HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: h2c ! 15. HTTP/1.x HTTP/2 DATA HEADERS HTTP PRIORITY RST_STREAM SETTINGS PUSH_PROMISE PING GOAWAY WINDOW_UPDATE CONTINUATION HEADERSPUSH_PROMISE ALTSVC BLOCKED 16. POST /upload HTTP/1.1 Host: www.yahoo.co.jp Content-Type: image/jpeg Content-Length: 123 ! {} HTTP/1.1 HTTP/2 HEADERS :method: POST :scheme: http :authority: www.yahoo.co.jp :path: /upload content-type: image/jpeg content-length: 123 DATA {} 17. HTTP/1.1 200 OK Content-Type: image/jpeg Content-Length: 123 ! {} HTTP/1.1 HTTP/2 HEADERS :status: 200 content-type: image/jpeg content-length: 123 DATA {} 18. 0 1 2 3! 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+! | R | Length (14) | Type (8) | Flags (8) |! +-+-+-----------+---------------+-------------------------------+! |R| Stream Identifier (31) |! +-+-------------------------------------------------------------+! | Frame Payload (0...) ...! +---------------------------------------------------------------+ 0 1 2 3! 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+! | Pad High? (8) | Pad Low? (8) |! +-+-------------+---------------+-------------------------------+! |E| Stream Dependency? (31) |! +-+-------------+-----------------------------------------------+! | Weight? (8) |! +---------------+-----------------------------------------------+! | Header Block Fragment (*) ...! +---------------------------------------------------------------+! | Padding (*) ...! +---------------------------------------------------------------+ HEADERS 19. HTTP/2 #1 #3 #5 20. HTTP/1.x HTTP/1.x () #1 #1 #2 #2 #1 #2 #3 #1 #2 #3 21. HTTP/2 #1 #2 #3 #1 #2 #3 22. HTTP 1.xUserAgentCookieHTTP ! SPDYHTTPgzip CRIME ! HTTP/2 HPACK 23. HPACK / Reference Set /ID ID Static Table HPACK 24. HPACK :method: GET :scheme: http :path: / :authority: www.yahoo.co.jp user-agent: chrome (1) 1 2 3 4: www.yahoo.co.jp user-agent: chrome Reference Set Static Table ID 1 :method GET 2 :scheme http 3 :path / 4 :authority 25. HPACK :method: GET :scheme: http :path: /css/yahoo.css :authority: www.yahoo.co.jp user-agent: chrome custom: yahoo (2) 3: /css/yahoo.css custom: yahoo Static Table ID 1 :method GET 2 :scheme http 3 :path / 4 :authority Reference Set :method: GET :scheme: http :path: / :authority: www.yahoo.co.jp user-agent: chrome 26. #2 #1 index.html index.html yahoo.css index.html logo.png index.html 27. VoxerSPDY A A B B 28. #2 #1 2 2 #2 (+) #1 29. HTTP/2 30. HTTP/2 HTTP/2 HTTP/2 nghttp2 C Draft 12 http2-katana C# Draft 09 node-http2 Node.js Draft 12 Netty Java Draft 12 Wireshark C Draft 12 Okhttp Java (Android) Draft 12 curl / libcurl C Draft 12 31. HPACKJava HTTP/2 Twitter C#Katana HTTP/2IEHTTP/2 Microsoft Firefox Mozilla 32. http://www.oreilly.co.jp/books/9784873116761/ 33. Enjoy HTTP/2 :)