SlideShare a Scribd company logo
1 of 35
Download to read offline
HTTP/2 Tutorial
Hung T. Le
Computer Communications Laboratory – Univ. of Aizu
Outline
• Introduction of HTTP/2
̶ Hypertext Transfer Protocol
̶ Limitations of the existing HTTP/1.x
̶ HTTP/2
• Prominent features for video streaming
̶ Frame and Stream
̶ HTTP/2 features
• Conclusions
2
Hypertext Transfer Protocol (HTTP)
• According to Wikipedia,
̶ HTTP is the foundation of data
communication for the World Wide Web
• In web services,
̶ The web browser submits an HTTP request
to the web server
̶ The web server, which provides resources
such as HTML files, will react to the request
by sending an HTTP response carrying the
requested resource
̶ A web page is fully downloaded after a
sequence request-response transactions
• HTTP/1.1 is the main protocol for web
delivering nowadays
3
HTTP/1.x limitations
• HTTP/1.x problems
̶ Header-related overhead
̶ At least one RTT for each request
̶ Head of line blocking
4
The webpage is not displayed well until
all JavaScript files are fully received
Many header fields for only one request, regardless
the size of the requested resource
RTT from London to other places over
the world
Introduction to HTTP/2
• HTTP/2
̶ Developed based on SYDY proposed by Google
̶ Scandalized in May 2015
• New features
̶ Header field compression and Binary framing
̶ Server push and Stream termination
̶ Multiple concurrent streams over one connection and Flow control
• HTTP/2 is expected to replace HTTP/1.x in the near future
5
Source: http://caniuse.com/#feat=http2
Outline
• Introduction of HTTP/2
̶ Hyper Text Transfer Protocol
̶ Limitations of existing HTTP/1.x
̶ HTTP/2
• Prominent features for video streaming
̶ Frame and Stream
̶ HTTP/2 features
• Conclusions
6
Please note …
• Objectives
̶ Some prominent features that may be useful for video streaming
• Some parts are not included
̶ Initiating an HTTP/2 connection
̶ Upgrading to/from HTTP/2 connections
̶ Binary framing and Header field compression
̶ Error handling
̶ Security
• The concepts of HTTP/1.1 are out of the scope of this talk
̶ The structure of an HTTP message
̶ The response of an HTTP request, …
• Terms:
̶ Endpoint can be either the client or the server of the connection
7
• HTTP/2 Hierarchy
̶ HTTP/2 is an application layer
̶ Connection, Stream, Message, Frame.
• In the HTTP/2 standard (RFC 7540)
̶ TCP connection (pls. refer h2c) , TLS connection (pls. refer h2)
̶ Frame is the smallest unit of communication in HTTP/2
̶ A Stream is an independent and bidirectional sequence of frames
̶ Message is not defined in RFC 7540.
Frame and Stream
8
Session (TLS)
Transport (TCP)
Network (IP)
Application (HTTP/2)
Frame and Stream
• Basic idea of framing requests/responses
̶ To support multiple concurrent streams (multiplexing) in HTTP/2
̶ To cope with Head-of-line blocking problem
9Source: https://en.99designs.jp/
The important files such as CSS, JS, fonts
will be fully received before less important
ones (images, for example)
We will come back this problem in the next
part.
Frame and Stream
• The order of frames in an HTTP/2 connection
• The order of frames in a single stream
10
Stream 11
HEADERS
Stream 11
DATA
Stream 13
DATA
Stream 15
HEADERS
Stream 15
DATA
Stream 13
DATA
Stream 15
DATA
Note: The order of frames is significant
Stream 11
DATA
Stream 11
HEADERS
Stream 11
DATA
Stream 11
DATA
Stream 11
HEADERS
(a) A client sends an HTTP
request in stream 11
(b) A server sends an HTTP
respond in the same stream
Note: A HTTP request and a HTTP response fully consume a single stream
Frame
• Characteristics:
̶ A frame must be in a stream, which is identified by a specific field
called Stream Identifier in the frame header
̶ The frame size (in Length field) is from 2^14 (16KB) to 2^24-1
(16MB)
̶ Currently, the HTTP/2 standard defines 10 different frame types,
each of which serves a distinct purpose and defines distinct flags
11
Stream
• Important characteristics
̶ A stream is established by an endpoint but it can be used/closed by
either the client or the server
̶ A connection can contain multiple concurrently open streams. Again,
the frames of these streams are interleaved
̶ A stream is identified by an integer (i.e. Stream ID) assigned when
initiating the stream
• Some special streams
̶ Stream 0 is for sending the important settings, only SETTINGS,
WINDOW_UPDATE and PING frames are sent in this stream
̶ Stream 1 is used to restore the previous HTTP/1.1 request when the
connection is upgraded to HTTP/2
12
Prominent HTTP/2 features
• We explain how the HTTP/2 works via three scenarios
̶ Simple Request/Response exchange
̶ Simple exchange with server push
̶ Multiple concurrent exchanges
• The focuses are on
̶ Prominent features
̶ Related frame types
̶ Status of the stream during a session
13
Flowchart of a request/response
exchange
Client Server
Time
(1) Request/Response exchange
• First scenario:
̶ A client wants to request an image
from the server
• How the HTTP/2 works
̶ The client initiates a new stream (e.g.
stream 11) and sends the request
using an HEADERS frame
̶ Note that all stream start with one
HEADERS frame
14
HTTP/2HTTP/1.1
HEADERS frame (stream ID = 11)
+END_STREAM
+END_HEADERS
:method = GET
:path = /resource
host = example.org
accept = image/jpeg
GET /resource HTTP/1.1
Host: example.org
Accept: image/jpeg
(1) Request/Response exchange
• How the HTTP/2 works
̶ The server sends an HTTP
response on the same stream as
the request (i.e. stream 11)
̶ The HEADERS frame contains the
header of HTTP response (i.e.
status code 200 in this example)
̶ The following DATA frames
contains the payload of HTTP
response message
̶ The last frame is sent with the
END_STREAM flag set
15
…
Flowchart of a request/response
exchange
Client Server
Time
(1) Request/Response exchange
• Stream state
̶ During the exchange, the stream state on the server side and the client
side changes as follows:
idle
open
half closed
(remote)
half closed
(local)
closed
send ESrecv ES
send H/
recv H
send ES /
recv R/
send R
recv ES /
recv R/
send R
send R/
recv R
Server side
H: HEADERS frame (with implied CONTINUATION)
ES: END_STREAM frag
R: RST_STREAM frame
Client side
16
(1) Request/Response exchange
• Flow control
̶ to prevent the sender from overwhelming the receiver with data (in
DATA frames).
o For example, the receiver may be busy, under heavy load or doesn’t want
to receive more data in this stream
̶ to balance the loads among streams in the same connection
• Flow control is hop by hop (between the two endpoints)
17
Original serverProxy serverClient
There are two different flow control in the two links
• How the HTTP/2 works
̶ Flow control can be applied for both an individual stream and the whole
connection.
(1) Request/Response exchange
18
Flow control can be applied for both stream and connection
Server 1
Client
Stream 2
Stream 4
…
Connection 1
Buffer for connection 1
Server 2
Buffer for connection 2 Connection 2
(1) Request/Response exchange
̶ Using WINDOW_UPDATE frames (sent every time data are passed to the
upper layer) and SETTINGS frames (for setting the initial window size)
19
Flowchart of a request/response exchange
with Flow control.
- WINDOW_UPDATE frames are sent in
stream 11 and stream 0
…Client Server
Time
Client
…
- NOTE: the algorithm for Flow
control and the time to send
WINDOW_UPDATE frames are
dependent on the application.
(2) Simple exchange with Server push
• What is Server push?
̶ Server push feature allows the server to send pushed responses
before receiving the client’s requests, eliminating an RTT and reducing
the content loading time
20
Client Server Client Server Client Server
HTTP/1.0 HTTP/1.1 with
pipelining
HTTP/2.0 with server push
(without interleaving)
Time
- push.html
- style.css
- image.png
(2) Simple exchange with Server push
• Second scenario
̶ Based on the client-initiated request,
the server will send pushed responses
(along with corresponding “promised”
requests)
• How the HTTP/2 works
̶ The pushed response is always
associated with an explicit request.
̶ The server then sends the
PUSH_PROMISE frame via the stream
of the client-initiated request.
21
Flowchart of a request/response
exchange with Server push
Client Server
Time
(2) Simple exchange with Server push
• How the HTTP/2 works
̶ This PUSH_PROMISE frame includes
promised request and indicates the stream
in which pushed respond is delivered
̶ Without the acknowledgement of the
PUSH_PROMISE, the client sends
immediately the pushed response
̶ To start a new push stream, a HEADERS
frame is sent to the client, followed by
DATA frames
22
Flowchart of a request/response
exchange with Server push
Client Server
Time
…
(1) Request/Response exchange
• Stream termination
̶ If the client does not want to receive the pushed response, it will simply
cancel the stream by sending a RST_STREAM frame
23
Note: The client must prepare to receive unexpected
frames that the server had sent and had queued to
send before the RST_STREAM frame arrival
Client Server
Time
Client
Time that the server stops sending data
Time that the client sends RST_STREAM
Time that the last DATA frames arrival
…
(2) Simple exchange with Server push
• The state changes in a pushed stream
idle
open
half closed
(remote)
half closed
(local)
closed
send ESrecv ES
send H/
recv H
send ES /
recv R/
send R
recv ES /
recv R/
send R
send R/
recv R
Server side
H: HEADERS frame (with implied CONTINUATION)
PP: PUSH_PROMISE frame (with implied CONTINUATION)
ES: END_STREAM frag
R: RST_STREAM frame
Client side
reserved
(remote)
reserved
(local)
send H recv H
recv R/
send R
send PP recv PP
recv R/
send R
24
25Source: https://http2-push.appspot.com/
(3) Multiple concurrent exchanges
• Multiple concurrent streams:
̶ The more important resources should be given the higher priorities.
The order in which files are sent is based on Stream dependencies.
̶ Among all streams that have the same level, the streams having
higher Weight receive more resources.
̶ The Stream dependency and Weight are only suggestions by the
receiver
• Dependency tree
26
Stream 0
Stream 3 Stream 9
Stream 5 Stream 7
w=1 w=2
w=1 w=2
̶ The stream dependencies
and weight of all streams are
represented as a dependency
tree, which can be changed
by the receiver
(3) Multiple concurrent exchanges
̶ The scheduling streams are only for
active streams (i.e. the streams have
some data to send)
̶ The number of concurrent streams is set
by the client via SETTINGS frame. If this
number is equal to zero, the connection
is stalling.
• First examples
27
Stream 3
HEADERS
Stream 5
HEADERS
Stream 3
DATA
Stream 5
DATA +ES
Stream 3
DATA +ES
- index.html (stream 3)
- style.css (stream 5)
• The client decides stream dependency via HEADERS frames
• If streams 3 and 5 are active, all frames of stream 3 are sent to the client, followed
by those of stream 5
Stream 3
HEADERS
Stream 5
HEADERS
Stream 0
Stream 3 Stream 9
Stream 5 Stream 7
w=1 w=2
w=1 w=2
(3) Multiple concurrent exchanges
• Second example
28
Stream 0
Stream 3 Stream 9
Stream 5 Stream 7
w=1 w=2
w=1 w=2
#5
100B
#9
100B
#9
100B
#7
100B
#9
100B
#9
100B
#7
100B
#9
100B
#9
100B
#5
100B
When streams 5, 7 and 9 are active, the server should
send their frames as above
• Left subtree: Right subtree = 1:2
• In the left subtree, Stream 5 : Stream 7 = 1:2
Time
(3) Multiple concurrent exchanges
29
(3) Multiple concurrent exchanges
30
(3) Multiple concurrent exchanges
31
32
Conclusions
• We already introduced HTTP/2 and basic concepts of HTTP/2
• We also explained how HTTP/2 works via the three scenarios
̶ Simple Request/Response exchange
o Flow control
̶ Simple exchange with server push
o Server push
o Stream termination
̶ Multiple concurrent exchanges
o Prioritization
33
34
(1) Request/Response exchange
• The second example in the first scenario:
̶ A client wants to send an image to the server
• How the HTTP/2 works
̶ The client initiates a new stream and sends the request using
HEADERS, CONTINUATION or DATA frames.
̶ Note that all stream start with one HEADERS frame
POST /upload HTTP/1.1
Host: www.example.org
Content-Type: application/jpeg
Content-Length: 123
{binary data}
HEADERS frame
- END_STREAM
- END_HEADERS
:method = POST
:path = /resource
:scheme = https
HTTP/2HTTP/1.1
CONTINUATION frame
+ END_HEADERS
content-type = image/jpeg
host = example.org
content-length = 123
DATA frame
+ END_STREAM
{binary data}
1) Header fields are compressed
to avoid header-related
overhead
2) There is no interleaved frames
between HEADRES and
CONTINUATION frames
35

More Related Content

What's hot

BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料Toshiki Tsuboi
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Weaveworks
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-RegionJi-Woong Choi
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KernelThomas Graf
 
10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPF10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPFShuji Yamada
 
DPDKによる高速コンテナネットワーキング
DPDKによる高速コンテナネットワーキングDPDKによる高速コンテナネットワーキング
DPDKによる高速コンテナネットワーキングTomoya Hibi
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDPDaniel T. Lee
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecturehugo lu
 
RFC6241(Network Configuration Protocol (NETCONF))の勉強資料
RFC6241(Network Configuration Protocol (NETCONF))の勉強資料RFC6241(Network Configuration Protocol (NETCONF))の勉強資料
RFC6241(Network Configuration Protocol (NETCONF))の勉強資料Tetsuya Hasegawa
 
プログラマ目線から見たRDMAのメリットと その応用例について
プログラマ目線から見たRDMAのメリットとその応用例についてプログラマ目線から見たRDMAのメリットとその応用例について
プログラマ目線から見たRDMAのメリットと その応用例についてMasanori Itoh
 
20 - IDNOG03 - Franki Lim (ARISTA) - Overlay Networking with VXLAN
20 - IDNOG03 - Franki Lim (ARISTA) - Overlay Networking with VXLAN20 - IDNOG03 - Franki Lim (ARISTA) - Overlay Networking with VXLAN
20 - IDNOG03 - Franki Lim (ARISTA) - Overlay Networking with VXLANIndonesia Network Operators Group
 
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux KernelAccelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux KernelThomas Graf
 
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
NGINX Kubernetes Ingress Controller: Getting Started – EMEANGINX Kubernetes Ingress Controller: Getting Started – EMEA
NGINX Kubernetes Ingress Controller: Getting Started – EMEAAine Long
 
