Application Layer Networking
Introduction
The entire control software suite runs as several user-level threads on top of a linux computer. These threads, referred to from here forward as "Application layer networking," provide mechanisms for service discovery, data stream subscription, and command issuance over the network. Functionally, this software enables the use of more than one control station; communication with any node without prior knowledge of its address; interaction with the nodes from outside of the immediate network; runtime re-configuration of the entire system; and communication between over multiple, heterogeneous sub-networks. Furthermore, the code used to build the software maintains a level of modularity that has allowed for reliability, ease of upgrading, and the ability for entry-level programmers to contribute to the project.
The Modules
- Interface/Communication Block
As the name implies, the interface block provides an interface to some physical device. It might be a device on a serial port, a socket, or a video camera. It is responsible for initialization and reading from/writing to the device.
- Translation Block
Usually the device that is being interfaced to doesn't match the standard protocol that has been designed for messages internal to our system, and therefore requires an block to translate the internal and external messages. Examples are XML parsing/serialization hooked to a socket interface block to enable an external interface, or translating between proprietary sensor data from a serial interface block.
- Computation Block
Occasionally the task will also require that some computation is performed using the data made available by the interface/translation block combination. An example of this could be a filter implemented to condition the data coming in from a sensor. There are also cases where internal data needs to be processed pushed back to the system (I.E. no interface or translation blocks). An example of this is a waypoint tracker that accepts flight plans from other nodes and outputs velocity commands.
Application layer networking was formed based upon the idea that any task that needs to be implemented on a particular node can be represented by a combination of up to three different types of blocks. These blocks are as follows:
Each of these blocks are connected together using FIFOs. One block, which is a single thread, with the ability to connect to Rx and Tx FIFOs composes a "Threaded Pipe." This is the basis for the entire Application based networking. A diagram of the "Threaded Pipe" is shown below.
The combination of up to three of these threaded pipes, each one with a particular task as an interface block, translation block, or computation block, creates an "Interface." Each one of these interfaces completely defines the mechanisms necessary to implement a particular capability. Examples include interfacing to an outside network and providing address translation, reading from a sensor, actuating a controller, or providing a waypoint tracking autopilot. Adding a final component, a client list manager that provides a shared memory location to register new clients that are seen by the communications/interface block, the "Interface" is complete. A block diagram of the interface is shown below.
By linking two or more of these interfaces together, and sharing the client list between each, data can be transferred from one interface, such as a sensor, to another interface, such as a socket to an ad-hoc network. The intelligent routing of messages between interfaces is performed by a "Data Distribution" object. This object uses a destination address associated with each message and looks it up in the shared memory client list to determine the proper interface to push messages to. All internal messages have to go through the data distribution object, and it can therefore provide logging functionality if desired.
Another component, the "Capabilities Manager" object is used to aid in service discovery implementation. When each Interface Object is invoked, it registers the capabilities it enables with the Capabilities Manager object. This process of collecting the various capabilities allows for the complete specification of all data streams available for subscription and all accepted commands. This information is broadcast over the network at a fixed interval providing the basis for the service discovery mechanism
The "Capabilities Manager," "Data Distribution" object, and various interfaces together compose a "Network Appliance" as seen in the diagram below.
A large number of interfaces may be added to the "Network Appliance" enabling more functionality for the particular node.
Complicated devices can be managed by these objects in this way. Below is the block diagram for a "Network Appliance" that provides interfaces to an 802.11 ad-hoc network, an 802.15.4 network with address translation, an 802.3 network with XML translation, and provides a human interface by implementing a GUI with an optional live video display from other nodes on the network.