Ye Olde Clue

Random musings on random stuff.

Actor Model vs Denial of Service

Kamaelia implements something similar to, but not the same as the Actor Model. Since I'd not heard of the actor model for the majority of time whilst working on Kamaelia (kamaelia is more like occam, unix pipes, hardware, etc), I've been reading up on it. One thing that I've come across about it that suprises me is this:

Communications among actors occur asynchronously: that is, the sending actor does not wait until the message is received before proceeding with computation.
(this summary courtesy of the Wikipedia page on the Actor Model, but the literature supports this view as well)
The difference between Kamaelia and the Actor Model is in a few places, but possibly the most fundamental is this:
Now the thing I can't tell by looking at literature is what the general case is for most actor systems in practice:
The reason I ask is because if you don't have the ability to define pipewidths, maximum inbox sizes, maximum outbox sizes or something then you can easily cause a denial of service attack in that scenario by having producers overload consumers. Consider a frame grabber feeding a slow, experimental video codec. In that scenario, it becomes rather important to be able to have a form of blocking (or EAGAIN) behaviour available. Indeed, this is such a common issue, that it's why unix pipes & filehandles will buffer a small amount of data, but block if you send too much data (or exhibit EAGAIN behaviour :). Similarly this is what's behind the socket.listen(argument) call in a server - to allow a certain number of connections to queue up, before refusing connections...

So, the question I really have is this: if you use or implement an actor model system, do you have any ability in your implementation to be able to say "maximum number of pending incoming messages" ? If you don't, then it is remarkably easy to write code that can break an actor based system by mistake, with problems in dealing with that - making code more complex, and less reusable.

I'd really be interested in hearing both positives and negatives here...

Reply to this post

Comments

Actor Model I/O #

The (pure) Actor Model doesn't provide any default mechanisms for buffering. Instead, an actor that wishes to buffer data (even to just impose a sequential order on it) would typically create another actor to provide the ordering and buffering, and yet another actor to process those ordered messages. However, while this allows any form of buffering, packet-dropping, etc. to be performed actor-side, there is no -default- or -standard- mechanism for an actor to 'slow down' data from an upstream actor that isn't designed to cooperate. (One may, of course, design actors to cooperate with out-of-stream messages to use ACK/NAKs, implement TCP and handshakes, etc.)

You seem to provide some such standard mechanisms in Kamaelia. Such standardization helps reduce developer effort to provide cooperation, but doesn't really eliminate the problem DoS attacks by uncooperative sources.

I'll note that Actor I/O is fully capable of emulating the I/O model of Kamaelia. It wouldn't be difficult to create actors whose sole purpose in life is to act as 'named mailboxes' that may be told whom is to receive the outputs (by a coordinator). But, as with all such emulations, the greater flexibility of the host language means that one cannot -assume- these mechanisms are the only ones in use, and thus cannot make as many guarantees or optimizations. With Kamaelia, you could presumably make more guarantees (including promises of 'modularity' and such) and optimizations (e.g. regarding distribution of messages in a distributed system) than is possible for an Actor Model emulation thereof.

-- guest, 29 Nov 2008 at 03:00, Rating: 0 (Reply) (Moderated by: anon)

Back to front page