tcp和udp协议的相似_比较TCP与UDP协议,区别和相似之处

tcp和udp协议的相似

tcp和udp协议的相似

Networks are used to transmit data over the world. There is a lot of network protocols in use. But most known and used protocols are IP, TCP, UDP. IP lives different flat but TCP and UDP try to live the same flat. So they operate the same network layer but what is different between UDP and TCP. Why should I use TCP or not use? The same questions can be asked for UDP too. In this post, we will look at what is the same and different for these protocols. TCP stands for Transmission Control Protocol. UDP stands for User Datagram Protocol

网络用于在世界范围内传输数据。 有许多网络协议正在使用中。 但是,最知名和使用的协议是IP,TCP,UDP。 IP生活在不同的公寓中,但TCP和UDP尝试居住在同一公寓中。 因此,它们使用相同的网络层,但是UDP和TCP之间的区别是什么。 为什么要使用TCP或不使用TCP? 对于UDP也可以询问相同的问题。 在本文中,我们将探讨这些协议的相同点和不同点。 TCP代表传输控制协议。 UDP代表用户数据报协议

OSI网络层(OSI Network Layer)

They both live the same Layer according to the OSI Reference Model. We call this layer as Transmission Layer. In this layer between sockets, data is transmitted. They have no difference in this side.

根据OSI参考模型,它们都位于同一层。 我们将此层称为传输层。 在套接字之间的这一层中,传输数据。 他们在这方面没有区别。

封包结构 (Packet Structure)

UDP
UDP
UDP协议

UDP has a lean package structure. UDP provides just Source, Destination Port, Length, Checksum in its header part.

UDP具有精益包结构。 UDP在其标头部分仅提供源,目标端口,长度,校验和。

TCP
TCP
TCP协议

TCP has more fields in the package because TCP transmission has more steps and controls for package delivery. TCP has 12 header fields.

TCP在程序包中包含更多字段,因为TCP传输具有更多程序包传递步骤和控件。 TCP具有12个标头字段。

复杂 (Complexity)

TCP is absolutely more complex than UDP protocol. As we see in the upper side TCP have a lot of area for transmission-related mechanisms. For example, TCP provides the mechanism of a window which sets transmission buffer related memory. UDP has just checksum mechanism and packet counter which is sometimes not implemented.

TCP绝对比UDP协议复杂。 正如我们在上侧所看到的,TCP具有许多与传输相关的机制。 例如,TCP提供了设置传输缓冲区相关内存的窗口机制。 UDP只是具有校验和机制和数据包计数器,有时无法实现。

算法 (Algorithm)

To transmit data with TCP a session must be created with a method named 3-way handshake. The first client sends a packet with the SYN flag is set and the server responds with ACK flags and the last step the client sends SYNC+ACK to accomplish a TCP session with the related server. UDP does not have any special algorithm. UDP packages are directly sent to the server’s port. Management did generally in the upper application layer.

要使用TCP传输数据,必须使用名为3向握手的方法创建会话。 第一个客户端发送设置了SYN标志的数据包,服务器使用ACK标志进行响应,最后一步,客户端发送SYNC + ACK以完成与相关服务器的TCP会话。 UDP没有任何特殊算法。 UDP包直接发送到服务器的端口。 管理通常在上层应用程序层进行。

LEARN MORE  Linux fuser Command Tutorial With Examples
了解更多Linux融合器命令教程和示例

速度(Speed)

The complexity of TCP protocol makes TCP slower than UDP. At least to send just a single byte there needs to be a session initialization and after data transfer closes the session. This makes TCP slower. There is some work done about the speed of  TCP but the architecture is limited new enhancements. UDP is lightfast if you transmit it over fiber optic;).UDP is fast because there are no algorithms for session or session termination.

TCP协议的复杂性使TCP比UDP慢。 至少要仅发送一个字节,就需要进行会话初始化,并且在数据传输关闭会话之后。 这会使TCP变慢。 关于TCP的速度已经完成了一些工作,但是该体系结构在新的增强功能方面受到限制。 如果通过光纤传输UDP,则UDP很快;)。UDP很快,因为没有用于会话或会话终止的算法。

可靠性 (Reliability)

TCP is a reliable protocol because it runs mechanisms to prevent data loss or change. TCP uses sessions to make data transmission reliability. Also in the data transfer, transmitted data is checked by between sides, and if some loss or change occurred data is re-transmitted again. UDP is nor reliable. Really it is not. But if you want it to be reliable upper layer application-level mechanisms can be implemented but these will make the transmission more complex.

TCP是一种可靠的协议,因为它运行防止数据丢失或更改的机制。 TCP使用会话来确保数据传输的可靠性。 同样在数据传输中,通过双方之间检查发送的数据,并且如果发生某些丢失或更改,则再次重新发送数据。 UDP也不可靠。 真的不是。 但是,如果您希望它可靠,则可以实施上层应用程序级机制,但这会使传输更加复杂。

安全 (Security)

From the security point of view, both TCP and UDP are the same. Actually, TCP has some little advantages because of its session management but for a general look, there are both secure if security mechanisms like SSL, Encryption is implemented. Implementing SSL/TLS like protocols for TCP is very easy besides UDP. On the other side, voice communication protocols like RTP can be upgraded to the SRTP to make underlying UDP more secure.

从安全角度来看,TCP和UDP都是相同的。 实际上,由于会话管理,TCP几乎没有什么优势,但是从总体上看,如果实现了SSL,加密等安全机制,则两者都是安全的。 除了UDP之外,为TCP实现类似SSL / TLS的协议也非常容易。 另一方面,可以将语音通信协议(如RTP)升级到SRTP,以使基础UDP更安全。

规约 (Protocols)

In this part, we will list protocols using UDP or TCP or both.

在这一部分中,我们将列出使用UDP或TCP或两者的协议。

UDP协议 (UDP)

The following protocols are using UDP transmission.

以下协议正在使用UDP传输。

  • DHCP

    DHCP服务器
  • DNS

    域名解析
  • Streaming

    流媒体
  • RDP

    RDP
  • TFTP

    TFTP
  • SNMP

    SNMP协议
  • VOIP

    网络电话
LEARN MORE  How To Get Mac Address In Windows?
了解更多如何在Windows中获取Mac地址?

TCP协议 (TCP)

The following protocols are using TCP transmission.

以下协议正在使用TCP传输。

  • HTTP

    HTTP
  • HTTPS

    HTTPS
  • FTP

    的FTP
  • SMTP

    SMTP
  • TELNET

    电信网

翻译自: https://www.poftut.com/compare-tcp-vs-udp-protocols-differences-and-similarities/

tcp和udp协议的相似

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值