The three-way handshake is performed when establishing TCP connection to a port on the system. The handshake establishing reliable TCP connection if successful. The process involves three steps. The principal of how it works based on different flags set inside the packet. Lets look at three steps that occurring during three-way handshake.