In a job interview i had faced a question that
In my company we always use udp because it is very much fast. and we have reliability also. can u answer how? without adding so much overhead to the udp how can you make udp reliable?
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.Sign up to join this community
While UDP is not reliable, a lot of protocols use it as a base and add reliability at application level.
You would determine what features you would need, and what you would implement:
Sometimes you will only need a few traits and not all. Although if you use all features, refrain of building it yourself: TCP will cramp this all in only a few extra header bytes and some handshaking packets ;)
One way could be to use Reliable UDP(RUDP or RDP). The idea is, the sender sends all packets as normal UDP packets and the receiver indexes all the packets. Once all the packets are transmitted, the receiver sends a lists of packet indexes that it did not receive. This can make UDP reliable.
Although this method will work, it challenges the core idea of UDP, i.e some data loss is acceptable. Like for example, while watching a movie (on a streaming service which uses UDP at transport level) we wouldn’t want the lost packets back after we’ve already watched the movie.
But it may be useful in other areas.