SJS wrote:
begin  quoting Andrew Lentvorski as of Tue, Sep 30, 2008 at 01:48:53PM -0700:
Unfortunately, everybody forgets that TCP/IP is two state machines on different computers that are in *absolute lockstep* with one another.

Not exactly loose coupling ...

This just doesn't sit right with me, for some reason.  Implementation
difficulty or adherence to an interface isn't the primary measure of
coupling -- rather, it's how easy (or hard) it is to rip out one
implemenation and replace it with another.

Well, the continuing frustratation^Wmigration from IPv4 to IPv6 shows this is *very* tightly coupled. It is not very easy to rip out. The problem, of course, if the fact that you have to replace the state machines on *both* sides simultaneously.

If the Internet isn't loosely coupled -- and don't get me wrong, I think
this is an interesting viewpoint to consider, and I'd like to beat it to
death -- then just what would you consider to be loosely coupled?

I would probably define "Loosely coupled" in the context of the IntarWeb as the ability to replace *one side* of the system with an alternative and have it still work.

So, SMTP qualifies as loosely coupled because you can replace either side of the system (MUA or MTA) and it still works. Similarly, web servers and clients.

TCP/IP is obviously not loosely coupled. Stateful web stuff is probably pushing the boundaries. I haven't seen an AJAX system that actually allows you to rip out one side or the other without significant pain. Probably not loosely coupled. BitTorrent--probably not loosely coupled in spite of the number of clients--most of them suck donkey balls.

Generally, the issue is that of *state*. Probably a good measure of coupling is to take the number of states per link side (n) and consider the coupling to be (n*n)!.

It really doesn't take very many states before your coupling turns to tar. For example, web--pretty much 2 states per side (wait-respond and send-wait) is a complexity of 4! and counts as loosely coupled. TCP/IP has 11 states per side (not counting some implied stuff) with a complexity of 121! and has the coupling of cured concrete.

This tends to match my experience. Any man+dog can write a text web server or client--TCP/IP stacks tend to be rare as hen's teeth and rife with obscure bugs.

-a

--
KPLUG-LPSG@kernel-panic.org
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to