Speaking as a network engineer, UDP has the following advantages:
- Eliminates head-of-line blocking
- Can avoid retransmission of stale data when messages are dropped
These are both micro-optimizations over TCP, and there is presently no evidence either of these are bottlenecks in Tendermint.
UDP has the following disadvantages:
- Decongestion: where TCP provides built-in decongestion, decongestion with UDP is generally solved by userspace decongestion algorithms, which are tricky to get right and take years to develop. There are off-the-shelf solutions for UDP decongestion like DCCP, however performance results with DCCP vary wildly: sometimes it can provide performance improvements over TCP or UDP w\ userspace congestion, and other times it’s slower than TCP. It really depends on the particular problem and the particular DCCP stack.
- Transport encryption with UDP is significantly more difficult. Replay defense in a datagram-oriented protocols requires explicit nonces and a sliding window protocol rather than a simple, implicit, incrementing nonce. DTLS is almost universally reviled for these reasons.
The arguments being made in this post are grossly overstated hyperbole which completely overlook the practical considerations. The Tendermint team has other priorities besides micro-optimizing the performance of the network layer. Given that, TCP is a perfectly reasonable starting place, and should significantly reduce the amount of work needed to actually ship a working MVP.
I think UDP and DCCP as alternative transports are worth investigating, but will be difficult and time consuming, and probably don’t make sense to investigate until after the Cosmos mainnet is live.