Summary
A stream-oriented Socket
, or NetworkChannel
, should be able to
enable the TCP_QUICKACK
socket option on platforms that support it.
Problem
The TCP_QUICKACK
socket option can be used to reduce or disable
delayed acknowledgments (ACKs). Delayed ACKs ( the default in the TCP
stack ) help in most common scenarios, but if the ACKs are tiny and
don't use much bandwidth then Delayed ACK is not of much help, and in
fact, when used in combination with Nagle's algorithm, can cause stalls
on TCP segments of between 200-500ms that could otherwise be sent
immediately and delivered to the receive-side.
The TCP_QUICKACK
socket option can be used to mitigate against the
aforementioned issue. It is likely to be used by application code when
Delayed ACKs have been diagnosed, at the network level, as causing
unwanted latency between client and server.
Solution
Add a JDK-specific socket option that supports setting TCP_QUICKACK
,
on platforms that support it. This is similar to SO_FLOW
that already
exists. The option can be enabled/disabled through the existing
set/getOption
methods on Socket
and NetworkChannel
.
Specification
To jdk.net.ExtendedSocketOptions
, in the jdk.net
module, add the following new socket option:
/**
* Disable Delayed Acknowledgements.
*
* <p> This socket option can be used to reduce or disable delayed
* acknowledgments (ACKs). When {@code TCP_QUICKACK} is enabled, ACKs are
* sent immediately, rather than delayed if needed in accordance to normal
* TCP operation. This option is not permanent, it only enables a switch to
* or from {@code TCP_QUICKACK} mode. Subsequent operations of the TCP
* protocol will once again disable/enable {@code TCP_QUICKACK} mode
* depending on internal protocol processing and factors such as delayed ACK
* timeouts occurring and data transfer, therefore this option needs to be
* set with {@code setOption} after each operation of TCP on a given socket.
*
* <p> The value of this socket option is a {@code Boolean} that represents
* whether the option is enabled or disabled. The socket option is specific
* to stream-oriented sockets using the TCP/IP protocol. The exact semantics
* of this socket option are socket type and system dependent.
*
* @since 10
*/
public static final SocketOption<Boolean> TCP_QUICKACK =
new ExtSocketOption<Boolean>("TCP_QUICKACK", Boolean.class);
- csr of
-
JDK-8145635 Add TCP_QUICKACK socket option
-
- Resolved
-