Those things about TCP (on)

TCP is a hugely complex protocol because he has to solve a lot of problems, and these problems bring out a lot of sub-problems and dark side. So learning TCP itself is a painful process, but it can make people have a lot of gains in the process of learning. Regarding the details of the TCP protocol, I still recommend you to see W. Richard Stevens' "TCP/IP Explain 1: Protocol" (of course, you can also read RFC793 and the N more RFC). In addition, I will use English terminology in this article, so that you can find relevant technical documents through these English keywords.

The reason why I want to write this article has three purposes.

One is to try to exercise whether you can use a simple space to describe such a complex TCP protocol.

The other is that many programmers nowadays basically don't read the book seriously and like the fast food culture. Therefore, I hope this fast food article will let you know about the classical technology of TCP and understand the software design. All kinds of difficulties. And you can get some software design gains from it.

The most important hope is that this basic knowledge will allow you to figure out a lot of plausible things in the past, and you can realize the importance of the foundation.

Therefore, this article will not cover everything, just the science of TCP protocols, algorithms and principles.

I originally only wanted to write a length of article, but TCP is really complicated TMD, more complicated than C++. Over the past 30 years, various optimization variants have been debated and modified. Therefore, writing and writing found that only cut into two.

In the previous article, I mainly introduced you to the definition of TCP protocol and the retransmission mechanism when dropping packets.

In the next section, we focus on TCP's aliasing and congestion handling.

Less nonsense, first of all, we need to know the fourth layer of TCP in the seven-layer model of network OSI - Transport layer, IP in the third layer - Network layer, ARP in the second layer - Data Link layer, in the first The data on the second layer, we call Frame, the data on the third layer is called Packet, and the data on the fourth layer is called Segment.

First of all, we need to know that the data of our program will first hit the TCP Segment, then the TCP Segment will hit the IP Packet, and then hit the Ethernet Ethernet Frame, after passing to the peer, the layers Parse your own protocol and then pass the data to a higher level protocol.

TCP header format

Next, let's take a look at the format of the TCP header.

Those things about TCP (on)

TCP header format (image source)

You need to pay attention to these points:

The TCP packet has no IP address, which is the IP layer. But the active port and the target port.

A TCP connection requires four tuples to indicate that the same connection (src_ip, src_port, dst_ip, dst_port) is exactly a five-tuple, and one is a protocol. But because this is just a TCP protocol, I only talk about quads here.

Notice the four very important things in the picture above:

The Sequence Number is the sequence number of the packet and is used to solve the network packet reordering problem.

The Acknowledgement Number is the ACK - used to acknowledge receipt, to solve the problem of not losing packets.

Window is also called AdverTIsed-Window, which is also known as the sliding window, which is used to solve flow control.

TCP Flag, which is the type of packet, is mainly used to manipulate the state machine of TCP.

For other things, see the illustration below

Those things about TCP (on)

TCP state machine

In fact, the transmission on the network is not connected, including TCP is the same. The so-called "connection" of TCP is actually just to maintain a "connection state" on both sides of the communication, so that it looks like there is a connection. Therefore, the state transition of TCP is very important.

The following is: "TCP state machine" (picture source) and "TCP link", "TCP break link", "pass data" comparison chart, I put the two maps together and so that it is convenient for you to compare Look. In addition, the two figures below are very, very important, you must remember. (Spit a trough: Seeing such a complicated state machine, you know how complicated this protocol is. Complex things always have a lot of pits, so the TCP protocol is actually quite awkward.)

Those things about TCP (on)

Many people will ask why it takes 3 handshakes to build a link, and 4 waves to break a link?

For the 3-way handshake of the built link, it is mainly to initialize the initial value of the Sequence Number. The two parties to the communication should notify each other of their own initialization Sequence Number (abbreviated as ISN: Inital Sequence Number) - so called SYN, the full name Synchronize Sequence Numbers. This is the x and y in the figure above. This number is to be used as the serial number of the future data communication to ensure that the data received by the application layer will not be out of order due to the transmission problem on the network (TCP will use this serial number to splicing the data).

Intel I3 Laptop

What`s your impression for Intel I3 Laptop? You can take i3 Laptop Deals as the entry level of Gaming Laptop . There are different parameters standards,like 14 Inch Laptop I3 11th Generation, 14inch 256GB Intel I5 11th Generation Laptop, 14.1 inch Intel i7 11th Generation Laptop, 15.6 inch I3 10th Generation Laptop,15 inch Intel I5 10th Generation Laptop, 15inch Intel i7 11th Generation Laptop, etc. That`s some of Top 10 Gaming Laptops. To operating OS, more than 80% clients choose windows 10, home or pro option; nowadays windows 11 is new arrival, you can choose as your demand. Rich slots meet your different potential application scenarios, home, office, public places, academic situations, etc.

Dual storage channels, support HDD and SSD. Your customers can update in future according potential demands.

Of course, other type, like yoga notebook, 2 In 1 Laptop , Android Tablet, Custom All In One PC , 14 inch Student Laptop, i7 16gb ram 4gb graphics laptop, etc. available here also. Just call us and get right details quickly.

Intel I3 Laptop,Laptop I3 11th Generation,i3 10th Generation Laptop,i3 Laptop Deals,Laptop Intel Core I3 Gen 11

Henan Shuyi Electronics Co., Ltd. , https://www.shuyielectronics.com