Search code examples
tcpprotocolsnetwork-protocols

Optimizing protocol opening operation over tcp connection opening


I'm designing a new protocol called DITP. It is a connection oriented protocol that would use TCP as transport layer. With common Internet protocols, when the TCP connection is established, the server starts by sending a greeting message to what the client respond, eventually sending its first request.

I figured out I could save one round trip time by inverting the initial protocol transaction. The client starts by sending the greeting followed by the first request.

The following graphic shows a comparison between the two protocol transaction timings and how it saves one round trip time.

Common protocol and DITP protocol comparison
(source: disnetwork.info)

You may want to read the following blog note for a more detailed explanation. http://www.disnetwork.info/1/post/2008/08/optimizing-ditp-connection-open.html

I had two questions to network programming experts of StackOverflow :

  1. Is this assumption correct ?

  2. Why common protocols don't use this ?

This method could provide a significant performance optimization for long distance connections where communication latency is high and connections are to be established frequently. HTTP would have been a good candidate.

EDIT: Oops big mistake. HTTP uses the optimized method where the client sends the request directly. There is no greeting transaction as with SMTP.See Wikipedia Hypertext Transfer Protocol page.


Solution

  • It isn't done largely because because:

    a.) The client may need to know what version of protocol the server uses

    b.) You won't even know you really are talking to a server that supports the protocol.

    In short, it often makes sense to know what you're talking to before spewing data at it.