Unit 5: Networking 2 5.1 Networking 2 TCP and UDP

mac2022-06-30  19

ABOUT THIS VIDEO

Computers will use Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) to encapsulate data, depending on how that data is going to be used.

计算机将使用传输控制协议(TCP)或用户数据报协议(UDP)来封装数据,这取决于如何使用这些数据。

After watching the video, learn more about TCP and UDP in the TCP/IP Guide:
TCP Overview, Functions and Characteristics
TCP Overview, History and StandardsTCP Functions: What TCP DoesTCP Characteristics: How TCP Does What It Does

观看视频后,在TCP/IP指南中了解更多关于TCP和UDP的信息:

TCP概述,功能和特点

TCP概述、历史和标准

TCP功能:TCP的功能

TCP特性:TCP如何实现它的功能

 

TCP Fundamentals and General Operation
TCP Data Handling and Processing: Streams, Segments and Sequence NumbersTCP Sliding Window Acknowledgment System For Data Transport, Reliability and Flow ControlTCP Ports, Connections and Connection IdentificationTCP Common Applications and Server Port Assignments

TCP基本原理和一般操作

TCP数据处理:流、段和序列号

用于数据传输、可靠性和流量控制的TCP滑动窗口确认系统

TCP端口、连接和连接标识

TCP通用应用程序和服务器端口分配

 

TCP/IP User Datagram Protocol (UDP)
UDP Overview, History and StandardsUDP OperationUDP Message FormatUDP Common Applications and Server Port Assignments

 

TCP/IP用户数据报协议(UDP)

UDP概述、历史和标准

UDP操作

UDP消息格式

UDP通用应用程序和服务器端口分配

 

>> One of two protocols will be used at layer four of the OSI modelto encapsulate the data coming from layers five, six, and seven.

>>两种协议中的一种将用于OSI模型的第4层,以封装来自第5层、第6层和第7层的数据。

 

TCP, Transmission Control Protocol segments, or UDP, User Datagram Protocol Datagrams,will be selected by an application that's sending data.

发送数据的应用程序将选择TCP(传输控制协议段)或UDP(用户数据报协议数据报)。

 

TCP establishes a connection between the source and destination devicesfor reliable data transfer and flow control, sending data at an acceptable rate,both to the source and destination.

TCP在源设备和目标设备之间建立连接,用于可靠的数据传输和流控制,以可接受的速率向源设备和目标设备发送数据。

 

UDP is connectionless and has no flow control.

UDP是无连接的,没有流控制。

 

All bytes sent with TCP are ordered and sequenced.

TCP发送的所有字节都是有序的。

 

TCP guarantees that every single byte sent will be received with integrityand processed in the correct order.

TCP保证发送的每个字节都将完整地接收并以正确的顺序处理。

 

So actually there are in fact three things that are guaranteed in life; death, taxes, and TCP.

所以实际上生活中有三件事是有保障的;死亡,税收和TCP。

 

TCP segments are acknowledged so the sender knows the destination got the traffic.

TCP段被确认,因此发送方知道目的地获得了流量。

 

If an acknowledgement specifically referencing byte numbersof the data sent doesn't come back TCP resends the unacknowledged bytes; UDP doesn't do this.

如果特定引用发送数据的字节数的确认没有返回,TCP将重新发送未确认的字节;UDP不会这样做。

 

So which one is better?Well it depends.

那么哪个更好呢?

这取决于。

 

TCP is used for things like file transfers, email, and going on websites.

TCP用于文件传输、电子邮件和网站访问等。

 

In those cases accuracy is important.

在这些情况下,准确性很重要。

 

If bytes are lost or corrupted the whole message could be destroyed.

如果字节丢失或损坏,则可以销毁整个消息。

 

UDP is used for real time communications; conferencing and streaming.

UDP用于实时通信;会议和流。

 

Furthermore, two major protocols coming up in a future module, DNS and DHCP, both use UDP.

此外,在未来的模块中出现的两个主要协议,DNS和DHCP,都使用UDP。

 

If every byte sent needed to be acknowledged on a VoIP callover the web there could be problems with lost acknowledgements.

如果发送的每个字节都需要在web上的VoIP调用中得到确认,那么可能会出现确认丢失的问题。

 

TCP on the source would think the destination didn't get the messageand would resend it again.

源上的TCP会认为目的地没有收到消息,并会重新发送它。

 

So the destination would hear hello and send its acknowledgement back to the source.

因此目的地将听到hello并将其确认发送回源。

 

Let's say that the acknowledgement got lost; the destination would hear the subsequent wordsfrom the voice call that were already sent by the source, how are you doing today,but then the source would send hello back again.

假设这个认知丢失了;目的地将听到来自已由源发送的语音呼叫的后续单词“how are you doing today”,但随后源将再次发送hello。

 

That would be a very frustrating phone call;you'd have the past coming back into the current conversation.

那将会是一个非常令人沮丧的电话;你会把过去的事情带回当前的谈话中。

 

You'd have to imagine though that all audio and video, real time and streaming over the internetin UDP datagrams still has to be ordered to ensure their processed in the correct order.

你必须想象,所有的音频和视频,实时和在互联网上的UDP数据报流仍然必须被排序,以确保它们的处理顺序是正确的。

 

RTSP, real time streaming protocol which exists at layer seven, does the ordering for UDP.

RTSP是存在于第7层的实时流协议,它对UDP进行排序。

 

Using RTSP just for the orderingof the UDP datagrams involves significantly less overhead than TCP would require.

仅将RTSP用于UDP数据报的排序所涉及的开销要比TCP所需的开销少得多。

 

If TCP was used a connection would have to be established and maintained,flow control would need to be added, and acknowledgements would need to be sent.

如果使用TCP,则必须建立和维护连接,需要添加流控制,并且需要发送确认。

 

The communication could slow down based on these and other factors.

基于这些和其他因素,交流可能会变慢。

 

With UDP if bytes are lost we don't care; they're just a fleeting moment in time.

使用UDP,如果字节丢失,我们不在乎;它们只是时间的飞逝。

 

You might not even notice.

你可能根本没注意到。

 

One might notice a slight degradation in image quality or sound quality,but even if that's the case we just accept it instead of slowing down the entire communicationfor the additional overhead that TCP requires.

您可能会注意到图像质量或声音质量稍有下降,但即使出现这种情况,我们也会接受它,而不是因为TCP需要的额外开销而减慢整个通信。

 

TCP has much more overhead than UDPand is deliberately slower striving for accuracy and integrity.

TCP的开销要比UDP大得多,而且在追求准确性和完整性方面的速度要慢得多。

 

UDP has no overhead and is quicker, striving for efficiency.

UDP没有开销,速度更快,追求效率。

 

When querying your DNS server to resolve a name to an IP address or your DHCP server to getor renew a lease for an IP address if no reply comes backto the client your client will simply ask again.

当查询您的DNS服务器以解决IP地址或您的DHCP服务器的名称以获得或更新用于IP地址的租赁时,如果没有回复,您的客户将会简单地再次请求。

 

There's no need for additional overhead.

不需要额外的开销。

转载于:https://www.cnblogs.com/sec875/articles/10358034.html

最新回复(0)