为什么 RTP 使用 UDP 而不是 TCP? [英] Why Does RTP use UDP instead of TCP?

查看:28
本文介绍了为什么 RTP 使用 UDP 而不是 TCP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么在 RTP 中使用 UDP 而不是 TCP?主要的 VoIP 工具只使用 UDP,因为我入侵了一些 VoIP OSS.

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.

推荐答案

正如 DJ 所指出的,TCP 是为了获得可靠的数据流,并且会减慢传输速度,并重新传输损坏的数据包,以实现这一目标.

As DJ pointed out, TCP is about getting a reliable data stream, and will slow down transmission, and re-transmit corrupted packets, in order to achieve that.

UDP 不关心通信的可靠性,不会减慢或重传数据.

UDP does not care about reliability of the communication, and will not slow down or re-transmit data.

如果您的应用程序需要可靠的数据流,例如从网络服务器检索文件,则选择 TCP.

If your application needs a reliable data stream, for example, to retrieve a file from a webserver, you choose TCP.

如果您的应用程序不关心损坏或丢失的数据包,并且您不需要产生额外的开销来提供额外的可靠性,那么您可以选择 UDP.

If your application doesn't care about corrupted or lost packets, and you don't need to incur the additional overhead to provide the additional reliability, you can choose UDP instead.

可靠的数据包传输并没有显着改善 VOIP,事实上,在某些情况下,TCP 中的重传和指数退避等事情实际上会损害 VOIP 质量.因此,UDP 是更好的选择.

VOIP is not significantly improved by reliable packet transmission, and in fact, in some cases things in TCP like retransmission and exponential backoff can actually hurt VOIP quality. Therefore, UDP was a better choice.

这篇关于为什么 RTP 使用 UDP 而不是 TCP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