Skip to content

Conversation

@acid-chicken
Copy link

Problem

Currently, when update_probe_size detects an inconsistency (where failed_probe_size <= successful_probe_size) and calls restart_pmtud(), the probe_size is reset to maximum_supported_mtu.

This behavior causes the next probe to be sent at maximum_supported_mtu immediately after the restart. In scenarios where the path MTU has actually decreased (causing the inconsistency), this probe is highly likely to fail again, resulting in a wasted packet and an unnecessary RTT before the algorithm begins to search downwards.

Solution

This change records the failed probe size immediately after restarting PMTUD. By doing so, the next probe size is calculated based on the failure (searching downwards) instead of resetting to the maximum supported MTU. This avoids sending a probe that is known to likely fail.

Copilot AI review requested due to automatic review settings December 25, 2025 13:33
@acid-chicken acid-chicken requested a review from a team as a code owner December 25, 2025 13:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the Path MTU Discovery (PMTUD) algorithm to avoid sending a redundant probe at the maximum supported MTU when restarting PMTUD after detecting an inconsistency. When network conditions change and cause inconsistent probe results (failed probe size ≤ successful probe size), the algorithm now immediately records the failed probe size after restarting, causing the next probe to search downwards from the failure point rather than resetting to the maximum MTU.

Key changes:

  • Modified the inconsistency handling in update_probe_size() to call failed_probe() immediately after restart_pmtud(), ensuring the binary search starts from the known failure point
  • Added a test case to verify handling of changing network conditions during PMTUD

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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