
The sequence number is a topic by itself, but this simplified explanation is enough for the purpose of explaining the TCP 3-way handshake. This way both parties can keep track of the amount of bytes that were sent, allowing for reliable transfer on top of the unreliable IP-protocol. In TCP each byte has a sequence number that is increased for every byte sent. One important feature of this handshake is the synchronization of the TCP sequence numbers. Only after the connection has been established, data transfer takes place. No data is sent during the 3-way handshake. Note that I use the terms client and server to clearly distinguish the party that initiates the handshake (client) from the one responding to that (server). Now the session begins and the socket is created. The client responds with an Acknowledgment ( ACK).If the server accepts, it responds with a Synchronization Acknowledgment ( SYN-ACK) to let the client know it's open and ready for communication.The client first sends a Synchronization packet ( SYN).In this handshake, a client initiates the conversation by requesting to have a communication session with the server: Normal TCP traffic begins with a 3-way handshake. The last part describes what happens when a 3-way handshake does not complete in a normal fashion and how we can use this to perform port scanning on a system.įor quick reference, these are the contents of this article: The first part of this article will give an overview of the handshake after which we'll dive deeper and see what the network traffic looks like. It begins with a handshake and ends with a termination session. Transmission Control protocol (TCP) is a connection oriented protocol. This article describes the TCP 3-way handshake and builds upon this knowledge to explain technically how port scanning works.
