5 ms·
It sounds like UDP packets that fit within the MTU work fine. If you need to transmit more than fits in one packet (1452 bytes), UDP is a bad choice. SCTP is i
by oofabz 11y ago
It sounds like UDP packets that fit within the MTU work fine. If you need to transmit more than fits in one packet (1452 bytes), UDP is a bad choice.
SCTP is ideal for this use case but it is not well supported by OSs or networking APIs. TCP works but adds overhead. TFTP works, is UDP-only and has less overhead than TCP, but it does not respond well to packet loss. UDT is like TFTP done right, and is a good solution if you can setup a dependency on its large C++ library.
- cbsmith 11y agoSCTP is a pretty good choice. It has been a bit since I used it, but it is a more complex protocol and I recall often run in to challenges getting it to perform as efficiently over various bits of network equipment. Last I checked UDT was far more complex than UDP, and since it is layered on top of UDP, I'd think it'd be vulnerable to this problem (although it had all kinds of logic for correctly sizing packets and windows, so maybe it correctly avoids this problem). Either way though, from an application perspective UDT looks much more like TCP than UDP, so I wouldn't think it'd be an obvious choice to replace UDP.
- addingnumbers 11y ago> If you need to transmit more than fits in one packet (1452 bytes) You must never make assumptions about what fits in one packet. The MTU could be 100, or less, or 8000, or more. As soon as you start doing math based on MTU values that you don't permanently have end-to-end control of yourself, you're setting yourself up for trouble.
- oofabz 11y agoThat's true, it's a bad idea to assume an MTU of 1500. Although there is no minimum MTU in IPv4, IPv6 specifies a minimum of 1280 bytes. So if you send your UDP packets over IPv6, you are guaranteed room for 1232 bytes of payload.