Slide 1

Slide 1 text

)551ΛಡΈղٕ͘ज़

Slide 2

Slide 2 text

Moto Ishizawa (@summerwind) 1/27

Slide 3

Slide 3 text

http://summerwind.jp/docs/draft-ietf-httpbis-http2-09/ 2/27

Slide 4

Slide 4 text

)551ͷ࢓༷ॻΛಡΈղͨ͘Ίʹඞ ཁͳ஌ࣝ΍ٕज़Λ঺հ͠·͢ɻ 3/27

Slide 5

Slide 5 text

ωοτϫʔΫؔ࿈

Slide 6

Slide 6 text

HTTP/1.1 pipelining only partially addressed request concurrency and suffers from head-of-line blocking. “ ” ― 1. Introduction 5/27

Slide 7

Slide 7 text

Head-of-line Blocking (HoL Blocking) σʔλΛૹ৴͢ΔΩϡʔ Data #1 Data #2 Data #3 Data #4 Data #5 ૹ৴ʹࣦഊ͠ ࠶ૹ͕ඞཁͳσʔλ ૹ৴଴ͪͷσʔλͨͪ )P-#MPDLJOH 6/27

Slide 8

Slide 8 text

Head-of-line Blocking (HoL Blocking) Client Server HTTP/1.1 pipelining ΋͠࠷ॳͷϨεϙϯεͷॲཧʹ ͕͔͔࣌ؒͬͨ৔߹ɺ2ͭ໨Ҏ߱ͷ Ϩεϙϯε΋ͦΕʹҾ͖ͣΒΕΔ (HoL Blocking) ϦΫΤετͷૹ৴ Ϩεϙϯεͷૹ৴ 7/27

Slide 9

Slide 9 text

Flow control is used for both individual streams and for the connection as a whole. “ ” ― 5.2. Flow Control 8/27

Slide 10

Slide 10 text

Flow control 9/27 σʔλͷ௨৴࣌ʹɺड৴ଆͷॲཧ͕௥͍͔ͭͣʹσʔλͷ औΓ͜΅͕͠ൃੜ͢ΔͷΛ๷͙ͨΊɺঢ়گʹԠͯ͡ૹ৴ଆ ͕σʔλͷૹ৴Λఀࢭͨ͠Γɺૹ৴ྔΛௐ੔ͨ͠Γ͢Δͨ Ίͷ࢓૊Έɻ ! ௨৴ͷ։࢝࣌ʹड৴ଆ͕΢Πϯυ΢αΠζͱݺ͹ΕΔҰ౓ ʹड৴Մೳͳ༰ྔΛૹ৴ଆʹ௨஌͠ɺૹ৴ଆ͸ͦͷαΠζ ʹैͬͯૹ৴ྔΛ੍ޚ (΢Πϯυ΢੍ޚ) ͢Δɻ

Slide 11

Slide 11 text

Flow control Client 53όΠτड৴ͨ͠ͷͰ ࢒Γ͸47όΠτ 53όΠτૹ৴ 47όΠτૹ৴ 47όΠτड৴ͨ͠ͷͰ ࢒Γ͸0όΠτ ΢Πϯυ΢͕100όΠτ Ͱ͋Δ͜ͱΛ௨஌ Server ߹ܭͰ100όΠτૹ৴ ͨ͠ͷͰҰ࣌ૹ৴ఀࢭ 89όΠτॲཧͨ͠ͷͰ 89όΠτ·Ͱ͸ૹ৴ Մೳͳ͜ͱΛ఻͑Δ ૹ৴Λ࠶։ 89όΠτૹ৴ 10/27

Slide 12

Slide 12 text

Flow control (HTTP/2) Client ίωΫγϣϯͷ΢Πϯυ΢͸࢒Γ65,482όΠτ ετϦʔϜID: 1ͷ΢Πϯυ΢͸࢒Γ47όΠτ ετϦʔϜID: 1ʹ53όΠτૹ৴ ετϦʔϜID: 1ʹ47όΠτૹ৴ ίωΫγϣϯͷ΢Πϯυ΢͸࢒Γ65,435όΠτ ετϦʔϜID: 1ͷ΢Πϯυ΢͸࢒Γ0όΠτ SETTINGSϑϨʔϜͷ SETTINGS_INITIAL_WINDOW_SIZEͰετϦʔϜ ͷ΢Πϯυ΢͕100όΠτͰ͋Δ͜ͱΛ௨஌ (ίωΫγϣϯͷ΢Πϯυ΢͸65,535όΠτݻఆ) Server 89όΠτΛॲཧͨ͠ͷͰɺετϦʔϜID: 1ʹ WINDOW_UPDATEϑϨʔϜΛૹ৴ͯ͠ɺ ετϦʔϜID: 1ͷ΢Πϯυ΢Λ89όΠτʹ͢Δ ετϦʔϜID: 1ʹ89όΠτૹ৴ 11/27

