TCP和UDP区别详解
来源:互联网 发布:mysql 时间格式化 编辑:程序博客网 时间:2024/06/06 02:25
TCP与UDP区别
TCP---传输控制协议,提供的是面向连接、可靠的字节流服务。当客户和服务器彼此交换数据前,必须先在双方之间建立一个TCP连接,之后才能传输数据。TCP提供超时重发,丢弃重复数据,检验数据,流量控制等功能,保证数据能从一端传到另一端。
UDP---用户数据报协议,是一个简单的面向数据报的运输层协议。UDP不提供可靠性,它只是把应用程序传给IP层的数据报发送出去,但是并不能保证它们能到达目的地。由于UDP在传输数据报前不用在客户和服务器之间建立一个连接,且没有超时重发等机制,故而传输速度很快
Overview
TCP (Transmission Control Protocol) is the most commonly usedprotocol on the Internet. The reason for this is because TCP offerserror correction. When the TCP protocol is used there is a"guaranteed delivery." This is due largely in part to a methodcalled "flow control." Flow control determines when data needs tobe re-sent, and stops the flow of data until previous packets aresuccessfully transferred. This works because if a packet of data issent, a collision may occur. When this happens, the clientre-requests the packet from the server until the whole packet iscomplete and is identical to its original.
UDP (User Datagram Protocol) is anther commonly used protocol onthe Internet. However, UDP is never used to send important datasuch as webpages, database information, etc; UDP is commonly usedfor streaming audio and video. Streaming media such as WindowsMedia audio files (.WMA) , Real Player (.RM), and others use UDPbecause it offers speed! The reason UDP is faster than TCP isbecause there is no form of flow control or error correction. Thedata sent over the Internet is affected by collisions, and errorswill be present. Remember that UDP is onlyconcerned with speed. This is the main reason why streaming mediais not high quality.
On the contrary, UDP has been implemented among some trojan horseviruses. Hackers develop scripts and trojans to run over UDP inorder to mask their activities. UDP packets are also used in DoS(Denial of Service) attacks. It is important to know the differencebetween TCP port 80 and UDP port 80. If you don't know what portsare go here.
Frame Structure
As data moves along a network, various attributes are added tothe file to create aframe. This process is calledencapsulation. There are different methods ofencapsulation depending on which protocol andtopology are being used. As a result, theframe structure of these packets differ as well. The images belowshow both the TCP and UDP frame structures.
TCP FRAME STRUCTURE
UDP FRAME STRUCTURE
The payload field contains the actually data. Notice thatTCP has a more complex frame structure. This is largely due to thefact the TCP is a connection-oriented protocol. The extra fieldsare need to ensure the "guaranteed delivery" offered by TCP.
UDP
TCP
TCP与UDP的选择
- TCP和UDP区别详解
- TCP 和 UDP详解与其区别
- TCP和UDP的区别详解
- TCP和UDP区别
- TCP和UDP区别
- TCP和UDP区别
- TCP和UDP区别
- TCP和UDP区别
- TCP和UDP区别
- TCP和UDP区别?
- TCP和UDP区别
- Tcp和Udp区别
- TCP 和 UDP 区别
- TCP和UDP区别
- TCP和UDP区别
- TCP和UDP区别
- TCP和UDP区别
- TCP和UDP区别
- erlang中的元组与列表的区别与联系
- 图论-最小生成树(MST)算法
- 性能测试工具-说明文档收集
- TCP与UDP的区别
- android 源码下载
- TCP和UDP区别详解
- querySelector & querySelectorAll --- 像CSS一样选择DOM
- 浅谈VC编写Modbus模拟通讯设备
- struts1标签
- WF中的持久化服务
- 谷歌Chrome浏览器的Mac主题 OS theme
- 维护考试系统有感
- HTTP协议详解
- opencv基本数据类型