「おうちクラウド」が今熱い!
「おうちクラウド」が今熱い!「おうちクラウド」が今熱い!
「おうちクラウド」が今熱い!Hirotaka Sato
 
VXLAN and FRRouting
VXLAN and FRRoutingVXLAN and FRRouting
VXLAN and FRRoutingFaisal Reza
 
"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越Kentaro Ebisawa
 

What's hot (20)

BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux Kernel
 
Quic illustrated
Quic illustratedQuic illustrated
Quic illustrated
 
10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPF10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPF
 
DPDKによる高速コンテナネットワーキング
DPDKによる高速コンテナネットワーキングDPDKによる高速コンテナネットワーキング
DPDKによる高速コンテナネットワーキング
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
 
RFC6241(Network Configuration Protocol (NETCONF))の勉強資料
RFC6241(Network Configuration Protocol (NETCONF))の勉強資料RFC6241(Network Configuration Protocol (NETCONF))の勉強資料
RFC6241(Network Configuration Protocol (NETCONF))の勉強資料
 
プログラマ目線から見たRDMAのメリットと その応用例について
プログラマ目線から見たRDMAのメリットとその応用例についてプログラマ目線から見たRDMAのメリットとその応用例について
プログラマ目線から見たRDMAのメリットと その応用例について
 
