perf: avoid sending a redundant max-size probe when restarting PMTUD #2298
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.
Problem
Currently, when
update_probe_sizedetects an inconsistency (wherefailed_probe_size <= successful_probe_size) and callsrestart_pmtud(), theprobe_sizeis reset tomaximum_supported_mtu.This behavior causes the next probe to be sent at
maximum_supported_mtuimmediately 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.