Fix rare connectivity issues by switching to the minimal IPv4 MTU.

progress towards #819
This commit is contained in:
IntegratedQuantum 2024-12-08 20:12:45 +01:00
parent 24004ef5a5
commit 0f754c44a0

View File

@ -1199,7 +1199,7 @@ pub const Protocols = struct {
pub const Connection = struct { // MARK: Connection
const maxPacketSize: u32 = 65507; // max udp packet size
const importantHeaderSize: u32 = 5;
const maxImportantPacketSize: u32 = 1500 - 14 - 20 - 8; // Ethernet MTU minus Ethernet header minus IP header minus udp header
const maxImportantPacketSize: u32 = 576 - 20 - 8; // IPv4 MTU minus IP header minus udp header
const headerOverhead = 20 + 8 + 42; // IP Header + UDP Header + Ethernet header/footer
const congestionControl_historySize = 16;
const congestionControl_historyMask = congestionControl_historySize - 1;