20 - IDNOG03 - Franki Lim (ARISTA) - Overlay Networking with VXLAN
20 - IDNOG03 - Franki Lim (ARISTA) - Overlay Networking with VXLAN20 - IDNOG03 - Franki Lim (ARISTA) - Overlay Networking with VXLAN
20 - IDNOG03 - Franki Lim (ARISTA) - Overlay Networking with VXLAN
 
SRv6 study
SRv6 studySRv6 study
SRv6 study
 
Google QUIC
Google QUICGoogle QUIC
Google QUIC
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux KernelAccelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux Kernel
 
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
NGINX Kubernetes Ingress Controller: Getting Started – EMEANGINX Kubernetes Ingress Controller: Getting Started – EMEA
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
 
「おうちクラウド」が今熱い!
「おうちクラウド」が今熱い!「おうちクラウド」が今熱い!
「おうちクラウド」が今熱い!
 
VXLAN and FRRouting
VXLAN and FRRoutingVXLAN and FRRouting
VXLAN and FRRouting
 
"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越
 

Viewers also liked

HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0Cory Forsyth
 
Critical issues in Presumptive Taxation & Tax Audit
Critical issues in Presumptive Taxation & Tax AuditCritical issues in Presumptive Taxation & Tax Audit
Critical issues in Presumptive Taxation & Tax AuditCA. Pramod Jain
 
