HTTP/2 configuration
-
The HTTP/2 functionality is supported on NetScaler MPX, VPX, and SDX.
-
The HTTP/2 functionality is not supported on NetScaler Gateway.
| HTTP/2 features | Description |
|---|---|
| Header Compression | HTTP headers have much 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 | Server push enables the server to proactively push content to the client browser, avoiding round-trip delay. This feature caches the responses that it thinks the client needs, 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. |
| Request Prioritization | Not all resources have equal priority when the browser renders a webpage. 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 use 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. |
How HTTP/2 works
HTTP/2 for HTTPS (SSL) load balancing configuration
-
HTTP/2 (if enabled in the HTTP profile)
-
HTTP/1.1
HTTP/2 for HTTP load balancing configuration
-
HTTP/2 Upgrade. A client sends an HTTP/1.1 request to a server. The request includes an upgrade header, which asks the server to upgrade the connection to HTTP/2. If the server supports HTTP/2, the server accepts the upgrade request and notifies it in its response. The client and the server start communicating using HTTP/2 after the client receives the upgrade confirmation response.
-
Direct HTTP/2. A client directly starts communicating to a server in HTTP/2 instead of using the HTTP/2 upgrade method. If the server does not support HTTP/2 or is not configured to directly accept HTTP/2 requests, it drops the HTTP/2 packets from the client. This method is helpful if the admin of the client device already knows that the server supports HTTP/2.
-
Direct HTTP/2 using Alternative Service (ALT-SVC). A server advertises that it supports HTTP/2 to a client by including an Alternative Service (ALT-SVC) field in its HTTP/1.1 response. If the client is configured to understand the ALT-SVC field, the client and the server start directly communicating using HTTP/2 after the client receives the response.
Before you Begin
-
The NetScaler appliance supports HTTP/2 on the client side as well on the server side.
-
The NetScaler appliance does not support the HTTP/2 server push functionality.
-
The NetScaler appliance does not support the HTTP/2 request prioritization functionality.
-
The NetScaler appliance does not support HTTP/2 SSL renegotiation for HTTPS load balancing setups.
-
The NetScaler appliance does not support HTTP/2 NTLM authentication.
-
With HTTP/2 enabled, connection multiplexing disabled (like USIP enabled) and one to one mapping of client and server TCP connections, close events such as FIN, reset (RST) are forwarded from the client or server connection to the linked peer connection.
Configuring HTTP/2
-
Enable HTTP/2 and set optional HTTP/2 parameters in an HTTP Profile. Enable HTTP/2 in an HTTP profile. When you only enable HTTP/2 in an HTTP profile, the NetScaler appliance uses only the upgrade method (for HTTP) or TLS ALPN method (for HTTPS) for communicating in HTTP/2.For the NetScaler appliance to use the direct HTTP/2 method, the Direct HTTP/2 option must be enabled in the HTTP profile. For the NetScaler appliance to use the direct HTTP/2 using the alternative service method, the Alternative Service (altsvc) option must be enabled in the HTTP profile.
-
Bind the HTTP profile to a virtual server or a service. Bind the HTTP profile to a virtual server to configure HTTP/2 for the client side of the load balancing setup. Bind the HTTP profile to a service to configure HTTP2 for the server side of the load balancing setup.
-
Enable the global parameter for HTTP/2 server side support. Enable the HTTP/2 Service Side (HTTP2Serverside) global HTTP parameter for enabling the HTTP/2 support on the server side of all the load balancing setups that has HTTP/2 configured.HTTP/2 does not work on the server side of any load balancing setups if HTTP/2 Service Side is disabled even if the HTTP/2 is enabled on the HTTP profile bound to the related load balancing services.
-
To enable HTTP/2 and set HTTP/2 parameters while adding an HTTP profile, at the command prompt, type:
add ns httpProfile <name> - http2 ( ENABLED | DISABLED ) [-http2Direct ( ENABLED | DISABLED )] [-altsvc ( ENABLED | DISABLED )] show ns httpProfile <name>
-
To enable HTTP/2 and set HTTP/2 parameters while modifying an HTTP profile, at the command prompt, type:
set ns httpProfile <name> -http2 ( ENABLED | DISABLED ) [-http2Direct ( ENABLED | DISABLED)] [-altsvc (ENABLED | DISABLED )] show ns httpProfile <name>
set lb vserver <name> - httpProfileName <string> show lb vserver <name>
set service <name> -httpProfileName <string> show service <name>
set ns httpParam -HTTP2Serverside( ENABLED | DISABLED ) show ns httpParam
-
Navigate to System > Profiles, and click the HTTP Profiles tab.
-
Enable HTTP/2 while adding an HTTP profile or modifying an existing HTTP profile.
-
Navigate to Traffic Management > Load Balancing > Virtual Servers, and open the virtual server.
-
In Advanced Settings, click + HTTP Profile to bind the created HTTP profile to the virtual server.
-
Navigate to Traffic Management > Load Balancing > Service, and open the service.
-
In Advanced Settings, click + HTTP Profile to bind the created HTTP profile to the service.
Sample configurations
set ns httpProfile HTTP-PROFILE-HTTP2-CLIENT-SIDE -http2 enabled -http2Direct enabled
Done
set lb vserver LB-VS-1 -httpProfileName HTTP-PROFILE-HTTP2-CLIENT-SIDE
Done
set ns httpparam -HTTP2Serverside ENABLED
Done
set ns httpProfile HTTP-PROFILE-HTTP2-SERVER-SIDE -http2 ENABLED -altsvc ENABLED
Done
set service LB-SERVICE-1 -httpProfileName HTTP-PROFILE-HTTP2-SERVER-SIDE
Done
Configure HTTP/2 initial connection window size
-
Using the
SETTINGSframe for the stream. -
Using the
WINDOW_UPDATEframe for the connection.
http2InitialWindowSize parameter to set the initial window size at the stream level. Because of an internal system error, the ADC appliance initializes the flow-control window for the connection also. When there is a change in the configured flow-control window for the stream, the ADC appliance communicates to the peer using the SETTINGS frame. But the ADC appliance fails to communicate the change in flow-control window for the connection using the WINDOW_UPDATE frame. This leads to a connection freeze.
http2InitialConnWindowSize parameter (in bytes) is now added to control the flow-control window for connection. By using separate configurable parameters, you can now enable the appliance to send updates for changed window size at both stream and connection levels.
Configure the HTTP/2 initial connection window size parameter by using the CLI
set http profile p1 -http2InitialConnWindowSize 8290
Initial window size for stream level flow control, in bytes.
Default value: 65535
Minimum value: 8192
Maximum value: 20971520
TCP Dynamic Receive Buffering parameter in the TCP profile.
WebSocket over HTTP/2 configuration
Configure the WebSocket connections over HTTP/2 by using the CLI
add httpprofile <http_profile_name> -http2 enabled -websocket enabled
add httpprofile <http_profile_name> -http2 enabled -http2direct enabled -websocket enabled
add httpprofile <http_profile_name> -http2 enabled
set httpparam -http2serverside ON
add httpprofile <http_profile_name> -http2 enabled -http2direct enabled
set httpparam -http2serverside ON
Configure the WebSocket connections over HTTP/2 by using the GUI
-
Navigate to System>Profiles>HTTP Profiles.
-
Select the required profile from the Profiles and click Edit.
-
In the Configure HTTP Profile, enable HTTP2 or DirectHTTP2 checkboxes.
-
Enable the WebSocket connections by selecting the Enable WebSocket connections checkbox.
-
Navigate to System>Profiles>HTTP Profiles.
-
You can add a new HTTP2 profile by clicking Add.
-
In the Create HTTP Profile, enable HTTP2 or DirectHTTP2 checkboxes.
-
Select the Enable WebSocket Connections checkbox.
Enable the Extended CONNECT mechanism in HTTP/2 for WebSocket support
Enable or disable the Extended CONNECT mechanism in HTTP/2 by using the CLI
set ns httpProfile <http-profile-name> [-http2ExtendedConnect ( ENABLED | DISABLED )]
set httpprofile nshttp_default_profile -http2extendedConnect ENABLED
unset httpprofile nshttp_default_profile -http2extendedConnect
show httpprofile <HTTP-profile-name>| grep "CONNECT mechanism
show httpprofile nshttp_default_profile | grep "CONNECT mechanism"
HTTP/2 Extended CONNECT mechanism: ENABLED
-
If the result is ENABLED, the Extended Connect feature is ON, and WebSocket over HTTP/2 is supported.
-
If the result is DISABLED, the Extended Connect feature is OFF, and WebSocket over HTTP/2 is not supported.
set httpprofile <http-profile-name> -websocket enabled.
Enable an extended CONNECT mechanism in HTTP/2 by using the GUI
-
Navigate to System > Profiles > HTTP Profiles.
-
Select the required profile from the Profiles and click Edit.
-
In the Configure HTTP Profile page under the HTTP/2 section, select the HTTP/2 Extended Connect checkbox.
| HTTP packet version | WebSocket parameter | HTTP2 Extended CONNECT parameter | Request action | Back-end HTTP/1.1 | Back-end HTTP/2 |
|---|---|---|---|---|---|
| HTTP/1.1 | Disabled | N/A | dropped | NA | NA |
| HTTP/1.1 | Enabled | N/A | HTTP/1.1 | Each HTTP/1.1 connection is mapped to a dedicated HTTP/1.1 connection on the back end | Dedicated HTTP/2 connection on the back end for each HTTP/1.1 connection |
| HTTP/2 | Enabled | Enabled | HTTP/2 | Each stream on the front end is mapped to a dedicated HTTP/1.1 connection | All front end streams can be mapped to a single HTTP/2 connection or a maximum of three HTTP/2 connections on the back end. |
| HTTP/2 | Disabled | Disabled | dropped | NA | NA |
| HTTP/2 | Disabled | Enabled | dropped | NA | NA |
| HTTP/2 | Enabled | Disabled | dropped | NA | NA |
| HTTP packet version | WebSocket parameter | HTTP2 Extended Connect parameter | Request action | Back-end HTTP/1.1 | Back-end HTTP/2 |
|---|---|---|---|---|---|
| HTTP/1.1 | Disabled | N/A | dropped | NA | NA |
| HTTP/1.1 | Enabled | N/A | HTTP/1.1 | Each HTTP/1.1 connection is mapped to a dedicated HTTP/1.1 connection on the back end | Multiple Http/1.1 clients can be multiplexed to a single HTTP/2 connection or multiple HTTP/2 connections |
| HTTP/2 | Enabled | Enabled | HTTP/2 | Each stream on the front end is mapped to a dedicated HTTP/1.1 connection | All front end streams can be mapped to a single HTTP/2 connection or multiple HTTP/2 connections on the back end |
| HTTP/2 | Disabled | Enabled | dropped | NA | NA |
| HTTP/2 | Disabled | Disabled | dropped | NA | NA |
| HTTP/2 | Enabled | Disabled | dropped | NA | NA |