Alex Rivera | Logout

Why Does RTP use UDP instead of TCP?

Asked 2008-12-12T05:07:50.440
37

I wanted to know why UDP is used in RTP rather than TCP?

Major VoIP tools used only UDP as I hacked some of the VoIP OSS.

Edit
Report

1 Answer

17

The others are correct, however the don't really tell you the REAL reason why. Saua kind of hints at it, but here's a more complete answer.

Audio and Video is real-time. If you are listening to a radio, or watching TV, and the signal is interrupted, it doesn't pick up where you left off.. you're just "observing" the signal as it streams, and if you can't observe it at any given time, you lose it.

The reason, is simple. Delay. VOIP tries very hard to minimize the amount of delay from the time someone speaks into one end and you get it on your end, and your response back. Otherwise, as errors occured, the amount of delay between when the person spoke and when the signal was received would continuously grow until it became useless.

Remember, each delay from a retransmission has to be replayed, and that causes further data to be delayed, then another error causes an even greater delay. The only workable solution is to simply drop any data that can't be displayed in real-time.

A 1 second delay from retransmission would mean it would now be 1 second from the time I said something until you heard it. A second 1 second delay now means it's 2 seconds from the time i say something until you hear it. This is cumulative because data is played back at the same rate at which it is spoken, and so on...

RTP could be connection oriented, but then it would have to drop (or skip) data to keep up with retransmission errors anyways, so why bother with the extra overhead?

answered 2009-02-19T00:42:24.423

Your Answer