Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does voip use udp? 3

Status
Not open for further replies.

jouell

MIS
Nov 19, 2002
304
US
And not tcp? I would think you'd want tcp so you don't lose
pieces of the converstion, and so all sentences arrive in an orderly fashion.

Thoughts?
 
By the time you could retransmit a packet, that part of the phone call is over and the next packet is already being used, so it will not add much unless you are hoping to save a complete record of the call for later. VoIP wants a very short latency, so the lower CPU overhead of UDP speeds every packet out of the NIC.

I tried to remain child-like, all I acheived was childish.
 
There's a lot of connection setup time with TCP that UDP doesn't have. Also, TCP has overhead for acknowledging each and every packet sent. Also, TCP has a pacing/throttling mechanism that will actually slow down the pace of transmission to fit the bandwidth available.

This means TCP just can't keep up with the flow.

UDP on the other hand just does a spray-and-pray to get the packets there. Yes, some packets may get lost, but that only results in tiny drops and maybe static, but you can still understand the conversation. The human mind can deal with small gaps in sound and video.

So, the reason is purely for performance. UDP can handle real time sound, TCP can't.

Hope this helps.
 
These are great answers to my question!

Thanks to both of you. So how does a converstion arrive in a an orderly fashion?

I.E.

"Hi Sambones and jimbopalmer, nice to see you both"

versus

"to see, Sambones and you both jimbopalmer Hi nice "

etc?

 
The packets have a sequence number. But those aren't used to reorder them, it's used to know which ones to throw away.

In other words, if I've played packets 1, 2, 4, and 5, then 3 shows up, I toss packet 3 and go on.

So it might come out...

"Hi SamBons nd jimbopalmer, nic o see you both"

It has ommissions, but you still understand it.
 
Since the packets are sent in order, and are most likely taking the same path, you're more likely to lose a packet than to have one beat the other to the destination.
 
Ok, I know UDP packets don't have a sequence number, tcp does and it identifies the sequential postion in the data stream.

So what determines the order of a sentence when I use VOIP?

I found the answer:



.... UDP has no control over the order in which packets arrive at the destination or how long it takes them to get there (datagram concept). Both of these are very important to overall voice quality (how well you can understand what the other person is saying) and conversation quality (how easy it is to carry out a conversation). RTP solves the problem enabling the receiver to put the packets back into the correct order and not wait too long for packets that have either lost their way or are taking too long to arrive (we don't need every single voice packet, but we need a continuous flow of many of them and ordered).
 
Sorry about that. UDP doesn't have a sequence number, but RTP does. Real-time Transport Protocol (RTP) is the protocol that VoiP uses. RTP is carried by UDP. The RTP headers have both a sequence number and a time stamp to know if that mouthfull of bits is here on time and in order.
 
Also, keep in mind that each voice packet only contains 10-30 milliseconds of audio. A missing packet here or there is likely to go unnoticed, especially since much of the conversation is silence. As others have pointed out, RTP takes care of packets getting out of order.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top