TCP/IP host-to-host data transmission, as well as a simple understanding of three handshakes and four waves

Source: Internet
Author: User

Data packet transmission from the host to the host

1/22

SYN is the signal for TCP connection establishment.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FB/wKiom1Qg3WaCWyecAAHQ0CPmypc887.jpg "style =" float: none; "Title =" tcp1.png "alt =" wkiom1qg3wacwyecaahq0cpmypc887.jpg "/>




2/22

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FC/wKioL1Qg3YewmxHlAAEfhuRI-3E187.jpg "style =" float: none; "Title =" tcp2.png "alt =" wKioL1Qg3YewmxHlAAEfhuRI-3E187.jpg "/>




3/22

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FB/wKiom1Qg3WeA5mVfAAGM11oibcQ445.jpg "style =" float: none; "Title =" tcp3.png "alt =" wkiom1qg3wea5mvfaagm11oibcq445.jpg "/>



4/22

Host 3.1 2-layer encapsulation of frame ARP requests

 

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/FC/wKioL1Qg3YjxQk12AAH6nepkdT0946.jpg "style =" float: none; "Title =" tcp4.png "alt =" wkiol1qg3yjxqk12aah6nepkdt0946.jpg "/>




5/22

Host 3.1 sends ARP request Broadcast

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/FB/wKiom1Qg3Wji-eL7AAFZZNreQTM873.jpg "style =" float: none; "Title =" tcp5.png "alt =" wKiom1Qg3Wji-eL7AAFZZNreQTM873.jpg "/>




6/22

Host 3.2 receives ARP request Broadcast

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/FC/wKioL1Qg3YnAZBJaAAGwbj5fBJY057.jpg "style =" float: none; "Title =" tcp6.png "alt =" wkiol1qg3ynazbjaaagwbj5fbjy057.jpg "/>




7/22

Host 3.2 receives ARP requests

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/FB/wKiom1Qg3WjRJKR4AAEls9WR-PQ764.jpg "style =" float: none; "Title =" tcp7.png "alt =" wKiom1Qg3WjRJKR4AAEls9WR-PQ764.jpg "/>




8/22

Host 3.2 receives and responds to a frame

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FC/wKioL1Qg3YrgyVj2AAFgwdIO7KA874.jpg "style =" float: none; "Title =" tcp8.png "alt =" wkiol1qg3yrgyvj2aafgwdio7ka874.jpg "/>



9/22

Host 3.2arp response

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FB/wKiom1Qg3WnDTSPRAAH5R-mW1b4828.jpg "style =" float: none; "Title =" tcp9.png "alt =" wKiom1Qg3WnDTSPRAAH5R-mW1b4828.jpg "/>



10/22

Host 3.2 sends ARP response

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/FC/wKioL1Qg3YqSa4SJAAFTJsrF24o326.jpg "style =" float: none; "Title =" tcp10.png "alt =" wkiol1qg3yqsa4sjaaftjsrf24o326.jpg "/>



11/22

Host 3.1 receives a response, unpacks the two-layer frame, and adds an ARP entry

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/FC/wKioL1Qg3YvQVLgbAAGiBDHdsZw920.jpg "style =" float: none; "Title =" tcp11.png "alt =" wkiol1qg3yvqvlgbaagibdhdszw920.jpg "/>



12/22

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/FB/wKiom1Qg3WqjGE4tAAEVw5HhHEM764.jpg "style =" float: none; "Title =" tcp12.png "alt =" wkiom1qg3wqjge4taaevw5hhhem764.jpg "/>



13/22

ARP ing completed

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/FB/wKiom1Qg3WuTlh7mAAGmG8LIpfU528.jpg "style =" float: none; "Title =" tcp13.png "alt =" wkiom1qg3wutl1_maagmg8lipfu528.jpg "/>



14/22

Host 3.1 requires the first session handshake

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/FC/wKioL1Qg3Yzxa-iEAAE20V2lcFA121.jpg "style =" float: none; "Title =" tcp14.png "alt =" wKioL1Qg3Yzxa-iEAAE20V2lcFA121.jpg "/>




15/22

Host 3.2 confirm to accept and respond to the second handshake of the session

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/FC/wKioL1Qg3YzS-txtAAFi2yalM5Y724.jpg "style =" float: none; "Title =" tcp15.png "alt =" wKioL1Qg3YzS-txtAAFi2yalM5Y724.jpg "/>




16/22

Host 3.2 Response session

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/FB/wKiom1Qg3WzzvorvAAFhPnb4IaI178.jpg "style =" float: none; "Title =" tcp16.png "alt =" wkiom1qg3wzzvorvaafhpnb4iai178.jpg "/>



17/22

Host 3.1 unpacking

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FC/wKioL1Qg3Y3ieK7GAAEtadaZ_mk004.jpg "style =" float: none; "Title =" tcp17.png "alt =" wkiol1qg3y3iek7gaaetadaz_mk004.jpg "/>




18/22

Three-way handshake completed

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FB/wKiom1Qg3WyioLoXAAGL5G_aiss286.jpg "style =" float: none; "Title =" tcp18.png "alt =" wkiom1qg3wyioloxaagl5g_aiss286.jpg "/>





19/22

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/FC/wKioL1Qg3Y2Tab_SAAEidaE7DTY161.jpg "style =" float: none; "Title =" tcp19.png "alt =" wkiol1qg3y2tab_saaeidae7dty161.jpg "/>




20/22

Host 3.1 package and send data

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/FB/wKiom1Qg3W2xTlzBAAFLU5CokzE295.jpg "style =" float: none; "Title =" tcp1_png "alt =" wkiom1qg3w2xtlzbaaflu5cokze295.jpg "/>




21/22

Host 3.2 unpack and extract data

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/FC/wKioL1Qg3Y7Qa_H5AAE45c8c6X0074.jpg "style =" float: none; "Title =" tcp21.png "alt =" wkiol1qg3y7qa_h5aae45c8c6x0074.jpg "/>



22/22

Confirm received data

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/FB/wKiom1Qg3W3jdEMpAAFFglYQvNw670.jpg "style =" float: none; "Title =" tcp22.png "alt =" wkiom1qg3w3jdempaaffglyqvnw670.jpg "/>





TCP connection establishment (three-way handshake)

SEQ is the serial number

Ack is the validation character and the serial number of the data packet to be sent.

Three-way handshake

Step 1 A sends SYN and randomly generates an initial seq such as seq = 100

Step 2 B confirm that SYN is received, that is, seq = 100 packets

And want to accept the next packet ACK = 100 + 1 that is 101 packets

At the same time, B will also tell a to randomly generate the initial aeq, such as seq = 300.

Send seq = 300, ACK = 101 packets

Step 3 A receives ACK = 101 from B, and sends its seq = 100 + 1 to B.

At the same time, B is expected to continue to send data packets, then ACK = 300 + 1


In step 2, Ack confirmation and SEQ packet transmission are synchronized.


650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FC/wKioL1Qg3Y-AdN3XAAHDRnV1GME768.jpg "style =" float: none; "Title =" Three grip .png "alt =" wKioL1Qg3Y-AdN3XAAHDRnV1GME768.jpg "/>




TCP connection termination (four waves)

Step 2 and Step 3 are not synchronized. It is often because you have finished sending and I have not finished collecting

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/FB/wKiom1Qg3W6DK1skAAG0me5h4gE480.jpg "style =" float: none; "Title =" four swing .png "alt =" wkiom1qg3w6dk1skaag0me5h4ge480.jpg "/>


TCP/IP host-to-host data transmission, as well as a simple understanding of three handshakes and four waves

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.