Chapter 3. ClusterNetwork

Table of Contents

Description
Configuring the ClusterNetwork

Description

The Cluster Network provides each plugin with a representation of the cluster as a system of interconnected nodes and defines an interface for exchanging message packets between nodes.

The packets are structured in a way to allow the ClusterNetwork to take a given packet, serialize it to a string of characters and send the string to a remote node. When received this string is de-serialized into a packet object again. This is accomplished by having a packet header, as seen in Figure 3.1, “Packet Structure”, that begins all packets. This header contains integers representing the packet type and the packet length. In order to allow the objects to be serialized and de-serialized into different formats we took advantage of the ObjectReader and ObjectWriter abstractions within Vapor, VR Juggler's system abstraction module. This enables us to serialize the packets into many different formats such as a string of characters or even an XML tree.

Figure 3.1. Packet Structure

Packet Structure

The process of reading the header, determining the packet type, creating the packet structure, and de-serializing the data can be a very tedious task. Because of this, we have created a packet factory, seen in Figure 3.2, “Class Diagram: PacketFactory”, that automates this process. This simplifies code and eliminates one location of possible errors.

Figure 3.2. Class Diagram: PacketFactory

Class Diagram: PacketFactory

As you can see from Figure 3.3, “Class Diagram: ClusterNetwork”, the ClusterNetwork has been designed to have a very intuitive API without any reference to any other sub-systems of ClusterJuggler. The ClusterNetwork provides everything that a programmer needs to send messages between nodes in a cluster. It is also because of this robust design that it is possible to develop a replacement for the ClusterNetwork that might use a different low level networking technique.

Figure 3.3. Class Diagram: ClusterNetwork

Class Diagram: ClusterNetwork