Slide 13

Slide 13 text

Note, however, that this can lead to suboptimal use of available network resources if flow control is enabled without knowledge of the bandwidth-delay product. “ ” ― 5.2.2. Appropriate Use of Flow Control 12/27

Slide 14

Slide 14 text

Bandwidth-delay product (BDP) ωοτϫʔΫଳҬ෯ × σʔλͷԟ෮஗Ԇ࣌ؒ ωοτϫʔΫ্ʹྲྀ͢͜ͱ͕Ͱ͖Δ࠷దͳσʔλͷྔΛࣔ͢ɻ ΢Πϯυ΢αΠζͷ࠷ద஋ΛٻΊΔͨΊʹ࢖༻͢Δ஋ɻ 13/27

Slide 15

Slide 15 text

Bandwidth-delay product (BDP) ྫ: RTT͕100ms͔͔Δ10MbpsͷճઢͷBDPΛܭࢉ͢Δɻ 10Mbps = 10,000,000bit/s = 1,221KB/s 100ms = 0.1s 1,221KB/s × 0.1s = 122.1KB ͜ͷ஋͔Βɺ΢Πϯυ΢αΠζ͸࠷௿Ͱ΋122.1KB͕ඞཁɻ BDPͷ஋Λ΋ͱʹ΢Πϯυ΢αΠζͷνϡʔχϯάΛ͓͜ͳ͏ɻ 14/27

Slide 16

Slide 16 text

5-4ؔ࿈

Slide 17

Slide 17 text

A client that makes a request to an "https" URI without prior knowledge about support for HTTP/2.0 uses TLS with the application layer protocol negotiation extension. “ ” ― 3.3. Starting HTTP/2.0 for "https" URIs 16/27

Slide 18

Slide 18 text

Application Layer Protocol Negotiation (ALPN) Client Server TLS Handshake ClientHello ServerHello ALPN Extension HTTP/1 HTTP/2 SPDY/3 ALPN Extension Selected protocol HTTP/2 17/27

Slide 19

Slide 19 text

Application Layer Protocol Negotiation (ALPN) https://github.com/http2/http2-spec/wiki/ALPN-Status 18/27

Slide 20

Slide 20 text

)551Yؔ࿈

Slide 21

Slide 21 text

The 1xx series of HTTP response status codes are not supported in HTTP/2.0. “ ” ― 8.1.1. Informational Responses 20/27

Slide 22

Slide 22 text

The 1xx Series of HTTP response status codes 100 Continue ϦΫΤετϔομΛड৴ͨ͠αʔόʔ͕ɺϦΫΤετϘςΟͷ ड৴͕Մೳͳ͜ͱΛ஌ΒͤΔͨΊͷεςʔλείʔυɻ ! 101 Switching Protocols ௨৴ʹ࢖༻͢ΔϓϩτίϧΛ HTTP ͔Βଞͷϓϩτίϧʹ ੾Γସ͑ΔͨΊʹ࢖༻͢Δεςʔλείʔυɻ 21/27

Slide 23

Slide 23 text

Client Server 100 Continue ϦΫΤετ 100 Continue POST /search HTTP/1.1 Expect: 100-continue ৘ใఏڙϨεϙϯε ϦΫΤετϘσΟ Ϩεϙϯε The 1xx Series of HTTP response status codes 22/27

Slide 24

Slide 24 text

In HTTP/2.0, the CONNECT method is used to establish a tunnel over a single HTTP/2.0 stream to a remote host. “ ” ― 8.3. The CONNECT Method 23/27

Slide 25

Slide 25 text

CONNECT (HTTP/1.1) Client Proxy Server ϦΫΤετ CONNECT example.com:80 HTTP/1.1 Host: example.com:80 Ϩεϙϯε 200 Connection Established αʔόʔʹର͢ΔϦΫΤετ GET /index.html HTTP/1.1 தܧ͞ΕͨϦΫΤετ GET /index.html HTTP/1.1 ઀ଓ 24/27

Slide 26

Slide 26 text

CONNECT (HTTP/2) Client Proxy Server HEADERS ϑϨʔϜ :method : CONNECT :authority : example.com:80 HEADERS ϑϨʔϜ :status : 200 DATA ϑϨʔϜ GET /index.html HTTP/1.1 ϦΫΤετ GET /index.html HTTP/1.1 ઀ଓ 25/27

Slide 27

Slide 27 text

http://bit.ly/browser-networking 26/27

Slide 28

Slide 28 text

Enjoy HTTP/2 ;-)