In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
What I share with my friends this time is the transport layer in the seven layers of the network. I will break it down into the following steps:
Introduction of 1.TCP Protocol
2.TCP message format
3.TCP three-way handshake
4.TCP waved four times.
Introduction of 5.UDP Protocol
6. Common protocols and their ports
I. TCP and UDP protocols
1.TCP is a connection-oriented, reliable process-to-process communication protocol
2.TCP provides full-duplex service, that is, data can be transmitted in both directions at the same time.
3.TCP message segment (not more than 1500 bytes, 1.5kb)
TCP forms a packet of bytes called Segment TCP messages are encapsulated in IP datagrams
TCP message paragraph:
1. Source port number (16)
two。 Destination port number (16)
3. Serial number (32): the sender numbers each byte so that the receiver can reorganize correctly
4. Confirmation number (32): used to confirm the information of the sender
5. Head length (4)
6. Reserved (6)
7.URG (emergency pointer bit): 1 means enabled, 0 means disabled, and does not need to be submitted to the application layer directly through cache, as an example:
Both An and B have caches. At this time, the data transferred from A to B will first go to B's cache. When all the data is sent, it will be transferred to the application layer by B's cache.
8.ACK (confirmation): confirm bit
9.PSH (Quick receive to Application layer): 1 means enabled, 0 means closed, and needs to be cached. After a batch of message segments arrive, they are sent directly to the application layer without queuing.
10.RST (resend connection): reset bit
11.SYN (request connection token): 1 means to establish a connection
12.FIN (request disconnection flag):
13. Window size (16): used to indicate the number of locally acceptable data segments. The window size is variable. The larger the window, the faster the transmission speed.
14. Checksum (16): error check
15. Emergency pointer (16)
16. Options: optional
2. The process for TCP to establish a connection is a three-way handshake: (important)
For example, we have client-side PC1/ server PC2 at this time
The specific process is as follows: PC1 sends SYN request to establish connection after receiving PC2, it sends ACK confirmation, and sends SYN request to establish connection (two-way interworking) PC1 sends ACK confirmation
Three. Four waves of TCP disconnection: (important)
For example, we have client-side PC1/ server PC2 at this time
The specific process is as follows:
PC1 sends FIN disconnect request and sends ACK acknowledgement bit PC2 to confirm ACKPC2 sends FIN disconnect request, and ACK acknowledgement bit requests PC1 to send ACK acknowledgement bit
However, it is important to note that there is a semi-closed concept during the disconnection of TCP. The TCP party can stop sending data, but it can still receive data, which is called semi-closed.
Here we give an example: Thunderbolt downloads something, use Thunderbolt to download after clicking on the page, and will continue to download after exiting the page at this time.
The specific process is as follows: the PC1 client sends the FIN message segment, half closes the connection, the PC2 server sends the ACK message segment to accept the half close, and then continues to send the data, while the client only sends ACK acknowledgement and no longer sends any data. When the PC2 server sends all the data, it sends the FIN message segment, and PC1 sends the ACK message segment, so the connection is closed.
Commonly used TCP port numbers and their functions:
Let's talk about the meaning of each port:
Port 21: FTP (port 20, data connection / port 21, control connection) port 23: TELNET: plaintext access port 22: SSH: ciphertext access port 25 SMTP: server open port for sending mail port 80: HTTP: hypertext transfer protocol port 443port: HTTPS: secure transfer protocol port 110port: POP3, port 143for mail reception: IAMP4: Port 53 for mail reception: DNS
IV. UDP protocol:
1. Connectionless, unreliable transport protocol
two。 The cost is small.
The header format of the UDP message:
UDP length: used to indicate the total length of the UDP and add data to the header
Checksum: used to complete error checking of UDP data. It is the only reliable mechanism provided by UDP protocol.
Commonly used UDP port numbers and their functions:
The above is the introduction of the transport layer protocol and the specific process of the important TCP three-way and four-way handshake, as well as some common ports and the corresponding representative meaning, thank you!
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.