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

Reset retransmit timer on ack regardless of the current timer state #953

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HKalbasi
Copy link
Contributor

As I explained in #949 (comment) in the current state if you have a link with limited bandwidth and high latency, timer state becomes Timer::Retransmit and won't become Timer::Idle since there is always some packets in the flight, and current code prevents the delay to be updated, so there would be an unnecessary retransmission which drops the bandwidth. After this PR, I'm able to utilize the full bandwidth of a link with high latency.

This PR doesn't completely fix the issue I mentioned above, there is still some problems when the middle switch drops packets, but it makes things much better.

@HKalbasi
Copy link
Contributor Author

@Dirbaio @whitequark sorry for the ping. Can you please review this? I need to make sure this is in the correct path in order to be able to investigate more on #949

@whitequark
Copy link
Contributor

@HKalbasi Sorry, I don't fully understand the description of this PR. I believe the retransmit code was originally written according to one or more of the TCP RFCs linked in the header. Could you please investigate which RFCs require this behavior (or whether the behavior never matched them in first place), link to the relevant portions of the documents, and explain how the changes correspond to them? Thanks!

@HKalbasi
Copy link
Contributor Author

Sure! The rfc6298 says:

When an ACK is received that acknowledges new data, restart the retransmission timer so that it will expire after RTO seconds (for the current value of RTO).

But the code in the set_for_retransmit method prevents the timer being restarted if it is already active and in the Timer::Retransmit state. We may want to also change where we call the set_for_retransmit function, but this patch works for me in terms of preventing unnecessary retransmission which drops the bandwidth.

@Dirbaio
Copy link
Member

Dirbaio commented Sep 10, 2024

Fix looks good to me.

Can you add a test for it? i.e. a test that would previously fail and now works with your fix.

@whitequark
Copy link
Contributor

Sure! The rfc6298 says:

When an ACK is received that acknowledges new data, restart the retransmission timer so that it will expire after RTO seconds (for the current value of RTO).

Thanks. Please add the RFC to the top of tcp.rs next to other RFC references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants