Bug Tracker – Full Text Bug Listing

Bug 773

Summary: Verify packet integrity with CRC32
Product: Odamex Reporter: Dr. Sean <grandpachuck187>
Component: Server & ClientAssignee: Odamex Bug Reporter <odamex-bug-reporter>
Status: NEW ---    
Severity: enhancement CC: russell
Priority: P1    
Version: (old) 0.6-dev   
Hardware: All   
OS: All   
Attachments: Patch for r2714 that implements packet CRC32 checking

Description Dr. Sean 2012-01-12 06:03:19 UTC
Created attachment 329 [details]
Patch for r2714 that implements packet CRC32 checking

UDP provides a 16-bit checksum for verifying the integrity of a packet.  While this is relatively sufficient (only 1 in 65536 corrupted packets would be accepted), the UDP checksum is optional, which poses a greater problem.  If a client's TCP/IP stack does not use the checksum or (more likely) some router between the client and the server does not use the checksum, corrupted packets are not being detected.

While I am not sure of the impact this has for Odamex, other non-Doom games implement their own CRC32 check for each packet sent and received, dropping corrupted packets.  I have implemented this for Odamex and plan to test it in the near future with a few players I've come across who experience higher than normal network related bugs.  Hopefully this will allow me to gauge whether adding CRC32 checks to packets would be worth the extra 4-byte overhead per packet.
Comment 1 Russell Rice 2012-01-29 06:12:25 UTC
if other multiplayer games use this and what you say about the field being optional, I think its a must then

another thing is VLAs are a gcc extension, line 524 of i_net.cpp uses one which is msvc incompatible, if you can could you update the patch to use either alloca() or malloc/free combo instead?