Network Communication Design Patterns [closed]

This is a pretty broad question and its treatment likely requires a fairly dense book.

I don’t know of any such resource myself, but lets think this through and consider what would be the dimensions of a network communication pattern space:

connection modality: { connection-based, connection-less}

interaction modality: { synchronous, asynchronous }

conversation complexity: { command-response, dialog}

message form: { freeform-stream, semi-structured block, fully-structured block }
..?

A good place to start is to take the TCP/IP family of protocols, map them to the above space, and take a look at the implementation(s) of one or more specimens that occupy a unique position in the above protocol-characteristics pattern space. Source code of your favorite *nix os would be a good place to look.

Parser implementations would probably fall into two broad categories: {command-switched processing, finite-state-machine}.

The former is (obviously) the simpler of the two and likely the initial implementation (unless you’ve done this sort of thing before).

The latter is (likely) more robust, efficient (in terms of loc), and would allow for adopting changes to a protocol (if it is still subject to design change).

(The underlying (virtual) OS networking facilities (of course) also greatly influence the implementation. Take JVM, for example: NIO selection based channel processing would work quite nicely with a FSM.)

Hope that helps.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)