Skip to content

[inetstack] Delayed ACK #421

@carvalhof

Description

@carvalhof

Description

When the Demikernel receives a data packet, Demikernel calls the do_receive function (https://github.com/demikernel/demikernel/blob/dev/src/rust/inetstack/mod.rs#L614) to process it through the network stacks, including TCP (https://github.com/demikernel/demikernel/blob/dev/src/rust/inetstack/protocols/tcp/established/ctrlblk.rs#L385). TCP stack sets should_schedule_ack flag to indicate to ACK the packet.

As the Demikernel implements Delayed ACK, it uses the ack_deadline variable (WatchedValue type) of the ControlBlock structure to signal Delayed ACKs for TCP. This variable is set (to None) at the emit function (https://github.com/demikernel/demikernel/blob/dev/src/rust/inetstack/protocols/tcp/established/ctrlblk.rs#L856) when the TCP stack sends a segment (triggered by a push or by an ACK from the TCP logic).

However, when the Demikernel receives more than one packet at a time (batch.len() > 1), the receive function of the TCP is called more than once (if the packets are TCP, of course). In this case, from the second packet, the ack_deadline variable is not set to None by the emit function (not called), and the TCP stack proceeds to else (https://github.com/demikernel/demikernel/blob/dev/src/rust/inetstack/protocols/tcp/established/ctrlblk.rs#L757), sending an ACK, even if ack_delay_timeout is not elapsed.

How to Reproduce

Steps to reproduce the behavior:

  1. Run the Demikernel as a server, using the tcp-ping-pong application, for instance;
  2. Use a TCP generator as a client to send TCP packets continuously (e.g., an open-loop generator).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions