Once Again on TCP vs. UDP
ithare.comhttps://en.wikipedia.org/wiki/Reliable_User_Datagram_Protoco... is also a good protocol in this space.
Its been a decade since I worked with atou (Almost TCP over UDP) but it does work: http://www.csm.ornl.gov/~dunigan/net100/atou.html
An excellent read on how to implement reliable UDP by Craig is here: https://pdfs.semanticscholar.org/1d88/1d58d53ee530a4b4c7427a...
I tell people to start with UDT when trying to improve TCP or UDP:
Good chance they already did what you need. On supercomputers with a distributed filesystem (Sector/Sphere) at that. :)
Looks like UDT is well-suited for high bandwidth networks. I'll vouch for ENet for reliable UDP over low bandwidth networks.
Didnt know about that one.
Sadly no mention of SCTP, which, if you don't need to communicate with arbitrary hosts over the Internet, sits in a nice middleground between TCP and UDP.
SCTP tries to be the best of the two, and as such it feels "overengineered". But besides that, the main problem I see is that you can't communicate with arbitrary hosts. There is a SCTP implementation in the Linux kernel, besides the 'reference' one that is developped against FreeBSD. For OS X, you need to install a kernel extension and for Windows I don't really remember TBH.
Of course, you could use a userspace stack but you still have another problem: all the middleboxes between you can your destination. Anything that tries to be smart about your packets (NAT, proxies, younameit) may break your connectivity simply because it only understands TCP and UDP. I guess you could use UDP encapsulation but personally I'd start questioning whether picking SCTP as a transport protocol is worth all this trouble.
Most SCTP use (WebRTC) is UDP-encapsulated, needs no kernel support, and works just fine with NAT. The UDP encapsulation doesn't add any "trouble" compared to your own ad-hoc UDP-encapsulated protocol, but you still get the advantages of a properly engineered IETF designed standard protocol.
I wasn't aware WebRTC used SCTP. Good to know!
TCP and UDP aren't the perfect solutions [for everything] and there's no shortage of proposed alternatives to TCP; Besides already mentioned QUIC, there's CurveCP (https://curvecp.org/), MinimaLT (https://www.ethos-os.org/), or even more extreme Named Data Networking (http://named-data.net).
For a background on why TCP is this way, look up "The Design Philosophy of the DARPA Internet Protocols", by David D. Clark, however knowing is little comfort.