SlideShare a Scribd company logo
1 of 56
Download to read offline
SPDY HTTP2 QUIC
2013/08/28
#bpstudy72
Jack
● id: Jxck
● github: Jxck
● twitter: jxck_
● about: http://jxck.io
● blog: http://d.hatena.ne.jp/jxck
● Love: music
http2cat
supports todays talk
http://jxck.io/labs/http2cat
spec and status
HTTP ?
History of HTTP
... HTTP/0.9
1996/ 5 HTTP/1.0 (RFC 1945)
1997/ 1 HTTP/1.1 (RFC 2068)
2009/11 SPDY/1
...
2011/ 9 WebSocket(RFC 6455)
2012/ 8 HTTP/2.0 start
2012/11 HTTP/2.0 (draft-00)
2013/ 7 HTTP/2.0 (draft-04)
2013/ 8 interop testing
2013/ 8 HTTP/2.0 (draft-06)
motivation
● Sharing Documents
● Over TCP
● Text Base Protocol
● Stateless
version
● HTTP/0.9
● HTTP/1.0
● HTTP/1.1
○ Keep-Alive
○ Pipelining
HTTP / 1.1
CLIENT SERVER
Req / Res on HTTP/1.1
Text Base Protocol
GET /index.html HTTP/1.1
Host: example.org
Accept: text/html
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 35
<!DOCTYPE html>
<title>hello</title>
over TCP (3-way-handshake)
3-way-handshake: Cost for Reliable
over TCP (Slow Start)
Increase Segment Size
for Congection Control
Keep-Alive & Pipelining
● Keep-Alive
○ Re-Use TCP Connection
● Pipelining
○ Send all Req before Res
HTTP ?
● Simple
○ text base, easy scaling etc
○ good for document sharing
○ but Good for Now ?
● now “Web” is
○ Plat Form (not only document sharing)
○ Ajax, WebSocket…
○ tons of JS, CSS, Images...
○ PC, Mobile, Tablet, TV, Game …
● needs
○ more speed
○ more efficiency
○ more secure
spec and status
SPDY ?
motivation
● multiplexing
● header compression
● reduce RTT
● etc
version
● spdy/1
● spdy/2 (nginx)
● spdy/3 (mod_spdy, jetty)
● spdy/3.1 (twitter)
● spdy/4a3 (google)
● spdy/4 (discussing)
about SPDY
SPDY / 3 core feature
● npn (tls extension)
○ only https
● 1 connection
○ controlable keep alive
● multiplexing
○ better pipelining
● compressed binary frame
○ smaller than text protocol
● server push
○ new idea
TLS-NPN (next protocol negotiation)
Compressed Binary Frame
SYN_STREAM
SYN_REPLY
RST_STREAM
SETTINGS
PING
GOAWAY
HEADERS
WINDOW_UPDATE
CREDENTIAL
SYN_STREAM frame
<version=3, flags=1, length=217>
(stream_id=1, assoc_stream_id=0, pri=3)
:host: localhost:3000
:method: GET
:path: /
:scheme: https
:version: HTTP/1.1
accept: */*
accept-encoding: gzip
SYN_REPLY frame
<version=3, flags=0, length=102>
(stream_id=1)
:status: 200 OK
:version: HTTP/1.1
content-length: 37
Stream(spdy/3)
CLIENT SERVER
Request Header
Response Header
Stream Start
Stream(spdy/3)
CLIENT
Stream End
SERVER
DATA frame
(stream_id=1, flags=0, length=37)
<!DOCTYPE html>
<title>hello</title> Response Body
DATA frame
(stream_id=1, flags=1, length=0)
GOAWAY frame
<version=3, flags=0, length=8>
(last_good_stream_id=0)
SYN_STREAM FRAME
Multiplexing
Server Push
// index.html
<html>
<script src=”a.js”
/>
<link rel=”b.css” />
<img src=”c.png” />
</html>
server pushes
a.js, b.css, c.png
while processing
index.html
pushed resources are
cached in browser
and cache hit when
browser need it.
Server Push
SPDY
● Google’s Original Protocol
○ Google has both server & client
● Widely Deployed
○ twitter
○ facebook
○ LINE
● SPDY/4 discussing
○ websocket over spdy etc
● CRIME attack
○ disable header compression
○ need another compression
history and status
HTTP/2.0?
about HTTP2
● httpbis wg at IETF from 2012
● motivation
○ update HTTP/1.1
● version
○ draft-00 (copy of spdy/3)
○ ...
○ draft-03
○ draft-04 (interop test)
○ draft-05
○ draft-06 (2013/8/28 current)
○ ...
○ RFC XXXX (2014 spring? bit.ly/130oZrZ)
SPDY or HTTP2.0 ?
SPDY/3
SPDY/4
http2.0-00
http2.0-01
http2.0-06
http2.0
SPDY/n ??
specs
● working on github !
○ https://github.com/http2/http2-spec
● draft
○ http://tools.ietf.org/wg/httpbis/draft-ietf-httpbis-http2/
● current (2013/8/28)
○ http://tools.ietf.org/html/draft-ietf-httpbis-http2-06
● ML
○ http://lists.w3.org/Archives/Public/ietf-http-wg/
○ https://www.ietf.org/mailman/listinfo/http-devops (new)
HTTP/2.0 draft-06
● Multiplexing (same as spdy)
● Server Push (same idea as spdy)
● ALPN / Upgrade
● Binary Frames
● Header Compression
Starting HTTP2.0 (1/2 step)
● “http://”
○ Upgrade Header like websocket
● “https://”
○ ALPN (application layer protocol
negotiation)
○ not NPN like spdy
● Known Supported
○ prior knowledge from DNS or so
○ may immediately send http2.0 frame
TLS-ALPN(Application Layer protocol negotiation)
Starting HTTP2.0 (2/2 step)
● sending connection header
○ make sure peer supports http2.0
● with Magic Octets
505249202a20485454502f322e300d0a0d0a534d0d0a0d0a
PRI * HTTP/2.0
rnrn
SM
rnrn
invalid
Method PRI
2 new line
for parser
Frame Type
● DATA
● HEADERS
● PRIORITY
● RST_STREAM
● SETTINGS
● PUSH_PROMISE
● PING
● GOAWAY
● WINDOW_UPDATE
● CONTINUATION
Changed from
SPDY/3
HEADERS & DATA frame
CLIENT SERVER
HEADERS(stream_id=1)
+ END_STREAM
+ END_HEADERS
:method = GET
:scheme = https
:host = example.org
:path = /index.html
accept = text/html
HEADERS(stream_id=1)
- END_STREAM
+ END_HEADERS
:status = 200
content-type = text/html
content-length = 35
DATA(stream_id=1)
+ END_STREAM
<!DOCTYPE html>
<title>hello</title>
Server Push(1)
CLIENT SERVER
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 123
{binary data}
PUSH_PROMISE (stream_id=1)
+ END_PUSH_PROMISE
Promised-Stream-ID=2
:method = GET
:scheme = https
:host = example.org
:path = /index.html
accept = text/html
HEADERS (stream_id=1)
+ END_STREAM
+ END_HEADERS
:method = GET
:scheme = https
:host = example.org
:path = /index.html
accept = text/html
PUSH
Request
Server Push(2)
CLIENT SERVER
Browser
Cache
DATA (stream_id=2)
+ END_STREAM
{binary data}
HEADERS (stream_id=2)
- END_STREAM
+ END_HEADERS
:status = 200
:path = /a.png
content-type = image/png
content-length = 123
PUSH
Respons
Server Push(2)
CLIENT SERVER
HEADERS (stream_id=1)
- END_STREAM
+ END_HEADERS
:status = 200
content-type = text/html
content-length = 33
DATA (stream_id=1)
+ END_STREAM
<html>
<img src=”a.png”>
</html>
cache hit !!
Response
HPAC (header compression)
● HTTP Header
○ Text Base
○ Long Name
○ Send multiple time
● SPDY compression
○ CRIME
● HPAC
○ send diff
○ using binary
● HPAC component
○ Header Table
○ Reference Set
Header Table
Index Header Name Header Value
0 :scheme http
1 :scheme https
2 :host
3 :path /
4 :method GET
5 accept
6 accept-charset
7 accept-encoding
... ...
29 via
Index Header Name Header Value
0 :status 200
1 age
2 cache-control
3 content-length
4 content-type
5 date
6 etag
7 expires
... ...
29 www-authenticate
Request Header Table Response Header Table
Header Representation
● Indexed Header Representation
● Literal Header Representation
○ Literal Header without Indexing
○ Literal Header with Incremental Indexing
○ Literal Header with Substitution Indexing
HPAC example (1/3)
CLIENT SERVER
Use index 0
0x80 (indexed header, index = 0)
Use index 4
0x84 (indexed header, index = 4)
Use index 2
with replace "example.org"
0x03 (literal header, substitution indexing,
name index = 2)
0x02 (replaced entry index = 2)
0x0B (header value string length = 11)
“example.org”
Use index 3
with replace "/index.html"
0x04 (literal header, substitution indexing,
name index = 3)
0x03 (replaced entry index = 3)
0x0B (header value string length = 11)
“/index.html”
0 :scheme http
1 :scheme https
2 :host exampl
e.com
3 :path /index.
html
4 :method GET
0 :scheme http
1 :scheme https
2 :host
3 :path /
4 :method GET
reference set
:scheme https
:host example.org
:path /index.html
:method GET
reference set
GET /index.html
50byte -> 30byte
HPAC example (2/3)
CLIENT SERVER
Use index 3
with replace "/client.js"
0x04 (literal header, substitution indexing,
name index = 3)
0x03 (replaced entry index = 3)
0x0B (header value string length = 10)
“/client.js”
0 :scheme http
1 :scheme https
2 :host examp,
e.org
3 :path /client.js
4 :method GET
0 :scheme http
1 :scheme https
2 :host exampl
e.org
3 :path /inde.
html
4 :method GET
reference set
:scheme https
:host example.org
:path /client.js
:method GET
reference set
:scheme https
:host example.org
:path /index.html
:method GET
GET /client.js
49byte -> 13byte
HPAC example (3/3)
CLIENT SERVER
0 :scheme http
1 :scheme https
2 :host examp,
e.org
3 :path /index.
html
4 :method GET
0 :scheme http
1 :scheme https
2 :host example
.org
3 :path /client.js
4 :method GET
reference set
:scheme https
:host example.org
:path /client.js
:method GET
reference set
:scheme https
:host example.org
:path /client.js
:method GET
GET /client.js
49byte -> 0byte
implementations
● nghttp2 C
● http2-katana C#
● node-http2 NodeJS
● Mozilla C++
● http2-perl Perl
● iij-http2 NodeJS
● Akamai Ghost C++
● Chromium C++
● Hasan's GFE C++
● Twitter Java
see: https://github.com/http2/http2-spec/wiki/Implementations
spec and status
QUIC ?
QUIC ?
● SPDY over TCP has problem
○ 1 packet loss effects all streams
○ 3-way-handshake needs RTT
○ single congection winodw
● build reliable layer on UDP
○ packet loss dosen’t effects stream
○ less RTT
○ separate congection window
○ SSL layer
○ packet level error collection
● SPDY over QUIC
○ chrome canaly
○ www.google.com
QUIC resources
● docs, article
○ https://docs.google.
com/document/d/1RNHkx_VvKWyWg6Lr8SZ-
saqsQx7rFV-ev2jRFUoVD34/edit
○ http://blog.chromium.org/2013/06/experimenting-
with-quic.html?spref=tw&m=1
● ML
○ https://groups.google.com/a/chromium.
org/d/forum/proto-quic
● Source
○ https://code.google.
com/p/chromium/codesearch#chromium/src/net/quic
/&ct=rc&cd=1&q=quic&sq=package:chromium
more
http://d.hatena.ne.jp/Jxck/20130723/1374535593
Tools for dev
Tools?
spdy-indicator
● chrome, firefox, opera
● supports
○ spdy/2
○ spdy/3
○ quic
chrome://net-internals
nghttp2 & spdylay
● C implementation library
● spdycat, nghttp
○ client cli tool
● spdyd, nghttpd
○ file server
● shrpx, nghttpdx
○ proxy
web frontend of nghttp2 & spdycat => http2cat
HTTP2Cat (https://jxck.io/labs/http2cat)
books
● High Performance Browser Networking
○ by Ilya Grigorik(Google)
● http://chimera.labs.oreilly.com/books/1230000000545
anyone ?
Q & A
thanks :)
END

More Related Content

What's hot

Altitude SF 2017: QUIC - A low-latency secure transport for HTTP
Altitude SF 2017: QUIC - A low-latency secure transport for HTTPAltitude SF 2017: QUIC - A low-latency secure transport for HTTP
Altitude SF 2017: QUIC - A low-latency secure transport for HTTP
Fastly
 
Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1
PacSecJP
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
Sim Janghoon
 

What's hot (19)

Altitude SF 2017: QUIC - A low-latency secure transport for HTTP
Altitude SF 2017: QUIC - A low-latency secure transport for HTTPAltitude SF 2017: QUIC - A low-latency secure transport for HTTP
Altitude SF 2017: QUIC - A low-latency secure transport for HTTP
 
HAProxy
HAProxy HAProxy
HAProxy
 
Load Balancing with HAproxy
Load Balancing with HAproxyLoad Balancing with HAproxy
Load Balancing with HAproxy
 
HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战
 
A new Internet? Intro to HTTP/2, QUIC, DoH and DNS over QUIC
A new Internet? Intro to HTTP/2, QUIC, DoH and DNS over QUICA new Internet? Intro to HTTP/2, QUIC, DoH and DNS over QUIC
A new Internet? Intro to HTTP/2, QUIC, DoH and DNS over QUIC
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0
 
Observability with HAProxy
Observability with HAProxyObservability with HAProxy
Observability with HAProxy
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
 
Quic illustrated
Quic illustratedQuic illustrated
Quic illustrated
 
HTTP2 & HPACK #pyfes 2013-11-30
HTTP2 & HPACK #pyfes 2013-11-30HTTP2 & HPACK #pyfes 2013-11-30
HTTP2 & HPACK #pyfes 2013-11-30
 
HAProxy 1.9
HAProxy 1.9HAProxy 1.9
HAProxy 1.9
 
HAProxy scale out using open source
HAProxy scale out using open sourceHAProxy scale out using open source
HAProxy scale out using open source
 
Attacking http2 implementations (1)
Attacking http2 implementations (1)Attacking http2 implementations (1)
Attacking http2 implementations (1)
 
Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1
 
HTTP/3 over QUIC. All is new but still the same!
HTTP/3 over QUIC. All is new but still the same!HTTP/3 over QUIC. All is new but still the same!
HTTP/3 over QUIC. All is new but still the same!
 
HTTP/2 Update - FOSDEM 2016
HTTP/2 Update - FOSDEM 2016HTTP/2 Update - FOSDEM 2016
HTTP/2 Update - FOSDEM 2016
 
Http2
Http2Http2
Http2
 
Grpc present
Grpc presentGrpc present
Grpc present
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
 

Viewers also liked

Showroom Customer Intelligence IOT Enablement
Showroom Customer Intelligence IOT EnablementShowroom Customer Intelligence IOT Enablement
Showroom Customer Intelligence IOT Enablement
Stephen Sum
 
Http/2 - What's it all about?
Http/2  - What's it all about?Http/2  - What's it all about?
Http/2 - What's it all about?
Andy Davies
 
Social Media Secrets
Social Media SecretsSocial Media Secrets
Social Media Secrets
Guy Kawasaki
 

Viewers also liked (20)

Quic
QuicQuic
Quic
 
自動運転の概要
自動運転の概要自動運転の概要
自動運転の概要
 
Beyond TCP: The evolution of Internet transport protocols
Beyond TCP: The evolution of Internet transport protocolsBeyond TCP: The evolution of Internet transport protocols
Beyond TCP: The evolution of Internet transport protocols
 
Quic을 이용한 네트워크 성능 개선
 Quic을 이용한 네트워크 성능 개선 Quic을 이용한 네트워크 성능 개선
Quic을 이용한 네트워크 성능 개선
 
HTTP 2.0 Why, How and When
HTTP 2.0 Why, How and WhenHTTP 2.0 Why, How and When
HTTP 2.0 Why, How and When
 
HTTP/2 Server Push
HTTP/2 Server PushHTTP/2 Server Push
HTTP/2 Server Push
 
Showroom Customer Intelligence IOT Enablement
Showroom Customer Intelligence IOT EnablementShowroom Customer Intelligence IOT Enablement
Showroom Customer Intelligence IOT Enablement
 
CxM in the IoT: the case for service verticals integration
CxM in the IoT: the case for service verticals integrationCxM in the IoT: the case for service verticals integration
CxM in the IoT: the case for service verticals integration
 
The IoT-CSX Transformation
The IoT-CSX TransformationThe IoT-CSX Transformation
The IoT-CSX Transformation
 
Connected Service: Leveraging M2M and IoT Data to Create Proactive 1:1 Custom...
Connected Service: Leveraging M2M and IoT Data to Create Proactive 1:1 Custom...Connected Service: Leveraging M2M and IoT Data to Create Proactive 1:1 Custom...
Connected Service: Leveraging M2M and IoT Data to Create Proactive 1:1 Custom...
 
Http/2 - What's it all about?
Http/2  - What's it all about?Http/2  - What's it all about?
Http/2 - What's it all about?
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Top 10 Drivers for Service Innovation in the Emerging IoT World
Top 10 Drivers for Service Innovation in the Emerging IoT WorldTop 10 Drivers for Service Innovation in the Emerging IoT World
Top 10 Drivers for Service Innovation in the Emerging IoT World
 
Insurtech what’s in it for the customer
Insurtech what’s in it for the customerInsurtech what’s in it for the customer
Insurtech what’s in it for the customer
 
Sensing-as-a-Service - An IoT Service Provider's Perspectives
Sensing-as-a-Service - An IoT Service Provider's PerspectivesSensing-as-a-Service - An IoT Service Provider's Perspectives
Sensing-as-a-Service - An IoT Service Provider's Perspectives
 
What HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For YouWhat HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For You
 
Proactive Services Through Insights and IoT by M. Capone
Proactive Services Through Insights and IoT by M. CaponeProactive Services Through Insights and IoT by M. Capone
Proactive Services Through Insights and IoT by M. Capone
 
20 Inspirational Customer Experience Quotes
20 Inspirational Customer Experience Quotes20 Inspirational Customer Experience Quotes
20 Inspirational Customer Experience Quotes
 
Social Media Secrets
Social Media SecretsSocial Media Secrets
Social Media Secrets
 
Customer Retention: Why Your Dog Would Make More Money Than You
Customer Retention: Why Your Dog Would Make More Money Than YouCustomer Retention: Why Your Dog Would Make More Money Than You
Customer Retention: Why Your Dog Would Make More Money Than You
 

Similar to SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28

CSU33012-I-microservices.pdf
CSU33012-I-microservices.pdfCSU33012-I-microservices.pdf
CSU33012-I-microservices.pdf
Ricky Garg
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
webhostingguy
 
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атакСтек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Positive Hack Days
 

Similar to SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28 (20)

Http2.0 Guide 2013-08-14 #http2study
Http2.0 Guide 2013-08-14 #http2studyHttp2.0 Guide 2013-08-14 #http2study
Http2.0 Guide 2013-08-14 #http2study
 
Http2 kotlin
Http2   kotlinHttp2   kotlin
Http2 kotlin
 
HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and Why
 
Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.
 
Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2
 
CSU33012-I-microservices.pdf
CSU33012-I-microservices.pdfCSU33012-I-microservices.pdf
CSU33012-I-microservices.pdf
 
PPT
PPTPPT
PPT
 
Http request&response
Http request&responseHttp request&response
Http request&response
 
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
 
WWW and HTTP
WWW and HTTPWWW and HTTP
WWW and HTTP
 
6 app-tcp
6 app-tcp6 app-tcp
6 app-tcp
 
20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basic
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
 
Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2
 
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebLinux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
 
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атакСтек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
 
HTTP.pdf
HTTP.pdfHTTP.pdf
HTTP.pdf
 
Web Performance Optimization with HTTP/3
Web Performance Optimization with HTTP/3Web Performance Optimization with HTTP/3
Web Performance Optimization with HTTP/3
 
NGINX: HTTP/2 Server Push and gRPC – EMEA
NGINX: HTTP/2 Server Push and gRPC – EMEANGINX: HTTP/2 Server Push and gRPC – EMEA
NGINX: HTTP/2 Server Push and gRPC – EMEA
 
Rpi python web
Rpi python webRpi python web
Rpi python web
 

More from Jxck Jxck

Gtug girls meetup web socket handson
Gtug girls meetup   web socket handsonGtug girls meetup   web socket handson
Gtug girls meetup web socket handson
Jxck Jxck
 
Nodefest2011-Live
Nodefest2011-LiveNodefest2011-Live
Nodefest2011-Live
Jxck Jxck
 

More from Jxck Jxck (20)

Http2 on go1.6rc2
Http2 on go1.6rc2Http2 on go1.6rc2
Http2 on go1.6rc2
 
ORTC SVC SimulCast
ORTC SVC SimulCastORTC SVC SimulCast
ORTC SVC SimulCast
 
HTTP2 時代の Web - web over http2
HTTP2 時代の Web - web over http2HTTP2 時代の Web - web over http2
HTTP2 時代の Web - web over http2
 
Isomorphic Architecture & Interface
Isomorphic Architecture & InterfaceIsomorphic Architecture & Interface
Isomorphic Architecture & Interface
 
HTTP2 RFC 発行記念祝賀会
HTTP2 RFC 発行記念祝賀会HTTP2 RFC 発行記念祝賀会
HTTP2 RFC 発行記念祝賀会
 
Extensible web #html5j
Extensible web #html5jExtensible web #html5j
Extensible web #html5j
 
Extensible web
Extensible webExtensible web
Extensible web
 
HTTP2Study chronicle #http2conf
HTTP2Study chronicle #http2confHTTP2Study chronicle #http2conf
HTTP2Study chronicle #http2conf
 
mozaicfm-ep8 #altJS @ll-diver
mozaicfm-ep8 #altJS @ll-divermozaicfm-ep8 #altJS @ll-diver
mozaicfm-ep8 #altJS @ll-diver
 
Updates of socket.io@1.0
Updates of socket.io@1.0Updates of socket.io@1.0
Updates of socket.io@1.0
 
Why HTML Form dose not support PUT & DELETE ?
Why HTML Form dose not support PUT & DELETE ?Why HTML Form dose not support PUT & DELETE ?
Why HTML Form dose not support PUT & DELETE ?
 
Next generation web talk @cross2014
Next generation web talk @cross2014Next generation web talk @cross2014
Next generation web talk @cross2014
 
Network server in go #gocon 2013-11-14
Network server in go  #gocon 2013-11-14Network server in go  #gocon 2013-11-14
Network server in go #gocon 2013-11-14
 
Gtug girls meetup web socket handson
Gtug girls meetup   web socket handsonGtug girls meetup   web socket handson
Gtug girls meetup web socket handson
 
Next generation web talk @cross2013
Next generation web talk @cross2013Next generation web talk @cross2013
Next generation web talk @cross2013
 
Nodefest2011-Live
Nodefest2011-LiveNodefest2011-Live
Nodefest2011-Live
 
Test it in Node.js
Test it in Node.jsTest it in Node.js
Test it in Node.js
 
Real Time App with Node.js
Real Time App with Node.jsReal Time App with Node.js
Real Time App with Node.js
 
I visited JSConf + NodeConf + Joyent
I visited JSConf + NodeConf + JoyentI visited JSConf + NodeConf + Joyent
I visited JSConf + NodeConf + Joyent
 
Nodejs Introduction
Nodejs IntroductionNodejs Introduction
Nodejs Introduction
 

Recently uploaded

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28

  • 2. Jack ● id: Jxck ● github: Jxck ● twitter: jxck_ ● about: http://jxck.io ● blog: http://d.hatena.ne.jp/jxck ● Love: music
  • 3.
  • 6. History of HTTP ... HTTP/0.9 1996/ 5 HTTP/1.0 (RFC 1945) 1997/ 1 HTTP/1.1 (RFC 2068) 2009/11 SPDY/1 ... 2011/ 9 WebSocket(RFC 6455) 2012/ 8 HTTP/2.0 start 2012/11 HTTP/2.0 (draft-00) 2013/ 7 HTTP/2.0 (draft-04) 2013/ 8 interop testing 2013/ 8 HTTP/2.0 (draft-06)
  • 7. motivation ● Sharing Documents ● Over TCP ● Text Base Protocol ● Stateless version ● HTTP/0.9 ● HTTP/1.0 ● HTTP/1.1 ○ Keep-Alive ○ Pipelining HTTP / 1.1
  • 8. CLIENT SERVER Req / Res on HTTP/1.1 Text Base Protocol GET /index.html HTTP/1.1 Host: example.org Accept: text/html HTTP/1.1 200 OK Content-Type: text/html Content-Length: 35 <!DOCTYPE html> <title>hello</title>
  • 10. over TCP (Slow Start) Increase Segment Size for Congection Control
  • 11. Keep-Alive & Pipelining ● Keep-Alive ○ Re-Use TCP Connection ● Pipelining ○ Send all Req before Res
  • 12. HTTP ? ● Simple ○ text base, easy scaling etc ○ good for document sharing ○ but Good for Now ? ● now “Web” is ○ Plat Form (not only document sharing) ○ Ajax, WebSocket… ○ tons of JS, CSS, Images... ○ PC, Mobile, Tablet, TV, Game … ● needs ○ more speed ○ more efficiency ○ more secure
  • 14. motivation ● multiplexing ● header compression ● reduce RTT ● etc version ● spdy/1 ● spdy/2 (nginx) ● spdy/3 (mod_spdy, jetty) ● spdy/3.1 (twitter) ● spdy/4a3 (google) ● spdy/4 (discussing) about SPDY
  • 15. SPDY / 3 core feature ● npn (tls extension) ○ only https ● 1 connection ○ controlable keep alive ● multiplexing ○ better pipelining ● compressed binary frame ○ smaller than text protocol ● server push ○ new idea
  • 16. TLS-NPN (next protocol negotiation)
  • 18. SYN_STREAM frame <version=3, flags=1, length=217> (stream_id=1, assoc_stream_id=0, pri=3) :host: localhost:3000 :method: GET :path: / :scheme: https :version: HTTP/1.1 accept: */* accept-encoding: gzip SYN_REPLY frame <version=3, flags=0, length=102> (stream_id=1) :status: 200 OK :version: HTTP/1.1 content-length: 37 Stream(spdy/3) CLIENT SERVER Request Header Response Header Stream Start
  • 19. Stream(spdy/3) CLIENT Stream End SERVER DATA frame (stream_id=1, flags=0, length=37) <!DOCTYPE html> <title>hello</title> Response Body DATA frame (stream_id=1, flags=1, length=0) GOAWAY frame <version=3, flags=0, length=8> (last_good_stream_id=0)
  • 22. Server Push // index.html <html> <script src=”a.js” /> <link rel=”b.css” /> <img src=”c.png” /> </html> server pushes a.js, b.css, c.png while processing index.html pushed resources are cached in browser and cache hit when browser need it.
  • 24. SPDY ● Google’s Original Protocol ○ Google has both server & client ● Widely Deployed ○ twitter ○ facebook ○ LINE ● SPDY/4 discussing ○ websocket over spdy etc ● CRIME attack ○ disable header compression ○ need another compression
  • 26. about HTTP2 ● httpbis wg at IETF from 2012 ● motivation ○ update HTTP/1.1 ● version ○ draft-00 (copy of spdy/3) ○ ... ○ draft-03 ○ draft-04 (interop test) ○ draft-05 ○ draft-06 (2013/8/28 current) ○ ... ○ RFC XXXX (2014 spring? bit.ly/130oZrZ)
  • 27. SPDY or HTTP2.0 ? SPDY/3 SPDY/4 http2.0-00 http2.0-01 http2.0-06 http2.0 SPDY/n ??
  • 28. specs ● working on github ! ○ https://github.com/http2/http2-spec ● draft ○ http://tools.ietf.org/wg/httpbis/draft-ietf-httpbis-http2/ ● current (2013/8/28) ○ http://tools.ietf.org/html/draft-ietf-httpbis-http2-06 ● ML ○ http://lists.w3.org/Archives/Public/ietf-http-wg/ ○ https://www.ietf.org/mailman/listinfo/http-devops (new)
  • 29. HTTP/2.0 draft-06 ● Multiplexing (same as spdy) ● Server Push (same idea as spdy) ● ALPN / Upgrade ● Binary Frames ● Header Compression
  • 30. Starting HTTP2.0 (1/2 step) ● “http://” ○ Upgrade Header like websocket ● “https://” ○ ALPN (application layer protocol negotiation) ○ not NPN like spdy ● Known Supported ○ prior knowledge from DNS or so ○ may immediately send http2.0 frame
  • 32. Starting HTTP2.0 (2/2 step) ● sending connection header ○ make sure peer supports http2.0 ● with Magic Octets 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a PRI * HTTP/2.0 rnrn SM rnrn invalid Method PRI 2 new line for parser
  • 33. Frame Type ● DATA ● HEADERS ● PRIORITY ● RST_STREAM ● SETTINGS ● PUSH_PROMISE ● PING ● GOAWAY ● WINDOW_UPDATE ● CONTINUATION Changed from SPDY/3
  • 34. HEADERS & DATA frame CLIENT SERVER HEADERS(stream_id=1) + END_STREAM + END_HEADERS :method = GET :scheme = https :host = example.org :path = /index.html accept = text/html HEADERS(stream_id=1) - END_STREAM + END_HEADERS :status = 200 content-type = text/html content-length = 35 DATA(stream_id=1) + END_STREAM <!DOCTYPE html> <title>hello</title>
  • 35. Server Push(1) CLIENT SERVER HTTP/1.1 200 OK Content-Type: text/html Content-Length: 123 {binary data} PUSH_PROMISE (stream_id=1) + END_PUSH_PROMISE Promised-Stream-ID=2 :method = GET :scheme = https :host = example.org :path = /index.html accept = text/html HEADERS (stream_id=1) + END_STREAM + END_HEADERS :method = GET :scheme = https :host = example.org :path = /index.html accept = text/html PUSH Request
  • 36. Server Push(2) CLIENT SERVER Browser Cache DATA (stream_id=2) + END_STREAM {binary data} HEADERS (stream_id=2) - END_STREAM + END_HEADERS :status = 200 :path = /a.png content-type = image/png content-length = 123 PUSH Respons
  • 37. Server Push(2) CLIENT SERVER HEADERS (stream_id=1) - END_STREAM + END_HEADERS :status = 200 content-type = text/html content-length = 33 DATA (stream_id=1) + END_STREAM <html> <img src=”a.png”> </html> cache hit !! Response
  • 38. HPAC (header compression) ● HTTP Header ○ Text Base ○ Long Name ○ Send multiple time ● SPDY compression ○ CRIME ● HPAC ○ send diff ○ using binary ● HPAC component ○ Header Table ○ Reference Set
  • 39. Header Table Index Header Name Header Value 0 :scheme http 1 :scheme https 2 :host 3 :path / 4 :method GET 5 accept 6 accept-charset 7 accept-encoding ... ... 29 via Index Header Name Header Value 0 :status 200 1 age 2 cache-control 3 content-length 4 content-type 5 date 6 etag 7 expires ... ... 29 www-authenticate Request Header Table Response Header Table
  • 40. Header Representation ● Indexed Header Representation ● Literal Header Representation ○ Literal Header without Indexing ○ Literal Header with Incremental Indexing ○ Literal Header with Substitution Indexing
  • 41. HPAC example (1/3) CLIENT SERVER Use index 0 0x80 (indexed header, index = 0) Use index 4 0x84 (indexed header, index = 4) Use index 2 with replace "example.org" 0x03 (literal header, substitution indexing, name index = 2) 0x02 (replaced entry index = 2) 0x0B (header value string length = 11) “example.org” Use index 3 with replace "/index.html" 0x04 (literal header, substitution indexing, name index = 3) 0x03 (replaced entry index = 3) 0x0B (header value string length = 11) “/index.html” 0 :scheme http 1 :scheme https 2 :host exampl e.com 3 :path /index. html 4 :method GET 0 :scheme http 1 :scheme https 2 :host 3 :path / 4 :method GET reference set :scheme https :host example.org :path /index.html :method GET reference set GET /index.html 50byte -> 30byte
  • 42. HPAC example (2/3) CLIENT SERVER Use index 3 with replace "/client.js" 0x04 (literal header, substitution indexing, name index = 3) 0x03 (replaced entry index = 3) 0x0B (header value string length = 10) “/client.js” 0 :scheme http 1 :scheme https 2 :host examp, e.org 3 :path /client.js 4 :method GET 0 :scheme http 1 :scheme https 2 :host exampl e.org 3 :path /inde. html 4 :method GET reference set :scheme https :host example.org :path /client.js :method GET reference set :scheme https :host example.org :path /index.html :method GET GET /client.js 49byte -> 13byte
  • 43. HPAC example (3/3) CLIENT SERVER 0 :scheme http 1 :scheme https 2 :host examp, e.org 3 :path /index. html 4 :method GET 0 :scheme http 1 :scheme https 2 :host example .org 3 :path /client.js 4 :method GET reference set :scheme https :host example.org :path /client.js :method GET reference set :scheme https :host example.org :path /client.js :method GET GET /client.js 49byte -> 0byte
  • 44. implementations ● nghttp2 C ● http2-katana C# ● node-http2 NodeJS ● Mozilla C++ ● http2-perl Perl ● iij-http2 NodeJS ● Akamai Ghost C++ ● Chromium C++ ● Hasan's GFE C++ ● Twitter Java see: https://github.com/http2/http2-spec/wiki/Implementations
  • 46. QUIC ? ● SPDY over TCP has problem ○ 1 packet loss effects all streams ○ 3-way-handshake needs RTT ○ single congection winodw ● build reliable layer on UDP ○ packet loss dosen’t effects stream ○ less RTT ○ separate congection window ○ SSL layer ○ packet level error collection ● SPDY over QUIC ○ chrome canaly ○ www.google.com
  • 47. QUIC resources ● docs, article ○ https://docs.google. com/document/d/1RNHkx_VvKWyWg6Lr8SZ- saqsQx7rFV-ev2jRFUoVD34/edit ○ http://blog.chromium.org/2013/06/experimenting- with-quic.html?spref=tw&m=1 ● ML ○ https://groups.google.com/a/chromium. org/d/forum/proto-quic ● Source ○ https://code.google. com/p/chromium/codesearch#chromium/src/net/quic /&ct=rc&cd=1&q=quic&sq=package:chromium
  • 50. spdy-indicator ● chrome, firefox, opera ● supports ○ spdy/2 ○ spdy/3 ○ quic
  • 52. nghttp2 & spdylay ● C implementation library ● spdycat, nghttp ○ client cli tool ● spdyd, nghttpd ○ file server ● shrpx, nghttpdx ○ proxy web frontend of nghttp2 & spdycat => http2cat
  • 54. books ● High Performance Browser Networking ○ by Ilya Grigorik(Google) ● http://chimera.labs.oreilly.com/books/1230000000545