Computerized teaching in Hindi
Computerized teaching in Hindi Computerized teaching in Hindi
Computerized teaching in Hindi thanianu92
 
Development of an FHMA-based Underwater Acoustic Communications System for Mu...
Development of an FHMA-based Underwater Acoustic Communications System for Mu...Development of an FHMA-based Underwater Acoustic Communications System for Mu...
Development of an FHMA-based Underwater Acoustic Communications System for Mu...Waqas Tariq
 
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...Förderverein Technische Fakultät
 
Quality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingQuality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingFrancesco Fullone
 
Rethinking the agile enterprise
Rethinking the agile enterpriseRethinking the agile enterprise
Rethinking the agile enterpriseBrandon Byars
 

Viewers also liked (15)

HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
 
Medicina y robótica
Medicina y robóticaMedicina y robótica
Medicina y robótica
 
Robótica en medicina
Robótica en medicinaRobótica en medicina
Robótica en medicina
 
Energy and security
Energy and securityEnergy and security
Energy and security
 
Critical issues in Presumptive Taxation & Tax Audit
Critical issues in Presumptive Taxation & Tax AuditCritical issues in Presumptive Taxation & Tax Audit
Critical issues in Presumptive Taxation & Tax Audit
 
Transito entre la pubertad y la adolescencia
Transito entre la pubertad y la adolescenciaTransito entre la pubertad y la adolescencia
Transito entre la pubertad y la adolescencia
 
Computerized teaching in Hindi
Computerized teaching in Hindi Computerized teaching in Hindi
Computerized teaching in Hindi
 
Mycenaean civilization
Mycenaean civilizationMycenaean civilization
Mycenaean civilization
 
Assignment 6
Assignment 6Assignment 6
Assignment 6
 
Development of an FHMA-based Underwater Acoustic Communications System for Mu...
Development of an FHMA-based Underwater Acoustic Communications System for Mu...Development of an FHMA-based Underwater Acoustic Communications System for Mu...
Development of an FHMA-based Underwater Acoustic Communications System for Mu...
 
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
 
HTML 5
HTML 5HTML 5
HTML 5
 
Quality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingQuality, Courtesy and a big Parking
Quality, Courtesy and a big Parking
 
HTML5
HTML5HTML5
HTML5
 
Rethinking the agile enterprise
Rethinking the agile enterpriseRethinking the agile enterprise
Rethinking the agile enterprise
 

Similar to HTTP/2 standard for video streaming

Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1Daniel Austin
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youJava EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youAlex Theedom
 
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 eraHTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 erapeychevi
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1PacSecJP
 
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)Hoang Minh Nguyen
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over WirelessFarooq Khan
 
HTTP/2 - Differences and Performance Improvements with HTTP
HTTP/2 - Differences and Performance Improvements with HTTPHTTP/2 - Differences and Performance Improvements with HTTP
HTTP/2 - Differences and Performance Improvements with HTTPAmit Bhakay
 
Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocolsDaniel Austin
 
Attacking http2 implementations (1)
Attacking http2 implementations (1)Attacking http2 implementations (1)
Attacking http2 implementations (1)John Villamil
 
HTTP Request Smuggling
HTTP Request SmugglingHTTP Request Smuggling
HTTP Request SmugglingAkash Ashokan
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...Edward Burns
 

Similar to HTTP/2 standard for video streaming (20)

Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Http/2
Http/2Http/2
Http/2
 
HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youJava EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
 
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 eraHTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
 
Application layer
Application layerApplication layer
Application layer
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1
 
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over Wireless
 
HTTP/2 - Differences and Performance Improvements with HTTP
HTTP/2 - Differences and Performance Improvements with HTTPHTTP/2 - Differences and Performance Improvements with HTTP
HTTP/2 - Differences and Performance Improvements with HTTP
 
Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocols
 
Http2
Http2Http2
Http2
 
Attacking http2 implementations (1)
Attacking http2 implementations (1)Attacking http2 implementations (1)
Attacking http2 implementations (1)
 
Http2 kotlin
Http2   kotlinHttp2   kotlin
Http2 kotlin
 
Introduction to HTTP2
Introduction to HTTP2Introduction to HTTP2
Introduction to HTTP2
 
Http smuggling 1 200523064027
Http smuggling 1 200523064027Http smuggling 1 200523064027
Http smuggling 1 200523064027
 
