microsoft / microsoft/demikernel

[inetstack] Delayed ACKs Considered Harmful

Open
#192 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
1.2k
Forks
151
PR merge metrics
No merged PRs in 30d

Description

There is a well-known undesirable interaction between TCP's "delayed ACK" mechanism and Nagle's Algorithm that can cause unnecessary delays in request-response protocols. (Basically, a sender with a small amount of data to send will wait until all previously sent data is ACK'd, while the receiver will wait to ACK until the timer goes off or it receives a second packet). As a result, many TCP implementations contain a mechanism (usually a socket option) to turn one or both of these off (e.g. TCP_QUICKACK and/or TCP_NODELAY). While the ability to turn off Nagle's Algorithm was the original work-around, Nagle himself argues that delayed ACKs do more harm than his algorithm, and that they should be turned off (but Nagle might be biased :-)).

We currently implement delayed ACKs, but not Nagle. We don't currently implement a mechanism to turn delayed ACKs off.

Since we have fine-grained cooperative scheduling between our stack and the application, we might want to revisit how we implement delayed ACKs. The whole idea of the timeout is to give the application time to respond to the received data, so we can "piggyback" the ACK on that response. But if the application calls wait w/o sending, we're just wasting time if we're waiting for the delayed ACK timer to expire to send the ACK.

Bottom line: We could probably replace the delayed ACK timer with a simple flag (and remove another "watched" variable).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the inetstack implementation of delayed ACKs and the associated delayed ACK timer and "watched" variable. Determine how cooperative waits and application responses currently trigger ACKs; done means replacing the timer with a flag while preserving ACK behavior, including when the application waits without sending.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.