Short Abstract:
Normal Connection Establishment: The “Three Way Handshake”!
To establish a connection, each device must send a SYN and receive an ACK for it from the other device. Thus, conceptually, we need to have four control messages pass between the devices. However, it’s inefficient to send a SYN and an ACK in separate messages when one could communicate both simultaneously. Thus, in the normal sequence of events in connection establishment, one of the SYNs and one of the ACKs is sent together by setting both of the relevant bits (a message sometimes called a SYN+ACK). This makes a total of three messages, and for this reason the connection procedure is called a three-way handshake.
This diagram illustrates how a conventional connection is established between a client and server, showing the three messages sent during the process and how each device transitions from the CLOSED state through intermediate states until the session is ESTABLISHED.
Dependencies:
+ build-essential ipset libev-dev
+ Linux-image
Usage:
sudo apt-get install build-essential ipset libev-dev sudo apt-get build-dep linux-image-`uname -r` git clone https://github.com/ptpt52/natcap && cd natcap make && make -C natcapd sudo ./client.sh sudo ./server.sh
Source: https://github.com/ptpt52