ddn.net.dtls.pmtud
Path MTU Discovery for DTLS (RFC 8899 PLPMTUD).
Implements Packetization Layer Path MTU Discovery to dynamically discover the optimal path MTU for each peer. Uses probe packets of increasing size to detect the maximum transmission unit without relying on ICMP messages.
The PLPMTUD state machine (RFC 8899 §5):
DISABLED → BASE (start probing at MIN_PROBE_SIZE) BASE → SEARCHING (binary search between min and max) SEARCHING → COMPLETE (found optimal MTU) SEARCHING → BASE (probe lost, reduce MTU) COMPLETE → SEARCHING (periodic re-probe)
Thread safety: NOT thread-safe. All access must be serialized by the owning DtlsEngine.
Types 4
PLPMTUD state machine states (RFC 8899 §5).
Per-peer PLPMTUD state.
Tracks the current MTU probe state for a single remote endpoint. The engine creates one instance per connected peer when PLPMTUD is enabled.
DatagramEndpoint peerPmtudState statesize_t probeSizesize_t confirmedMtusize_t minMtusize_t maxMtusize_t probeSuccessCountsize_t probeAttemptCountMonoTime lastProbeSentsize_t searchMinsize_t searchMaxResult of a PMTU probe check.
PLPMTUD engine for DTLS.
Manages per-peer MTU discovery state and determines when to send probe packets and at what size. The engine calls checkProbe() for each peer periodically and sends probe packets when indicated.
bool enabled_Duration probeTimeout_size_t minProbeSize_size_t maxProbeSize_size_t requiredSuccesses_size_t maxAttempts_PmtudPeerState createPeerState(DatagramEndpoint peer, size_t baseMtu) @safe pure nothrow @nogcCreates initial PMTU state for a new peer.PmtudProbeResult checkProbe(ref PmtudPeerState state, MonoTime now) @safe pure nothrow @nogcChecks if a probe should be sent for the given peer.bool recordProbeSuccess(ref PmtudPeerState state) @safe pure nothrow @nogcRecords a successful probe acknowledgment.size_t recordProbeFailure(ref PmtudPeerState state) @safe pure nothrow @nogcRecords a probe failure (timeout).size_t effectiveMtu(ref const PmtudPeerState state) const @safe pure nothrow @nogcReturns the effective MTU for a peer.void resetPeerState(ref PmtudPeerState state, size_t baseMtu) @safe pure nothrow @nogcResets a peer's PMTU state (e.g., after path change).this(Duration probeTimeout = dur!"msecs"(DtlsPmtud.PROBE_TIMEOUT_MS),
size_t minProbeSize = DtlsPmtud.MIN_PROBE_SIZE,
size_t maxProbeSize = DtlsPmtud.MAX_PROBE_SIZE,
size_t requiredSuccesses = DtlsPmtud.PROBE_COUNT,
size_t maxAttempts = DtlsPmtud.MAX_PROBE_ATTEMPTS)Constructs a PLPMTUD engine with configurable parameters.