Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: tcp: Keep track of recv window size change since last ACK #76418

Merged

Conversation

rlubos
Copy link
Contributor

@rlubos rlubos commented Jul 29, 2024

Windows TCP stack has a peculiar behavior - when running iperf, it will fill out the RX window almost entirely, but will not set PSH flag on packets. In result, our stack would delay the ACK and thus window update, affecting throughputs heavily.

In order to avoid that, keep track of the most recent window size reported to the peer, and reduce it when receiving new data. In case the RX window, as seen from the peer perspective, drops below certain threshold, and the real RX window is currently empty, send an ACK immediately when updating window, so that peer can continue with sending data.

jukkar
jukkar previously approved these changes Jul 29, 2024
decsny
decsny previously approved these changes Jul 29, 2024
Copy link
Member

@decsny decsny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brings RT1060 download from windows up to 71 Mbps, not all the way back to what it was but at least 7/8 of the way back

@jacob-wienecke-nxp
Copy link
Contributor

jacob-wienecke-nxp commented Jul 29, 2024

Testing with this commit, performance out of the box on mimxrt1170-evk is worse than without the delay ack commit.

On main without delay ack commit I am seeing an average around 75Mbps

On main with the commit that is keeping track of recv window size change since last ACK I am seeing an average closer to 50Mbps

A better apples-to-apples comparison on this device is to move all code to ITCM.

On main without delay ack commit and ALL code in ITCM I am seeing an average around 85Mbps

On main with the commit that is keeping track of recv window size change since last ACK and ALL code in ITCM I am seeing an average around 89Mbps.

With the test of all code in ITCM, this new commit performs slightly better than main without the delay ack commit.

EDIT: I should mention that this is on my windows machine.

Windows TCP stack has a peculiar behavior - when running iperf, it will
fill out the RX window almost entirely, but will not set PSH flag on
packets. In result, our stack would delay the ACK and thus window
update, affecting throughputs heavily.

In order to avoid that, keep track of the most recent window size
reported to the peer, and reduce it when receiving new data. In case the
RX window, as seen from the peer perspective, drops below certain
threshold, and the real RX window is currently empty, send an ACK
immediately when updating window, so that peer can continue
with sending data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
@rlubos rlubos dismissed stale reviews from decsny and jukkar via 9260be2 July 30, 2024 11:40
@rlubos rlubos force-pushed the net/tcp-windows-no-psh-issue branch from 33c7b65 to 9260be2 Compare July 30, 2024 11:40
@carlescufi carlescufi merged commit 349bf81 into zephyrproject-rtos:main Jul 31, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking backport v3.7-branch Request backport to the v3.7-branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants