Hello. I do not understand what it means to SYN and ACK when connecting over TCP. A bunch of videos reviewed and understood. Who got it? What is the use of SYN and ACK (why they even invented)? Some incomprehensible number of computers are exchanged, some SYN incrementing by one … Need some simple example, understandable for someone who do not understand networks.
Answer 1, Authority 100%
We invented them with the important goal that packets on the TCP peredyuschiesya, may not come in the same order they were sent, and not in the same composition. We need a mechanism that will collect a series of packets in the correct sequence. And also check whether all the packages are present or someone halfway fizzled out and lost.
This problem is solved with the help of sequence numbers and acknowledgment numbers. queue number (sequence number) – a number the outgoing packets. This number increases depending on the length of the data field. Each octet data (ie. E., Each byte) of one packet has a sequence number. Sequence number of the first data octet and passed to the TCP packet header, and he also considered the queue number for the package. confirmation number – tell the other side of the queue number that is expected to get from it the next. They say that the packages with all the previous sequence number (not including this one) have been received.
The initial line number is sent to the client when a connection with SYN flag. The server sends back a confirmation number (obtained sequence number + 1) and a sequence number (in general any, but by using the mechanism of SYN coockie built on a specific algorithm). The server is currently informs the client that the expect from him a package that will have a sequence number equal to the sent confirmation number. From this, the client numbers in the future and makes a start.
Next, everything happens in such a way – one side (side A) sends another (side B) packets numbered queue numbers. The second party accepts them and informs the queue number, which she expects to get from A with the next packet. This suggests that the side B has received all packets whose sequence number was lower than the transmitted confirmation numbers (but not equal to it) and that the side of B expects that in the next batch of data transferred numbering begins precisely with this issue.
In any case, once again – the field TCP
queue number (
sequence number) simply means the packet number needed for what would be the packages properly collect and detect the loss (or duplicate). Field
Confirmation Number is used to inform the second side of which packages were from it have already been received (with any serial numbers), and contains a number that is expected to be seen in the field
queue number next received packet from the same source.
ACK is still the flags, not numbers. They say that involving the relevant header fields (flags TCP )