Sunday, March 23, 2008

Managing Complexity in (ahm) Complex Systems..

As I think about wireless networks, my mind goes into philosophical overdrive :) . Most systems are complex because we want some level of performance (performance in a very very broad sense -- performance for a building may mean how long it can withstand certain winds), and Its much simpler to make stuff that doesn't work so well than the one which does. Yet at the same time, we'd like to keep things simple enough for designers/maintainers.

I do speak in a computers context to begin with, and I am limited to my myopic world view -- I'll be grateful if my smarter friends in more diverse fields speak their mind; after all anything that does a good job is complex: good buildings/circuit systems/biological systems/economy..

I guess the only way to manage complexity is to break a complex system into more manageable chunks. There are really two ways of breaking up a system: vertically, with each "piece" performing some task and interacting with other pieces, or go for a layering paradigm -- starting from a 10,000 foot view and delving deeper slowly and considering the "view" at that level.

From a Biology point of view (with my very limited high school knowledge), breaking up vertically would have to mean the way we attribute "functions" to organs (or even cell components like whatsitsname.. um Mitochondria) and then talk about each organ as an "entity" and its interactions with other entities. This makes it easy to categorize stuff into neat compartment = (function,interaction) pairs. Another example would be the Von Neumann Architecture for computers .

When thinking of layering (the most obvious example that would come to me would be the network stack but we'll save that for later :P ), one good example would be the memory hierarchy in computers, where you worry about interactions only between adjacent layers while designing.

When data travels from disk to CPU, it goes through the following path (in most cases)

Hard disk --> main memory --> cache --> on chip cache --> registers

and the same way back when data is to be stored into hard disk..

I have thought hard about this, but I can't think of a "natural" (occurring in nature, like evolutionary, biological) example of this kind of layering, and I'll be obliged to anyone who points one out for me, but I think I have a clue as to why this kind of layering is not visible in nature.

Now for the whole crux of my point -- I think, designing with vertical partitioning gives us performance, while going for a layering paradigm sacrifices performance for ease of manageability in design and maintenance.

If you break up functionality into vertical components, each component can be rigged up to give the best possible performance internally, only the interface with other components need be maintained. For example, If CPU and memory are two independent units, each can be rigged up internally to give the best possible performance, as long as they can "talk" to each other(maintain the interface). The only catch is, since you can rig it up as much as you'd like, these components themselves tend to be very complicated (think CPU)

Imagine a computer where cache coherency algorithm depends on hard disk drive head position. One can envisage that it may lead to improvement in performance, (For example, off top of my head, An optimization (assuming all data in cache goes from cpu to disk): Evict data from cache in order of disk head position, to reduce disk latency), but writing the disk driver and the cache coherency algorithm would be (ahm.. to put it mildly) crazy. Also imagine, then we would have problems like a particular disk drive not working with a certain chipset. This may sound vague, but isn't as remote as all that: think cameras and non AA battery sizes: Non AA batteries are smaller/lighter in weight but then the camera has to be charged in situ.

I speculate that we don't see this layering in nature is because, nature doesn't care about ease of design -- it has infinite chances of getting it right (by trying our random combinations by way of mutations and evolution) , or maintenance-- after all what price one creature?Perhaps thats why medicine is so hard..

Its a known fact that for various reasons our Wireless networks don't perform as well as the wired networks - they are generally slower, more error prone than the ones which we wire down. Some of this is because the "channel" we transmit in isn't as reliable (bit error rates are much higher in air than in a co-axial cable), but thats not all -- We are dragging the dead weight of our engineering decisions of wired networks (Our design for wired networks had assumptions that don't hold for wireless networks).

Networks have followed a Layered architecture(TCP/IP) all this while, to manage the crazy complexity of making any two (possibly radically) different machines communicate over versatile links (dial up, broadband, submarine cables,satellite links and even pigeon post I hear) across huge distances in the world. Because of the wireless performance problems that we have, more and more people are saying that layering should be sacrificed for more tightly coupled cross layer solutions. . I have even come across work where people do power aware(at physical layer) encryption (at application layer) to squeeze every bit of performance out!

The open question is, where is the sweetspot between performance and manageability for wireless networks? Are we at a cornerstone right now? The same kind of tipping point came for operating systems sometime in the 70s, when clean, layered but slow operating systems were abandoned for the better performing ugly ones.

Maybe this post is too vague, the ideas are wrong/trivial/uninteresting or plain gibberish and unfit for human consumption -- but what the heck! :) If you've got some enlightening thoughts, I'd love to hear them, (even if all you've got to say is that I'm insane and should quit inflicting blog posts on innocent people)... :P

4 comments:

Vacha said...

Whoa!I didn't realize that it was an absurdly long post :P

Anyone who goes through all of it needs to be thanked profusely..

thank you for being patient with me. I'll try to be more concise in future

lakshmi said...

I have read half of it:)
will read the other half at leisure and drop the concrete in my head ;)

Nikhil said...

Nature has its story: Humans evolved from...I think fish? As nature saw the need for a balance in geography, evolution, population, etc..it created new species that were more complex than the preceding one.s With a stronger brain and capability to "perform" (compare to computers) better, the species were able to provide the "ease of design" for nature. Nature needed X (ease), it created Y (new specie) to perform X, I suppose it is that simple. Maybe not..just a thought.

Cool and all Vacha...my wireless is faster than wired :))

lakshmi said...

If I understand what you mean by layering, every structure has to be and will be designed by that process. For example,all though when I build a structure in the order:foundation-columns-beams-slabs, etc, My order of design would be the load path from slabs-beams-columns-foundations and I am only interested in how adjacent "layers" interact with each other meaning that it does not matter in any physical sense on how slabs interact with foundations. I personally find it extremely difficult to imagine even. We need to go through the specific path.
Another example when I design a structure for winds/earthquakes, I decide right in the beginning on what parts of my structure are actually going to resist these forces and design members in such a way that the members that are not going to resist these forces shed loads to adjacent members and then they follow a different load path than before.
I do not know if I have explained clearly enough for you to understand.