Consider the three way handshake of TCP. It is explained here.
Now the article above mentions that two sides may try to connect simultaneously and the three way hand
We do passive server and active client because it's easy to understand, [relatively] easy to implement, and easy to code for. Think of a store and a customer, we'd be in one of these situations:
Since the server passively waits for clients to connect it's easy to predict when a connection can take place. No pre-agreements (other then server address and port number) are necessary.
The simultaneous open, on the other hand, is subject to connect timeouts on both sides, i.e. this has to be carefully orchestrated for connection to take place so that SYN
s cross "in-flight". It's an interesting artifact of the TCP protocol but I don't see any use for it in practice.
You can probably try simulating this by opening a socket, binding it to a port (so the other side knows where to connect to), and trying to connect. Both sides are symmetric. Can probably try that with netcat with -p
option. You'd have to be pretty quick though :)