Addressing module specification

Addressing module specification
SchemeStation documentation

1 Introduction

SCHEMESTATION uses random 256 bit identifiers to address agents. The 256-bit size ensures that it is very hard to guess an address of a specific agent. ([1] gives some elucidating examples about how hard it would be).

These identifiers (that will be referred to as agent specifiers) are unique within a domain.

The specifiers have to be mapped to the actual agent entries in the domains scheduling system. If the corresponding agent has migrated away, the agent specifier within a domain might also map to another agent specifier in another domain. Also, the kernel agent and other such special agents would need their own type of addresses, as would the external agents.

2 Requirements

An Agent specifier can map to

The addressing system has to provide the means for adding agent specifier entries, replacing them (eg. resetting the address for a specifier), efficiently searching them by the specifier and searching them by the address. Removing entries has to be possible, also.

It must be possible for the user to generate an (unique) agent specifier, and compare it to another.

There can be several thousand agent specifier entries in the addressing system, and yet the searching and addition operations must be done in reasonable time. This implies that the addressing system might need to use a kind of hash table to store the entries.

There must be a way to save the addressing system to the disk in order to initiate a controlled system shutdown for persistence (and of course means to load the saved state back).

Since the virtual machine may block the execution of an agent, there has to be a storage queue for the messages. It is natural to store the messages along with the addressing entry, so we demand that the addressing system is able to maintain the queue.

3 Functionality

The addressing system is first initialized using addr_initializeaddrsystem. The user can generate random specifiers using addr_generatespecifier.

An entry that consists of a specifier and an address, can be added to the data structure using using addr_addentry-function. If there is need to reset the address of an entry, it should be done using the addr_setentry-function instead of deleting and adding the entry again. This holds the message queue of the entry intact. Entries can be deleted using the addr_deleteentry or addr_deleteentriesbyaddress function, if the address instead of the specifier is known.

Addresses can be compared using addr_cmpraddr and specifiers using addr_cmprspec functions.

An entry can be sought by the specifier using addr_addrbyspec, which returns a pointer to the address. The pointer is valid as long as the entry is removed from the system (since the caller could have no way of knowing whether an entry is removed, he can only trust the entry being valid as long as he does not give the control back to the addressing system). addr_specsbyaddr takes an address as the argument and returns a caller-freed array of matching specifiers.

The addressing system can be saved to disk in order to initiate a system shutdown using addr_savetodisk. The system can then be recovered using addr_readfromdisk

For debugging purposes, there is the addr_dumpaddrsystem function that gives an ascii representation of the whole addressing system to stdout.

When the virtual machine sets an agent to blocking state, it calls addr_setmessageblocking that sets the blocking-bit of the correspondent entries to indicate, that the agent can not receive messages. (Recall, that there might be several entries and thereby several message queues per agent.)

Before the shutting down the system, one should call addr_shutdownaddrsystem to free the memory used by the addressing system.

4.2.15 The functions of module Addressing


File addressing-internal.h

C-functions:


File addressing.h

C-functions:


[1] Scheneier, Bruce. Applied Cryptography : Protocols, Algorithms, and Source Code in C, 2nd ed. 1995, John Wiley & Sons