本文共 2424 字,大约阅读时间需要 8 分钟。
tcp协议
TCP means Transfer Control Protocol, and it’s the basis of the Web and other applications like Email.
TCP表示传输控制协议 ,它是Web和其他应用程序(如电子邮件)的基础。
Defined in in 1981, TCP is one of the oldest pillars of the Internet.
TCP在1981年的中定义,是Internet上最古老的Struts之一。
TCP sits on top of the Internet Protocol (IP) and builds a base system upon which application-level protocols like HTTP, FTP, IMAP and many others.
TCP位于Internet协议(IP)之上,并构建了一个基础系统,基于该系统的应用程序级协议如HTTP,FTP,IMAP和许多其他协议。
TCP, contrary to IP and UDP, is connection oriented.
与IP和UDP相反,TCP是面向连接的 。
Before transmission can happen over TCP, a connection must be established. Data is sent, in form of little packets, and when the communication ends the connection is closed.
必须先建立连接,然后才能通过TCP进行传输。 数据以小包的形式发送,当通信结束时,连接关闭。
When data is transmitted over TCP, there’s a relatively complex workflow called handshake that must happen.
当数据通过TCP传输时,必须进行一个称为握手的相对复杂的工作流程。
I will not go into the details here, but this handshake allows the end-to-end connection to happen, and this makes sure TCP can provide one of its peculiar features: reliability. Using TCP, we can always know if a packet the sender sent was received correctly by the receiver.
我不会在这里详细介绍,但是这种握手可以实现端到端的连接,并且可以确保TCP可以提供其独特的功能之一:可靠性。 使用TCP,我们总是可以知道发送方发送的数据包是否被接收方正确接收。
If a packet gets lost, the protocol is able to handle it and the packet is re-sent.
如果数据包丢失,则协议可以对其进行处理,然后重新发送该数据包。
On the IP protocol, connections happen from computer to computer. In TCP, a connection happens form process to process, using a the concept of ports.
在IP协议上,计算机之间建立连接。 在TCP中,使用端口的概念在过程之间进行连接。
The port, associated to an IP address, allows to uniquely identify a process on a computer. Like this:
与IP地址关联的端口允许唯一地标识计算机上的进程。 像这样:
localhost:8080
localhost:8080
or
要么
google.com:1234
google.com:1234
Each application protocol has a default port. For example HTTP has 80, HTTPS has 443 and FTP has 21. This is why you don’t usually have to specify the port, in the browser.
每个应用程序协议都有一个默认端口。 例如,HTTP具有80,HTTPS具有443,FTP具有21。这就是为什么您通常不必在浏览器中指定端口的原因。
Programs are not required to use the default, this is why especially on your local computer, you might see ports like 1313 or 8080 when you start a new application.
程序不需要使用默认值,这就是为什么特别是在本地计算机上,启动新应用程序时可能会看到端口1313或8080。
Port numbers range from 1 to 65535 (the port number is a 16 bits unsigned, which corresponds to 2^16 possible values).
端口号的范围是1到65535(端口号是16位无符号的,对应于2 ^ 16个可能的值)。
翻译自:
tcp协议
转载地址:http://xomgb.baihongyu.com/