HTTP Request Smuggling
HTTP Request SmugglingHTTP Request Smuggling
HTTP Request Smuggling
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
 

Recently uploaded

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
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 DiscoveryTrustArc
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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...Martijn de Jong
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Recently uploaded (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

HTTP/2 standard for video streaming

  • 1. HTTP/2 Tutorial Hung T. Le Computer Communications Laboratory – Univ. of Aizu
  • 2. Outline • Introduction of HTTP/2 ̶ Hypertext Transfer Protocol ̶ Limitations of the existing HTTP/1.x ̶ HTTP/2 • Prominent features for video streaming ̶ Frame and Stream ̶ HTTP/2 features • Conclusions 2
  • 3. Hypertext Transfer Protocol (HTTP) • According to Wikipedia, ̶ HTTP is the foundation of data communication for the World Wide Web • In web services, ̶ The web browser submits an HTTP request to the web server ̶ The web server, which provides resources such as HTML files, will react to the request by sending an HTTP response carrying the requested resource ̶ A web page is fully downloaded after a sequence request-response transactions • HTTP/1.1 is the main protocol for web delivering nowadays 3
  • 4. HTTP/1.x limitations • HTTP/1.x problems ̶ Header-related overhead ̶ At least one RTT for each request ̶ Head of line blocking 4 The webpage is not displayed well until all JavaScript files are fully received Many header fields for only one request, regardless the size of the requested resource RTT from London to other places over the world
  • 5. Introduction to HTTP/2 • HTTP/2 ̶ Developed based on SYDY proposed by Google ̶ Scandalized in May 2015 • New features ̶ Header field compression and Binary framing ̶ Server push and Stream termination ̶ Multiple concurrent streams over one connection and Flow control • HTTP/2 is expected to replace HTTP/1.x in the near future 5 Source: http://caniuse.com/#feat=http2
  • 6. Outline • Introduction of HTTP/2 ̶ Hyper Text Transfer Protocol ̶ Limitations of existing HTTP/1.x ̶ HTTP/2 • Prominent features for video streaming ̶ Frame and Stream ̶ HTTP/2 features • Conclusions 6
  • 7. Please note … • Objectives ̶ Some prominent features that may be useful for video streaming • Some parts are not included ̶ Initiating an HTTP/2 connection ̶ Upgrading to/from HTTP/2 connections ̶ Binary framing and Header field compression ̶ Error handling ̶ Security • The concepts of HTTP/1.1 are out of the scope of this talk ̶ The structure of an HTTP message ̶ The response of an HTTP request, … • Terms: ̶ Endpoint can be either the client or the server of the connection 7
  • 8. • HTTP/2 Hierarchy ̶ HTTP/2 is an application layer ̶ Connection, Stream, Message, Frame. • In the HTTP/2 standard (RFC 7540) ̶ TCP connection (pls. refer h2c) , TLS connection (pls. refer h2) ̶ Frame is the smallest unit of communication in HTTP/2 ̶ A Stream is an independent and bidirectional sequence of frames ̶ Message is not defined in RFC 7540. Frame and Stream 8 Session (TLS) Transport (TCP) Network (IP) Application (HTTP/2)
  • 9. Frame and Stream • Basic idea of framing requests/responses ̶ To support multiple concurrent streams (multiplexing) in HTTP/2 ̶ To cope with Head-of-line blocking problem 9Source: https://en.99designs.jp/ The important files such as CSS, JS, fonts will be fully received before less important ones (images, for example) We will come back this problem in the next part.
  • 10. Frame and Stream • The order of frames in an HTTP/2 connection • The order of frames in a single stream 10 Stream 11 HEADERS Stream 11 DATA Stream 13 DATA Stream 15 HEADERS Stream 15 DATA Stream 13 DATA Stream 15 DATA Note: The order of frames is significant Stream 11 DATA Stream 11 HEADERS Stream 11 DATA Stream 11 DATA Stream 11 HEADERS (a) A client sends an HTTP request in stream 11 (b) A server sends an HTTP respond in the same stream Note: A HTTP request and a HTTP response fully consume a single stream
  • 11. Frame • Characteristics: ̶ A frame must be in a stream, which is identified by a specific field called Stream Identifier in the frame header ̶ The frame size (in Length field) is from 2^14 (16KB) to 2^24-1 (16MB) ̶ Currently, the HTTP/2 standard defines 10 different frame types, each of which serves a distinct purpose and defines distinct flags 11
  • 12. Stream • Important characteristics ̶ A stream is established by an endpoint but it can be used/closed by either the client or the server ̶ A connection can contain multiple concurrently open streams. Again, the frames of these streams are interleaved ̶ A stream is identified by an integer (i.e. Stream ID) assigned when initiating the stream • Some special streams ̶ Stream 0 is for sending the important settings, only SETTINGS, WINDOW_UPDATE and PING frames are sent in this stream ̶ Stream 1 is used to restore the previous HTTP/1.1 request when the connection is upgraded to HTTP/2 12
  • 13. Prominent HTTP/2 features • We explain how the HTTP/2 works via three scenarios ̶ Simple Request/Response exchange ̶ Simple exchange with server push ̶ Multiple concurrent exchanges • The focuses are on ̶ Prominent features ̶ Related frame types ̶ Status of the stream during a session 13
  • 14. Flowchart of a request/response exchange Client Server Time (1) Request/Response exchange • First scenario: ̶ A client wants to request an image from the server • How the HTTP/2 works ̶ The client initiates a new stream (e.g. stream 11) and sends the request using an HEADERS frame ̶ Note that all stream start with one HEADERS frame 14 HTTP/2HTTP/1.1 HEADERS frame (stream ID = 11) +END_STREAM +END_HEADERS :method = GET :path = /resource host = example.org accept = image/jpeg GET /resource HTTP/1.1 Host: example.org Accept: image/jpeg
  • 15. (1) Request/Response exchange • How the HTTP/2 works ̶ The server sends an HTTP response on the same stream as the request (i.e. stream 11) ̶ The HEADERS frame contains the header of HTTP response (i.e. status code 200 in this example) ̶ The following DATA frames contains the payload of HTTP response message ̶ The last frame is sent with the END_STREAM flag set 15 … Flowchart of a request/response exchange Client Server Time
  • 16. (1) Request/Response exchange • Stream state ̶ During the exchange, the stream state on the server side and the client side changes as follows: idle open half closed (remote) half closed (local) closed send ESrecv ES send H/ recv H send ES / recv R/ send R recv ES / recv R/ send R send R/ recv R Server side H: HEADERS frame (with implied CONTINUATION) ES: END_STREAM frag R: RST_STREAM frame Client side 16
  • 17. (1) Request/Response exchange • Flow control ̶ to prevent the sender from overwhelming the receiver with data (in DATA frames). o For example, the receiver may be busy, under heavy load or doesn’t want to receive more data in this stream ̶ to balance the loads among streams in the same connection • Flow control is hop by hop (between the two endpoints) 17 Original serverProxy serverClient There are two different flow control in the two links
  • 18. • How the HTTP/2 works ̶ Flow control can be applied for both an individual stream and the whole connection. (1) Request/Response exchange 18 Flow control can be applied for both stream and connection Server 1 Client Stream 2 Stream 4 … Connection 1 Buffer for connection 1 Server 2 Buffer for connection 2 Connection 2
  • 19. (1) Request/Response exchange ̶ Using WINDOW_UPDATE frames (sent every time data are passed to the upper layer) and SETTINGS frames (for setting the initial window size) 19 Flowchart of a request/response exchange with Flow control. - WINDOW_UPDATE frames are sent in stream 11 and stream 0 …Client Server Time Client … - NOTE: the algorithm for Flow control and the time to send WINDOW_UPDATE frames are dependent on the application.
  • 20. (2) Simple exchange with Server push • What is Server push? ̶ Server push feature allows the server to send pushed responses before receiving the client’s requests, eliminating an RTT and reducing the content loading time 20 Client Server Client Server Client Server HTTP/1.0 HTTP/1.1 with pipelining HTTP/2.0 with server push (without interleaving) Time - push.html - style.css - image.png
  • 21. (2) Simple exchange with Server push • Second scenario ̶ Based on the client-initiated request, the server will send pushed responses (along with corresponding “promised” requests) • How the HTTP/2 works ̶ The pushed response is always associated with an explicit request. ̶ The server then sends the PUSH_PROMISE frame via the stream of the client-initiated request. 21 Flowchart of a request/response exchange with Server push Client Server Time
  • 22. (2) Simple exchange with Server push • How the HTTP/2 works ̶ This PUSH_PROMISE frame includes promised request and indicates the stream in which pushed respond is delivered ̶ Without the acknowledgement of the PUSH_PROMISE, the client sends immediately the pushed response ̶ To start a new push stream, a HEADERS frame is sent to the client, followed by DATA frames 22 Flowchart of a request/response exchange with Server push Client Server Time …
  • 23. (1) Request/Response exchange • Stream termination ̶ If the client does not want to receive the pushed response, it will simply cancel the stream by sending a RST_STREAM frame 23 Note: The client must prepare to receive unexpected frames that the server had sent and had queued to send before the RST_STREAM frame arrival Client Server Time Client Time that the server stops sending data Time that the client sends RST_STREAM Time that the last DATA frames arrival …
  • 24. (2) Simple exchange with Server push • The state changes in a pushed stream idle open half closed (remote) half closed (local) closed send ESrecv ES send H/ recv H send ES / recv R/ send R recv ES / recv R/ send R send R/ recv R Server side H: HEADERS frame (with implied CONTINUATION) PP: PUSH_PROMISE frame (with implied CONTINUATION) ES: END_STREAM frag R: RST_STREAM frame Client side reserved (remote) reserved (local) send H recv H recv R/ send R send PP recv PP recv R/ send R 24
  • 26. (3) Multiple concurrent exchanges • Multiple concurrent streams: ̶ The more important resources should be given the higher priorities. The order in which files are sent is based on Stream dependencies. ̶ Among all streams that have the same level, the streams having higher Weight receive more resources. ̶ The Stream dependency and Weight are only suggestions by the receiver • Dependency tree 26 Stream 0 Stream 3 Stream 9 Stream 5 Stream 7 w=1 w=2 w=1 w=2 ̶ The stream dependencies and weight of all streams are represented as a dependency tree, which can be changed by the receiver
  • 27. (3) Multiple concurrent exchanges ̶ The scheduling streams are only for active streams (i.e. the streams have some data to send) ̶ The number of concurrent streams is set by the client via SETTINGS frame. If this number is equal to zero, the connection is stalling. • First examples 27 Stream 3 HEADERS Stream 5 HEADERS Stream 3 DATA Stream 5 DATA +ES Stream 3 DATA +ES - index.html (stream 3) - style.css (stream 5) • The client decides stream dependency via HEADERS frames • If streams 3 and 5 are active, all frames of stream 3 are sent to the client, followed by those of stream 5 Stream 3 HEADERS Stream 5 HEADERS Stream 0 Stream 3 Stream 9 Stream 5 Stream 7 w=1 w=2 w=1 w=2
  • 28. (3) Multiple concurrent exchanges • Second example 28 Stream 0 Stream 3 Stream 9 Stream 5 Stream 7 w=1 w=2 w=1 w=2 #5 100B #9 100B #9 100B #7 100B #9 100B #9 100B #7 100B #9 100B #9 100B #5 100B When streams 5, 7 and 9 are active, the server should send their frames as above • Left subtree: Right subtree = 1:2 • In the left subtree, Stream 5 : Stream 7 = 1:2 Time
  • 29. (3) Multiple concurrent exchanges 29
  • 30. (3) Multiple concurrent exchanges 30
  • 31. (3) Multiple concurrent exchanges 31
  • 32. 32
  • 33. Conclusions • We already introduced HTTP/2 and basic concepts of HTTP/2 • We also explained how HTTP/2 works via the three scenarios ̶ Simple Request/Response exchange o Flow control ̶ Simple exchange with server push o Server push o Stream termination ̶ Multiple concurrent exchanges o Prioritization 33
  • 34. 34
  • 35. (1) Request/Response exchange • The second example in the first scenario: ̶ A client wants to send an image to the server • How the HTTP/2 works ̶ The client initiates a new stream and sends the request using HEADERS, CONTINUATION or DATA frames. ̶ Note that all stream start with one HEADERS frame POST /upload HTTP/1.1 Host: www.example.org Content-Type: application/jpeg Content-Length: 123 {binary data} HEADERS frame - END_STREAM - END_HEADERS :method = POST :path = /resource :scheme = https HTTP/2HTTP/1.1 CONTINUATION frame + END_HEADERS content-type = image/jpeg host = example.org content-length = 123 DATA frame + END_STREAM {binary data} 1) Header fields are compressed to avoid header-related overhead 2) There is no interleaved frames between HEADRES and CONTINUATION frames 35