Note: Today, I browsed the open-source blog and found this interesting picture about the tcp handshake. I also wrote the three-way handshake of tcp. Source: http://www.fresh3g.org/blog/post/405/ 650) this. width = 650; "alt =" "src =" http://www.bkjia.com/uploads/allimg/131227/030023HP-0.jpg "border =" 0 "/> tcp three-way handshake process: 1) male ---> [SYN] -----> female boys want to chase this girl and create a reliable link for this girl.
When the boy wants to communicate with the girl, the boy first wants the girl to send a SYN (Synchronize) Tag package, telling the girl to request a link. ------- MM can you meet me?
Note: a syn packet is a TCP packet with only the SYN flag set to 1, because this is the token that the girl promised the boy to know the request. Only the girl receives the SYN packet from the boy, you can create a link. There is no other method except for the first time.
Like the output chain of iptables is generally set to ACCPET, so that the SYN packet can go out. When it comes back, it can establish an active connection because of the-m state -- state established accept. Firewall may be wrong, please correct) 2) male <---- [SYN/ACK] <----- the female will send a confirmation packet (SYN/ACK) to the SYN Packet after receiving it ), to confirm the first SYN Packet and continue the handshake operation. --------- Wow, handsome guy ~~~
Note: The SYN/ACK package is only a packet marked with 1 as SYN and ACK. (3) Male ----> [ACK] -----> female
The boy received the SYN/ACK packet and sent a confirmation packet (ACK), notifying the girl to establish a link and finished three handshakes. ------ Haha I caught up ~~~ (4) male <----- [RST] <------ female RST indicates the reset package. When tcp is subjected to any link segment that does not belong to the host, it wants the other party to send a reset packet. ------- You are not my favorite GG % >_< %
Result: The connection is reset, the reliable link is not established successfully, and the MM is not recovered. Note: This is just a simple understanding of TCP/IP, and the understanding of the Protocol is not so deep, just interested in this figure, in this way, I also explained my understanding of tcp's three handshakes. If any error occurs, please correct it.
This article is from "with dreams ~ Chase my true color blog, please be sure to keep this source http://bensonzy.blog.51cto.com/227860/600422