Socket support for TCP_QUICKACK · Issue #798 · dotnet/runtime (original) (raw)

AB#1117049
System.Net.Sockets.Socket currently implements cross platform support for a large number of manually configurable socket options. We allow many TCP specific options, but do not support the standard TCP_QUICKACK option that is supported in both Windows and Unix.

Rationale and Usage

Nagles algorithm and TCP delayed ack are both used to solve similar problems around network congestion. Both are often enabled by default, but the interactions between them can cause extreme and unnecessary latency. For more information see this blog on MSDN, or this SD comment by John Nagle.

By enabling support for TCP_QUICKACK, we allow performance oriented developers to choose how to balance network congestion and latency.

The new option would be set via the standard SetSocketOption API. As the option is already supported natively on all supported platforms, the changes required would be very minimal.

Proposed API

namespace System.Net.Sockets { // Defines socket option names for the class. public enum SocketOptionName { #region SocketOptionLevel.Tcp TcpQuickAck = 12, #endregion } }

[[API proposal added above by @rmkerr. Original issue below]]

Original Proposal

I'm not sure if Windows support this at socket level as Linux does. But delayed ack does not works well when the remote endpoint is using Nagle Algorithm (TCP_NODELAY = false).

Reference: https://blogs.technet.microsoft.com/nettracer/2013/01/05/tcp-delayed-ack-combined-with-nagle-algorithm-can-badly-impact-communication-performance/