TLSTLS TCPTCP BrowserBrowser HTTP/2HTTP/2 TLSTLS TCPTCP ServerServer HTTP/2HTTP/2.

16

Transcript of TLSTLS TCPTCP BrowserBrowser HTTP/2HTTP/2 TLSTLS TCPTCP ServerServer HTTP/2HTTP/2.

3-38

HTTP/2 in Windows 10

Rob TraceSenior Program ManagerHTTP/2 in Windows 10

Why HTTP/2?

HTTP/2 Overview

HTTP/2 in Windows 10

Agenda

Performance mattersHTTP/2 reduces the impact of latency on web applications

TLS is becoming the defaultHTTP/2 amortizes TLS costs for the entire application

Enabling new web development

Why HTTP/2

User perceivable improvement in web site performance

Work with today’s internet

Remain compatible with existing content

HTTP/2 Goals

Multiplexing

Header Compression

Server Push

HTTP/2 Overview

TLS

TCP

Browser

HTTP/2

TLS

TCP

Server

HTTP/2

Request

Request

Response

Response

• HTTP/2 uses standard HTTP ports (80 = HTTP://, 443 = HTTPS://)• HTTP/2 can also be used with non-standard ports (ie HTTPS://www.contoso.com:8080)

• HTTP/2 can be used with HTTP:// and HTTPS:// scheme

HTTP/2 over clear text (HTTP:// Scheme)• Negotiate TCP connection• Client sends request over HTTP 1.1• Server sends HTTP 1.1 response and

includes an UPGRADE header• Client sends 2nd request over HTTP 1.1,

includes UPGRADE header• Server sends 101 – Switching Protocols

with response• Client send HTTP/2 setting frame…

HTTP/2 over TLS (HTTPS:// Scheme)• Negotiate TCP connection• TLS Client Hello contains ALPN Extension

with h2, HTTP 1.1• TLS Server Hello contains ALPN

Extension with h2• TLS completes• Client sends HTTP/2 Settings Frame…

HTTP/2 Negotiation

Not implemented

initially Windows 10

HTTP/1.1 – Request = Connection HTTP/2 – Request = Stream

Streams look like TCP connections to IIS/ASP.NET appsHTTP/2 Connections and Streams

Each request required dedicated TCP connection TCP connection can have multiple streams (requests)

Responses come in order per connection Responses can come out of order, server can optimize

Each connection requires setup + slow start No connection setup for new streams, no slow start

Application sees “connections” Streams are represented as “connections” to apps

Stream Lifecycle

Idle Open

Half-Close

d(local)

Half-Close

d(remote

)

Closed

Reserved

(local)

Reserved

(remote)

Client opens stream

Header Compression

:path: /accept-encoding: gzip,deflateuser-agent::authority:…

HPACK

Static Table

:authority: www.example.com

Dynamic Table

:method: GET:scheme: http:path: /:authority: www.example.com

Lit-Index

Name Value

(Huffman-encoded string)

HPACK Operations

Each header is expressed as either…

• Indexed: Reference to full header in static or dynamic table• Literal

• Name as reference to static/dynamic table entry, or as Huffman-encoded string

• Value as Huffman-encoded string• Indexing behavior:

• Add to dynamic table• Don’t add to dynamic table• NEVER add to dynamic table (supposed to be persisted through

intermediaries)

Server PushGET /index.aspx

GET /style.css

GET /logo.png

GET /script.js

• App calls new IIS/ASP API with desired request headers• Creates new request in http.sys pipeline, delivered to app as if client

made request

Push Promise /style.css /logo.png /script.js

Hanging GET do not block

Domain de-sharding

Server Push

Opportunity for smaller resources, better caching

Fewer, longer lived connections

How HTTP/2 may affect web applications

Windows 10 HTTP/2 Support

WinInet

iXH

R

HTTP.SYS

Win

dow

s.Web.H

TTP

WW

A

Inte

rnet E

xplo

rer

Sparta

n

WebV

iew

IIS

ASP.N

ET

Supported HTTP/2 Platforms

HTTP/2 Implementation

No HTTP/2 Support for Win10

Web O

C

.NET

Win

HTTP

Legacy

W

eb

Pla

tform

s

Windows 10 UAP Apps only

HTTP/2 off by default

Where to go next?• Try out HTTP/2 with Windows 10• Get your apps in the store• Try out Windows 10 server for HTTP/2 support

© 2015 Microsoft Corporation. All rights reserved.