Add fast retransmit of lost packets and packet redundancy - #75
Draft
11EJDE11 wants to merge 4 commits into
Draft
Conversation
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
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.
Vanilla recalculates its retransmit timeout as
RetryDelta = Response_Time() + 10. The problem is thatResponse_Time()is measured from ACKs, including ACKs for retransmitted packets. If a packet is lost, its ACK arrives later than normal, increasingResponse_Time(). That increasesRetryDelta, which delays the next retransmission, causing the timeout to grow even further.This PR addresses the problem in two ways:
FastRetransmitmaintains a separate per-connection RTT estimate using Karn's algorithm, which ignores RTT samples from retransmitted packets. This keeps the estimate from being skewed by packet loss. It only reduces the globalRetryDelta; it never increases it. An optionalRetransmitBackoffslightly increases the timeout for repeated retries of the same packet to avoid excessive retransmissions.PacketRedundancysends reliable command packets twice, allowing a single lost packet to be recovered from the duplicate without waiting for a retransmission.AdaptiveRedundancy(enabled by default) only sends duplicates to peers that have recently experienced packet loss, reducing unnecessary bandwidth.Before (no fixes):
2026-08-05.15-52-14.mp4
After:
2026-08-05.15-49-40.mp4
Draft until: Phobos-developers/YRpp#75