fragglet / ipxbox

Standalone DOSbox IPX-over-UDP server
GNU General Public License v2.0
69 stars 6 forks source link

Rewrite Quake reliable streams to conform to lower MTU #7

Closed fragglet closed 3 years ago

fragglet commented 3 years ago

DOS Quake currently fails to connect to a lot of netquake servers because of MTU issues. More specifically it fails to connect to servers based on FitzQuake (such as QuakeSpasm).

Datagram_SendMessage and Datagram_GetMessage in net_dgrm.c hold some clues to a solution to this problem. It's related to how the reliable message stream works in the Quake protocol.

Quake's maximum message size (NET_MAXMESSAGE) is ~8KiB which is larger than the maximum datagram size (MAX_DATAGRAM). The datagram code fragments large messages across multiple packets, with the last packet having the special NETFLAG_EOM flag set to indicate that it is the last packet. However, MAX_DATAGRAM was changed in FitzQuake from 1024 bytes to 1450. This is larger than the largest datagram that vanilla Quake can receive, so it cannot connect to such servers.

We should probably send a patch to the Quakespasm devs to fix this, but ipxbox can also do some passthrough fixups of the protocol by splitting large packets in a way that keeps them below the MTU.