In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Transport layer Protocol: TCP Transport Control Protocol
UDP user Datagram Protocol
TCP connection-oriented, reliable process-to-process communication protocol
TCP provides full-duplex service, that is, data can be transmitted in both directions at the same time.
TCP message segment does not exceed 1500 bytes
TCP groups several bytes into a packet, called a message segment
TCP message segment is encapsulated in IP Datagram
TCP message segment header format
Source port number: the port number corresponding to the sender
Destination port number: corresponds to the process of the receiving end. After receiving the data segment, the receiving end determines which application process to send the data to according to this port number.
Serial number: the sender numbers each byte so that the receiver can reorganize
Confirmation number: used to confirm the message on the sender
Header length: it can be used to determine the byte length of the header data
Retention: not currently in use
Control bit: these six play a very important role. The connection, transmission and disconnection of TCP are all under the command of these six controls.
URG: emergency pointer valid bit. If 1 is on, 0 is off, and submit directly without caching.
PSH: quickly accept delivery application layer. You need to send a batch of message segments, such as cache, to the application layer directly.
SYN: request a connection
FIN: request to disconnect
ACK: confirm bit
RST: notifies you to reestablish a connection
Window size: used to indicate the number of locally acceptable segments. The window size is variable.
Checksum: used for error control
Emergency pointer: used with URG, valid when URG is enabled
TCP three-way handshake (TCP establish connection)
First handshake: pc1 sends a SYN request connection to pc2 to establish a connection
Second handshake: pc2 sends ACK to pc1 to confirm the connection and request a connection to the SYN
Third handshake: pc1 sends ACK acknowledgement to pc2 to connect
TCP four-way handshake (disconnect)
First handshake: pc1 sends disconnected FIN and acknowledgment ACK to pc2
Second handshake: pc2 replies to pc1 with a confirmation ACK
Third handshake: pc2 sends a disconnected FIN and an acknowledgement ACK to pc1
Fourth handshake: pc1 sends an acknowledgement ACK to pc2
During the disconnection of the TCP, there is a half-closed state. TCP clients can stop sending data, but they can still accept data, which is called semi-shutdown.
(1) the client sends the FIN message segment and half closes the connection, and the server sends the ACK message segment to accept the half-close.
(2) the server continues to send data, while the client only sends ACK acknowledgement and no longer sends any data.
(3) when the server has sent all the data, the FIN message segment is sent, and the client sends the ACK message segment, thus closing the TCP connection.
TCP common port number
Port number protocol description
The control port opened by 21 FTP FTP server port 20 is the data connection of ftp port 21 is the control connection of ftp.
23 TELNET plaintext is used for remote login and can remotely control and manage the target computer
25 SMTP is used to send mail
80 HTTP Hypertext transfer Protocol https 443 Security
110 POP3 for email acceptance
143 IAMP is used to send mail
22 SSH ciphertext remote login
UDP protocol
UDP is a transport layer protocol with no connection and no guarantee of reliability, that is to say, the sender does not care whether the transmitted data reaches the target host, whether the data is wrong, etc., and the host that receives the data will not tell the sender whether it has received the data. Its reliability is guaranteed by the upper layer protocol. If UDP has such a drawback, why is the process willing to use it? Because UDP also has advantages, the header of UDP has a simple structure and can achieve minimum overhead in data transmission. If the process wants to send a very short message and does not care about reliability, it can use UDP. When using UDP to send very short messages, there is much less interaction between the sender and receiver than when using TCP.
UDP header format
Source port number: a process used to identify the sending side of the data, similar to the port number of the TCP protocol.
Destination port number: a process used to identify the receiving end of data, similar to the port number of the TCP protocol.
UDP length: used to indicate the total length of the UDP and add data to the header.
Checksum: used to perform error checking on UDP data, and its calculation is similar to TCP checksum. This is the only reliable mechanism provided by UDP.
Commonly used UDP port numbers and their functions
Port protocol description
69 TFTP simple File transfer Protocol
111RPC remote procedure call
123NTP Network time Protocol
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.