TCP three-way handshake and four-way handshake with TCP status code

Source: Internet
Author: User

I. TCP three-way handshake and four-way handshake

Flag space:

Syn (synchronous online)

Ack (acknowledgement confirmation)

Psh (push transfer)

FIN (finish)

RST (reset)

URG (Urgent urgent)

 

Sequence Number:

Sequence Number (sequential number) -- seq

Acknowledge number (confirmation number) -- ack

 

 

 

 

Format of the first handshake packet:

 

The second handshake packet format:

 

Format of the third handshake packet:

Three-way handshake:

 

After the connection is established, the data transmission mainly depends on the P Flag bit:

 

Four Waves of data packets, mainly refer to the f flag bit:

Ii. TCP status code

Status

Description

Closed

Closed, no connection activity or in progress

Listen

Listening status, the server is waiting for connection to enter

SYN rcvd

Received a connection request, not confirmed

SYN sent

Connection Request sent, waiting for confirmation

Established

Connection established, normal data transmission status

Fin wait 1

(Active close) a close request has been sent, waiting for confirmation

Fin wait 2

(Active close) receives confirmation from the other party, waiting for the other party to close the request

Timed wait

Two-way close is completed, waiting for all groups to die

Closing

Both parties attempt to close the service at the same time and wait for confirmation from the other party.

Close wait

(Passive close) received the other party's close request, confirmed

Last ACK

(Passive close) Wait for the last close confirmation and wait for all groups to die

 

 

Related Article

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.