Saturday, January 29, 2011

Three-Way Handshake -- why and when?

I've been pondering why some protocols need a "three-way handshake" when others do not.

For example, TCP requires a three-way handshake. I.e., A to B (syn), then B to A (syn and ack), then A to B again (ack). Then data can flow in both directions.

The SIP INVITE transaction requires this as well. I.e., A to B (INVITE), then B to A (response code like 200), then A to B (ACK).

I did read some Knowledge Theory stuff in my Distribute Algorithms class. It seems like I ought to know this.

It seems like it has something to do with one of these:

(1) The purpose is to BEGIN a flow (and not to do something idempotent).

(2) A is making a request of B, but B must also make a sort of request of A.

Of course, these two options may both, or neither, be involved in the true answer.

No comments: