Skip to content

Add fast retransmit of lost packets and packet redundancy - #75

Draft
11EJDE11 wants to merge 4 commits into
CnCNet:mainfrom
11EJDE11:fast-retransmit-redundancy
Draft

Add fast retransmit of lost packets and packet redundancy#75
11EJDE11 wants to merge 4 commits into
CnCNet:mainfrom
11EJDE11:fast-retransmit-redundancy

Conversation

@11EJDE11

@11EJDE11 11EJDE11 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Vanilla recalculates its retransmit timeout as RetryDelta = Response_Time() + 10. The problem is that Response_Time() is measured from ACKs, including ACKs for retransmitted packets. If a packet is lost, its ACK arrives later than normal, increasing Response_Time(). That increases RetryDelta, which delays the next retransmission, causing the timeout to grow even further.

This PR addresses the problem in two ways:

  • FastRetransmit maintains 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 global RetryDelta; it never increases it. An optional RetransmitBackoff slightly increases the timeout for repeated retries of the same packet to avoid excessive retransmissions.

  • PacketRedundancy sends 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.

Metric Baseline FastRetransmit (no backoff) FastRetransmit (backoff, default) PacketRedundancy (no adaptive) PacketRedundancy (adaptive, default)
Effective sim-FPS 11.6-12.6 43.6-51.2 43.8-44.7 42.0-43.1 45.5-48.6
Stall time 73-76% 11.8-23.5% 21.7-23.4% 24.5-26.3% 15.3-17.2%

Before (no fixes):

2026-08-05.15-52-14.mp4

After:

2026-08-05.15-49-40.mp4

Draft until: Phobos-developers/YRpp#75

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant