DoDWAN implements a content-based epidemic dissemination model, that is, a model where content flows towards interested receivers rather than towards specifically set destinations. This does not mean that it cannot support destination-based communication, though.
In the following, we show how Alice (on host1
) and Bob (on host2
)
can exchange content, possibly with the collaboration of other users.
Assume Alice wants to send a file to Bob:
host1$ dodwan.sh publish dst=Bob /path/to/file
With this command the file is embedded as the payload of a message, whose descriptor indicates who is the source, and who is the destination of the message.
In order to be able to receive a message such as that sent by Alice, Bob should set a subscription accordingly:
host2$ mkdir /tmp/Inbox
host2$ dodwan.sh subscribe key1 dst=Bob -d /tmp/Inbox
With this command, any message whose descriptor matches the pattern
dst=Bob
(i.e., any content sent to Bob) will be deposited in /tmp/Inbox
.
Alice should of course set a similar subscription (but with pattern
dst=Alice
) on host1
in order to receive content Bob --or any other
user-- may send to her.
Assume Alice and Bob are members of a group of friends (or colleagues, or fans of Tolkien) called... HOBBITS!
Content can be shared among members of this group, as soon as they all set appropriate subscriptions on their own DoDWAN node. Alice may for example set the following subscriptions:
host1$ dodwan.sh subscribe key2 grp=HOBBITS
host1$ dodwan.sh subscribe key3 "dst=(Alice|ALL),grp=HOBBITS" -d /tmp/Inbox
With subscription key2
, Alice states that she would like host1
to
receive and store in its local cache any content whose descriptor
matches the pattern grp=HOBBITS
. In other words, any content
exchanged between members of the group should be stored in the cache,
and thus kept available for other members of the group.
With subscription key3
, Alice states that she would also like any
content addressed to herself or to all members of the group to be
deposited in /tmp/Inbox
.
Thus, Bob can send a message to Alice (as a member of group HOBBITS) with:
host2$ dodwan.sh publish dst=Alice,grp=HOBBITS /path/to/file
This message will be stored in their local cache by any member of group HOBBITS, which will henceforth behave as a (possibly mobile) carrier for the message.
Bob can likewise send the same message simultaneously to all members of group HOBBITS with:
host2$ dodwan.sh publish dst=ALL,grp=HOBBITS /path/to/file