Floyd: a CCR agent for distributed information sharing

Floyd is an XProc that talks to other XProcs in ccr land via UDP. The main model here is a broadcast network designed to help share information. Each Floyd has a list of all the other Floyds it knows about. Floyds can broadcast queries out to the Floyd network and get replies.

The current Floyd implementation supports three main functions:

Ping
Ping is used to see if another Floyd is running at the moment. When used as a broadcast message, one can quickly get an idea of how much of the Floyd network is operating. If people are good about always making sure that Floyd is running on their world, then he becomes an effective way of seeing which worlds are up at the moment.
Database synchronization
Floyd has protocol to synchronize the database of Floyds. In particular, any Floyd can ask any other Floyd for his entire database, and then use that information to learna about new Floyds. Also, a Floyd can broadcast his existence to the network, thereby informing other Floyds about a new member. Note that this network is very permissive: Floyd gives out his database to anyone who asks, and will add anyone who asks. Floyd is about information sharing, not secrets.
Finding People
Floyd watches and keeps track of when people enter rooms. It will provide this information when an agent asks for it. If you ask your floyd "Floyd where is Nelson", he will ask all the Floyds he knows about about Nelson's whereabouts, then collate the replies for you.
Important links are:

Installing Floyd

Perl code

To create a Floyd, you need to first install the source code. To do that, put all of the files in the distribution package in one directory - you should have several .pm files, floyd.pl and floyd.ccrl. The Floyd xproc code will also need to write to floyd.db and debug in that same directory.

After installing all the files, edit floyd.pl. First, change $masterName to match your own CCR name (this is an insecure attempt at security). Then make sure that the #! line in floyd.pl executes Perl5 - Floyd will not work with Perl4. You might want to test him the Perl code by running floyd.pl by hand - it should print out

  CCRL
  :floyd (aka floyd) has woken.

CCRL code

After all the Floyd source code is installed, you next need to create a CCR type and an instance of that type. The instructions for that are in floyd.ccrl: copy and paste them into your ccr. The type is mostly a union of udpsource/sink functions, with a few powers to enable some simple actions. You'll need to change the _xproc,runcmd to point to the right directory. Note: if you've installed floyd before, you first need to delete him by doing [unbind at :floyd].

Once you get the xproc set up, open up your new Floyd with [open object :floyd]and try him out! He will respond to "floyd help" to get you started. Read below for important notes about how to start using him properly. Optionally, give Floyd a face by loading floyd.xpm in as :floyd-face and executing [set at :floyd field _visual,image to :floyd-face].


Running Floyd

Floyd is operated by saying commands in his hearing that start "floyd ". A full list of these is available via floyd help.

Floyd stores a list of all the Floyds he knows about in the file floyd.db. You can list this database by typing floyd aliases. You refer to each Floyd on the network by his alias. For instance, you can do a simple ping of one particular floyd by asking floyd ping <alias>.

Registering

The first thing you want to do is to get a database of existing Floyds. You can do this by saying floyd learn from <alias>. This will send a query to the other Floyd named in <alias>, and then add all the Floyds the other Floyd tells him about to his own database. There's an obvious bootstrapping problem: floyd 0.4 ships with the alias dave hardwired to :floyd@ccr.cs.unm.edu/13000. If that Floyd isn't running, you'll need to specify some Floyd by explicit object id. You can also add a Floyd by hand by saying floyd add <alias> <objid>.

Second, this may seem odd, but you should tell your own Floyd about himself. To do this, do floyd add <youralias> <your object ID>. People will use your alias to refer to you: choose it to be something memorable and personal, like your name or world's name. Use your full object id, :floyd@your.host.name/port.

Finally, register yourself on the network. You do this by running floyd register <youralias>, where <youralias> is the alias you used above. Running this command will direct your Floyd to broadcast his existence to all the other Floyds he knows about, who will then add you to their databases.

Querying Who is Running

The simplest Floyd function is to ask floyd who is up. Your Floyd will then go and send pings to all the other Floyds he knows about, collect the replies, and report back to you with a list of the other Floyds that are currently operating. You can also make a lowlevel ping to an individual floyd by running floyd ping <alias>. This ping uses the standard BaseUDP protocol, and any BaseUDP agent (such as a radio) will respond to it.

Sending Radio messages

Floyd has a barebones implementation of the radio protocol. To use it, type floyd send <alias or objid> <text message>. You can send messages to other floyds or radios this way.

Finding your friends

The most interesting feature of Floyd is his ability to help you find people. Every Floyd is keeping track of the people it sees, recording when and where it saw them. Floyds will happily share this information with anyone who asks. To try this out, ask your Floyd floyd where is Nelson - it will broadcast your request to all the other Floyds, collect the replies, and tell you where all Nelson has been seen. You can also ask floyd last Nelson to just find out when the last time your Floyd saw Nelson.


Caveats

There are at least three different Object IDs that can refer to the same object. My Floyd can be :floyd@nelson.santafe.edu/8702, :floyd@192.12.12.195/8702, or even plain :floyd. The problem is that multiple names cannot be assigned to one alias, so conflicts can happen. Some effort has been made to protect against the worst cases, but conflicts might still occur. In addition, this means that Floyd can't traslate an object ID into an alias, making the output ugly.

Floyd is designed to be somewhat safe, but is not for ultrasecurity. Malicious agents could easily force your Floyd to register a whole bunch of aliases, gunking up your database. Floyd is writing some data to disk, so conceivably could do some damage (fill a disk quota, for instance). The code to insure that certain commands only come from you, the master, is not very secure. Some of the problems are easy to fix, some are a pain, and some might be impossible.

In addition, Floyd is not particularly designed for privacy. Floyd does not have any facility to hide his database from anyone who queries it. Floyd is rather simpleminded in his desire to monitor the movements of agents and report them to whomever asks. The basic design of Floyd is for sharing information openly. I think this makes for an interesting experiment: discussion about the implications of the openness are welcome.


References

Here's floyd.tar.gz unpacked.
Nelson Minar <nelson@santafe.edu>
Last modified: Sun Mar 10 21:44:39 MST 1996