pub struct MtuConfig {
pub initial_mtu: u16,
pub min_mtu: u16,
pub discovery_enabled: bool,
pub max_mtu: u16,
pub auto_pqc_adjustment: bool,
}Expand description
MTU (Maximum Transmission Unit) configuration
Controls packet sizing for optimal network performance. Post-quantum cryptography requires larger packets due to bigger key sizes:
- ML-KEM-768: 1,184 byte public key + 1,088 byte ciphertext
- ML-DSA-65: 1,952 byte public key + 3,309 byte signature
The default configuration enables MTU discovery which automatically finds the optimal packet size for the network path.
Fields§
§initial_mtu: u16Initial MTU to use before discovery (default: 1200)
Must be at least 1200 bytes per QUIC specification. For PQC-enabled connections, consider using 1500+ if network allows.
min_mtu: u16Minimum MTU that must always work (default: 1200)
The connection will fall back to this if larger packets are lost.
Must not exceed initial_mtu.
discovery_enabled: boolEnable path MTU discovery (default: true)
When enabled, the connection probes for larger packet sizes to optimize throughput. Disable for constrained networks.
max_mtu: u16Upper bound for MTU discovery probing (default: 1452)
For PQC connections, consider higher values (up to 4096) if the network path supports jumbo frames.
auto_pqc_adjustment: boolAutomatically adjust MTU for PQC handshakes (default: true)
When enabled, the connection will use larger MTU settings during PQC handshakes to accommodate large key exchanges.
Implementations§
Source§impl MtuConfig
impl MtuConfig
Sourcepub fn pqc_optimized() -> Self
pub fn pqc_optimized() -> Self
Configuration optimized for PQC (larger MTUs)
Sourcepub fn constrained() -> Self
pub fn constrained() -> Self
Configuration for constrained networks (no discovery)
Sourcepub fn jumbo_frames() -> Self
pub fn jumbo_frames() -> Self
Configuration for high-bandwidth networks with jumbo frames