Message Chunking
At the moment, messages are put into a single UDP packet. This is causing problems because too large UDP packets are dropped by network devices. To prevent this, we should split too large messages into multiple UDP packets.
When sending a message, it should be checked whether the message exceeds a configured size (in bytes). If this is the case, the message should be fragmented and the fragments sent individually.
When a fragment is received, the receiver should keep it temporarily and wait for the remaining fragments to be received. It should not matter in which order the fragments are received. If not all fragments are available after a configurable time, the previously received fragments are discarded.
This should be done transparently to the application.
Open for discussion
- Define the maximum size of a single message
- Define a good timeout for receive of missing fragments
- Define a maximum number of fragments/total chunked message size?