- Configuring HTTP/2 on the NetScaler Appliance
Note: The HTTP/2 functionality is supported on the NetScaler MPX, VPX, and SDX models. For NetScaler VPX, the HTTP/2 functionality is supported from 11.0 release onwards.
The HTTP/2 protocol addresses these limitations by allowing communication to occur with less data transmitted over the network, and providing the ability to send multiple requests and responses across a single connection. At its core, HTTP/2 addresses the key limitations of HTTP/1.1 by using the underlying network connections more efficiently. It changes the way requests and responses travel over the network.
HTTP/2 is a binary protocol. It is more efficient to parse, more compact on the wire, and most importantly, it is less error-prone, compared to textual protocols like HTTP/1.1. The HTTP/2 protocol uses a binary framing layer that defines the frame type and how HTTP messages are encapsulated and transferred between the client and server.
The HTTP/2 protocol includes a lot of performance-enhancing changes that significantly improve performance, particularly for clients connecting over a mobile network.
The following table lists the major improvements in HTTP/2 over HTTP/1.1:
|Header Compression||HTTP headers have a lot of repetitive information and therefore consume unnecessary bandwidth during data transmission. HTTP/2 reduces bandwidth requirements by compressing the header and minimizing the requirement to transport HTTP headers with every request and response.|
|Connection Multiplexing||Latency can have a huge impact on page load times and the end user experience. Connection multiplexing overcomes this problem by sending multiple requests and responses across a single connection.|
Server push enables the server to proactively push content to the client browser, avoiding round trip delay. This feature caches the responses it thinks the client will need, reduces the number round trips, and improves the page rendering time.
Important: The NetScaler appliance does not support the server push functionality.
|No Head-of-line Blocking||Under HTTP/1.1, browsers can download one resource at a time per connection. When a browser has to download a large resource, it blocks all other resources from downloading until the first download is complete. HTTP/2 overcomes this problem with a multiplexing approach. It allows the client browser to download other web components in parallel over the same connection and display them as they become available.|
Not all resources have equal priority when the browser renders a web page. To accelerate the load time, all modern browsers prioritize requests by type of asset, their location on the page, and even by learned priority from previous visits.
With HTTP/1.1, the browser has limited ability to leverage the priority data, because this protocol does not support multiplexing, and there is no way to communicate request prioritization by the server. The result is unnecessary network latency. HTTP/2 overcomes this problem by allowing the browser to dispatch all requests. The browser can communicate its stream prioritization preference via stream dependencies and weights, enabling the servers to optimize response delivery.
Important: The NetScaler appliance does not support the request prioritization functionality.
A NetScaler appliance supports HTTP/2 connections with clients. It converts the HTTP/2 headers to HTTP/1.1 for communication with servers. When a service or virtual server associated with a profile configured for HTTP/2 receives a request from a client, the NetScaler appliance accumulates the HTTP/2 headers and decodes them to form HTTP/1.1 headers. After decoding the headers, the appliance validates the HTTP/1.1 headers and ensures that the data is intact. Once the validation is complete, the appliance forwards the HTTP/1.1 headers to the server.
When the appliance receives the response headers from the server, it converts all the HTTP/1.1 headers to HTTP/2 headers and sends them to the client.
Note: HTTP/2 over SSL through ALPN is supported only between HTTP/2 client and NetScaler and not from NetScaler to the back-end server. Also, for ALPN+HTTP/2 requests, the appliance acts as a gateway.
HTTP/2 over an SSL (HTTPS) virtual server
If the HTTP/2 setting is enabled on the HTTP profile associated with an HTTPS virtual server, the NetScaler appliance uses the TLS ALPN extension (RFC 7301) to determine whether the HTTP client supports HTTP/2. If it does, the appliance chooses HTTP/2 as the application-layer protocol to transmit data between the client and the server NetScaler appliance (as described in RFC 7540 - Section 3.3).
The appliance uses the following order of preference when choosing the application-layer protocol through the TLS ALPN extension:
HTTP/2 over an HTTP virtual server
If the HTTP/2 setting is enabled on the HTTP profile associated with the HTTP virtual server, the NetScaler appliance uses the HTTP protocol upgrade mechanism (as described in RFC 7540 - Section 3.2) to upgrade the connection to HTTP/2. The HTTP client requests a protocol upgrade and the appliance will upgrades the connection to HTTP/2.
Note: If the HTTP/2 setting is enabled on the HTTP profile associated with the virtual server, the NetScaler appliance does *NOT* support the direct use of HTTP/2, but still it acts as a TCP proxy by forwarding the HTTP/2 requests to servers.
The HTTP/2 feature is part of the HTTP configurations on the NetScaler appliance. By default, the HTTP/2 feature is disabled. You have to enable the feature on a specific HTTP profile and associate the HTTP profile with services or virtual servers on which you want to use the HTTP/2 feature.
To know more about binding a HTTP profile to a virtual server, see Setting Service or Virtual Server Specific HTTP Parameters section on HTTP Configuration page.
Note: The HTTP/2 functionality will not work, if User Source IP (USIP) mode is enabled and the Proxy mode is disabled on the NetScaler appliance.
To configure HTTP/2 by using the command line
At the command prompt, type:
set ns httpProfile <name> [-http2 ( ENABLED | DISABLED )] [-http2MaxHeaderListSize <positive_integer>] [-http2MaxFrameSize <positive_integer>] [-http2MaxConcurrentStreams <positive_integer>] [-http2InitialWindowSize <positive_integer>] [-http2HeaderTableSize <positive_integer>]
To configure HTTP/2 by using the configuration utility
Create a HTTP/2 profile on the NetScaler appliance. Navigate to System > Profiles, click HTTP Profiles and then click Add to create a HTTP profile with HTTP/2 checkbox selected.
Navigate to System > Profiles, select a HTTP Profile and click Edit to specify the maximum size of the header compression table in the HTTP/2 Header Table Size text box.
Navigate to System > Profiles, select a HTTP Profile and click Edit to specify initial window size for an HTTP/2 stream in the the HTTP/2 Initial Window Size text box.
Navigate to System > Profiles, select a HTTP Profile and click Edit to specify the maximum number of concurrent streams per connection in the HTTP/2 Maximum Concurrent Streams text box .
Navigate to System > Profiles, select a HTTP Profiles and click Edit to specify the maximum size of the frame in the HTTP/2 Maximum Frame Size text box.
Navigate to System > Profiles, select a HTTP Profiles and click Edit to specify the header size the Maximum Header List Size text box.