Http 2

41
HTTP 2 HTTP 2.0 , no minor version Narendran Solai Sridharan

Transcript of Http 2

Page 1: Http 2

HTTP 2HTTP 2.0, no minor version

Narendran Solai Sridharan

Page 2: Http 2

Evolution of HTTP1991: HTTP/0.9 The One-Line Protocol

1996: HTTP/1.0 RFC 1945 Rapid Growth and Informational 1999: HTTP/1.1 RFC 2616 Internet Standard

2007: HTTPbis started to refresh HTTP/1.12009: Google announced SPDY

2011: Chrome and all Google services run SPDY2012: HTTP/2 work began, based on SPDY2014: HTTP/1.1 updated, RFC 7230 series

2015: HTTP/2 finalized RFC 7540 New Internet Standard2016: Chrome removes SPDY to support HTTP/2 Adoption

Page 3: Http 2

How New is HTTP 2.0?A rhetoric Question of Course

***It is BRAND NEW as of 2016***SPDY initiative started by Google on 2009 to investigate and improve HTTP.

In 2012, HTTP 2.0 proposals started and its specification finalized on May, 2015 by Internet Engineering Task Force (IETF).

Now its Usage is at 6.5% (http://w3techs.com/technologies/details/ce-http2/all/all)As usual, all supporting developments happen in Parallel

All Major Browser already Support HTTP 2 (http://caniuse.com/#feat=http2)

Page 4: Http 2

In Short HTTP/2 - Key differences to HTTP/1.x

HTTP/2:is binary, instead of textual

is fully multiplexed, instead of ordered and blockingcan therefore use one connection for parallelism

uses header compression to reduce overheadallows servers to “push” responses proactively into client caches

Page 5: Http 2

Problems of Internet Application 8 Fallacies of Distributed/Networked Computing

1. Network is Reliable2. Latency is Zero3. Bandwidth is infinite4. Network is Secure5. Topology does not change6. There is one Administrator7. Transport Cost is Zero8. Network is Homogeneous

Essentially everyone when they first build a Distributed/Networked Application makes the following assumptions, all prove to be false in Long Run, all causes Big trouble and painful learning Experiences

Which one of this is a big Problem that HTTP can address Appropriately?

Page 6: Http 2

Here is more to analyseHTTP usage Trends

Visit - http://httparchive.org/http://www.internetlivestats.com/internet-users/

You can check for the problems that should be addressed based on statistics.

Page 7: Http 2

http://www.internetlivestats.com/internet-users/

Page 8: Http 2
Page 9: Http 2

http://www.nngroup.com/articles/law-of-bandwidth/

Page 10: Http 2

The Big Problem is LatencyBandwidthIn computing, bandwidth is the bit-rate of available or consumed information capacity expressed typically in metric multiples of bits per second. Variously, bandwidth may be characterized as network bandwidth, data bandwidth, or digital bandwidth.

LatencyLatency is a time interval between the stimulation and response, or, from a more general point of view, as a time delay between the cause and the effect of some physical change in the system being observed.

Page 11: Http 2

Despite Increase in Bandwidth, Latency remains as problem

Page 12: Http 2

What Work Arounds we did with HTTP/1.1?

• Warm Up• Spriting• Inlining• Sharding• Caching• Concatenation of Resources

Page 13: Http 2

What is Warm Up?

Page 14: Http 2
Page 15: Http 2
Page 16: Http 2
Page 17: Http 2
Page 18: Http 2
Page 19: Http 2
Page 20: Http 2
Page 21: Http 2
Page 22: Http 2
Page 23: Http 2
Page 24: Http 2
Page 25: Http 2

SpritingMany images into a sheet, chop with css.

Page 26: Http 2
Page 27: Http 2

HTTP/2 Addresses Latency problem and provides a way to avoid work arounds

done for Latency Problems

Page 28: Http 2

HTTP 2.0 Features

• Maintains HTTP paradigms• Multiplexed Streams• Compressed Headers• Server Push

Page 29: Http 2

HTTP Changes

Page 30: Http 2
Page 31: Http 2
Page 32: Http 2
Page 33: Http 2
Page 34: Http 2

Proper Multiplexing

• Allows interleaving of different requests and responses• Bidirectional• Each frame has a unique identifier• Eliminates head-of-line blocking• Single connection for parallel processing

Page 35: Http 2

Priorities

• Defines Priorities of different Streams• Each Stream has a weight and dependencies

Page 36: Http 2

Header Compression

• Uses HPACK• Huffman code for encoding headers• An index table is maintained between client

and server• CRIME prevented use of zlib

Page 37: Http 2

Flow Control

• Multiplexing requires the ability of Flow Control

Page 38: Http 2

Server Push

• Replaces in lining of resources• Allows for caching• Allows for cancellation of client

Page 39: Http 2

HTTP/2: Java• No changes required to your WARs• Existing web applications work out-of-the-box• Push functionalities provided by servers and frameworks• Possible action: remove old HTTP/1.1 hacks• HTTP/2 compliant servers require JDK 8

– Due to the fact that HTTP/2 requires strong ciphers– Server-to-Server clear text may run on JDK 7

• Servlet 4.0 will support HTTP/2– Backwards compatible– Few new API changes– New HTTP Push API

• JEP 110 (http://openjdk.java.net/jeps/110)– HTTP/2 Client proposal for JDK 9– HTTP/2 Client API proposed

• In the Java World:– Jetty (server + client) – Live @ https://webtide.com– Netty– Undertow– Ok Http (Android)