Add TCP_QUICKACK socket option support#3
Draft
ryehuda-dn wants to merge 1 commit intofpopescu/rst_cont_readfrom
Draft
Add TCP_QUICKACK socket option support#3ryehuda-dn wants to merge 1 commit intofpopescu/rst_cont_readfrom
ryehuda-dn wants to merge 1 commit intofpopescu/rst_cont_readfrom
Conversation
Implements NN_TCP_QUICKACK option to allow users to request immediate
ACK transmission after receiving data, matching standard Linux socket
behavior.
This support is added to solve the TCP delays in nanoconnection
mentions in SW-217254 (Delayed ACKs causing 40ms delay for link down)
TCP_QUICKACK is a Linux-specific, one-shot option that forces the kernel
to send an acknowledgment immediately instead of using delayed ACKs. The
kernel automatically resets this flag after each receive operation, so
users must call nn_setsockopt() after each nn_recv() to trigger it.
Implementation details:
- Added NN_TCP_QUICKACK constant to tcp.h (value: 2)
- Extended nn_ep_ops with setopt function pointer for dynamic option
application on active connections
- Implemented two-level iteration:
* sock.c iterates through all endpoints on a socket
* btcp.c iterates through all accepted connections (atcp) within a
bind endpoint
* ctcp.c applies directly to its single outgoing connection
- Direct setsockopt() on active sockets (bypassing nn_usock_setsockopt
which only works on STARTING/ACCEPTED state)
- Added symbol registration for introspection
- Added test case in tests/tcp.c
- Documented in nn_tcp.adoc
Usage:
nn_recv(socket, buf, len, 0);
int opt = 1;
nn_setsockopt(socket, NN_TCP, NN_TCP_QUICKACK, &opt, sizeof(opt));
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements NN_TCP_QUICKACK option to allow users to request immediate ACK transmission after receiving data, matching standard Linux socket behavior.
This support is added to solve the TCP delays in nanoconnection mentions in SW-217254 (Delayed ACKs causing 40ms delay for link down)
TCP_QUICKACK is a Linux-specific, one-shot option that forces the kernel to send an acknowledgment immediately instead of using delayed ACKs. The kernel automatically resets this flag after each receive operation, so users must call nn_setsockopt() after each nn_recv() to trigger it.
Implementation details:
Usage:
nn_recv(socket, buf, len, 0); int opt = 1; nn_setsockopt(socket, NN_TCP, NN_TCP_QUICKACK, &opt, sizeof(opt));