Should probably also add that for media stream UDP is almost exclusively
used.

This is because you typically send video or audio data over the media
stream. Such data is not so important that you get all data. If you miss
a millisecond of the other party breathing or miss a frame of the other
party it is more important that you send up-to-date data of what is
happening now. Thus, in some situations it makes sense to skip data
packets or drop them if they arrive late and rather just render packets
that come in within a reasonable time. Thus, you might skip one frame
but overall the other party do not mind that a frame is skipped as long
as he receive the frames in a timely fashion. If you have a long pause
just to get a packet that was somehow lost and retransmitted and then
got lagging behind it is generally considered worse than simply skipping
a lost packet and rendering packets that do come in in the right order.
You can sort some packets but only if they come within a certain
reasonable time (without too much delay).

Contrast this with things like file transfer etc where each packet is
very important and if you get packets 1, 2, 3, 5, 6, 7, 8, 9, 10, etc
you do not save any of the packets 5 and higher until after you have
received packet 4 and saved it and only then save the packets 5, 6 etc.

In media streams you will probably just forget about packet 4 after a
while and just render the packets given.

Since TCP insist on never giving you data out of sequence while UDP
allow you to receive data out of sequence and thus drop packets that are
too late, UDP is by far the preferred method for media streams
containing video and audio.

Alf

On Tue, 2006-10-03 at 20:34 +0800, Man-Chi Leung wrote:
> hi all,
> 
> I would like to compare/ evaluate the pros and cons on implementing SIP 
>  based on UDP or TCP.
> 
> I do have a bit of confusion on the advantages and disadvantages for 
> UDP and TCP in SIP signalling aspect.
> 
> primaryly, my solution is very much based on UDP, which I believe is 
> commonly used in SIP.
> 
> can anyone give me advice?
> 
> --------------------------------
> SIP signalling Channel
> --------------------------------
> UDP :
> - possibly NAT traveral when both UAs are behind NAT
> - easier to manage UDP connection?
> 
> TCP
> - unable to do NAT traveral without relay when both UAs are behind NAT?
> - harder to manage TCP connection for SIP proxy?
> 
> ---------------------
> Media Channel
> ---------------------
> UDP:
> - streaming audio/video for media channel
> 
> TCP:
> - file transfer
> 
> 
> ~manchi
> 
> 
> _______________________________________________
> Sip-implementors mailing list
> [email protected]
> https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors

_______________________________________________
Sip-implementors mailing list
[email protected]
https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors

Reply via email to