Skip to content

TCP 和 UDP 的区别 #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Yolo-0317 opened this issue May 22, 2021 · 0 comments
Open

TCP 和 UDP 的区别 #35

Yolo-0317 opened this issue May 22, 2021 · 0 comments

Comments

@Yolo-0317
Copy link
Owner

  1. TCP 是面向连接的,udp 是无连接的即发送数据前不需要先建立链接
  2. TCP 提供可靠的服务。也就是说,通过 TCP 连接传送的数据,无差错,不丢失, 不重复,且按序到达;UDP 尽最大努力交付,即不保证可靠交付。 并且因为 tcp 可靠, 面向连接,不会丢失数据因此适合大数据量的交换。
  3. TCP 是面向字节流;UDP 面向报文,并且网络出现拥塞不会使得发送速率降低(因 此会出现丢包,对实时的应用比如 IP 电话和视频会议等)。
  4. TCP 只能是 1 对 1 的,UDP 支持 1 对 1、1 对多。
  5. TCP 的首部较大为 20 字节,而 UDP 只有 8 字节
  6. TCP 是面向连接的可靠性传输,而 UDP 是不可靠的。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant