nquic_protocol_migration (nquic v1.0.0)

View Source

Connection migration and PMTUD for the QUIC protocol state.

Pure functions over #conn_state{} covering RFC 9000 Section 9 (connection migration: peer-address update, path validation outcome, preferred-address handoff) and RFC 8899 (Packetisation Layer Path MTU Discovery: probe acknowledgement, loss, and black-hole reaction). Extracted from nquic_protocol as part of REVIEW_PLAN.md Phase 4.4.

External side effects are limited to delegating into nquic_path, nquic_pmtud, nquic_loss, nquic_socket, and nquic_protocol_cid. PATH_CHALLENGE frames produced during preferred-address migration are queued through nquic_protocol_send_queues:queue_app_frame/2.

Summary

Functions

Enable PMTUD on the connection. Starts probe search.

Handle preferred address migration (RFC 9000 Section 9.6). Installs the CID from the preferred_address transport parameter at sequence 1, selects the matching address family, and initiates path validation by queuing a PATH_CHALLENGE frame. Returns the updated state and a path validation timeout action.

Called on black hole detection. Reverts to BASE_PLPMTU.

Called when a PMTUD probe was acknowledged. Updates MTU if search progresses.

Called when a PMTUD probe was lost.

Functions

apply_peer_update/2

check_migration_allowed/1

-spec check_migration_allowed(nquic_protocol:state()) -> ok | {error, nquic_error:any_reason()}.

complete_migration/1

-spec complete_migration(nquic_protocol:state()) ->
                            {ok, nquic_protocol:state()} | {error, no_available_cids}.

enable_pmtud/1

-spec enable_pmtud(nquic_protocol:state()) -> nquic_protocol:state().

Enable PMTUD on the connection. Starts probe search.

handle_preferred_address/2

Handle preferred address migration (RFC 9000 Section 9.6). Installs the CID from the preferred_address transport parameter at sequence 1, selects the matching address family, and initiates path validation by queuing a PATH_CHALLENGE frame. Returns the updated state and a path validation timeout action.

maybe_detect_black_hole/1

-spec maybe_detect_black_hole(nquic_protocol:state()) -> nquic_protocol:state().

pmtud_on_black_hole/1

-spec pmtud_on_black_hole(nquic_protocol:state()) -> nquic_protocol:state().

Called on black hole detection. Reverts to BASE_PLPMTU.

pmtud_on_probe_acked/1

-spec pmtud_on_probe_acked(nquic_protocol:state()) -> nquic_protocol:state().

Called when a PMTUD probe was acknowledged. Updates MTU if search progresses.

pmtud_on_probe_lost/1

-spec pmtud_on_probe_lost(nquic_protocol:state()) -> nquic_protocol:state().

Called when a PMTUD probe was lost.

revert_migration/1

-spec revert_migration(nquic_protocol:state()) -> nquic_protocol:state().

select_preferred_peer/2