BlueZero (BØ)
Middleware for distributed applications
Protocol

This page describes the BlueZero protocol. Knowledge of the communication protocol is not required to use the BlueZero library, but serves as a specification for re-implementing BlueZero.

Introduction

The transport of messages exchanged between BlueZero nodes and the resolver node is implemented with ZeroMQ.

The messages are defined using Google Protocol Buffers.

Message payloads (used by BlueZero sockets) are wrapped in a b0::core_msgs::MessageEnvelope message.

The network architecture is mostly centralized: every node will talk to the resolver node, except for services which use dedicated sockets, and topics which use a XPUB/XSUB proxy.

The resolver node offers one service ('resolv'), and also runs the XPUB/XSUB proxy.

There are three main phases of the lifetime of a node:

Node startup

In the startup phase a node must announce its presence to the resolver node via the b0::resolver_msgs::AnnounceNodeRequest message. The resolver will reply with the b0::resolver_msgs::AnnounceNodeResponse message, containing the final node name (as it may be changed in case of a name clash) and important info for node communication, such as the XPUB/XSUB addresses.

msc_node-startup

Topics

As part of the node graph protocol, if the node subscribes or publishes on some topic, it will inform the resolver node via the b0::resolver_msgs::NodeTopicRequest message.

msc_graph-topic

Services

If the node offers some service, it will announce each service name and address via the b0::resolver_msgs::AnnounceServiceRequest message.

msc_node-startup-service

Additionally, as part of the node graph protocol, if the node offers or uses some service, it will inform the resolver node via the b0::resolver_msgs::NodeServiceRequest message.

msc_graph-service

Normal node lifetime

During node lifetime, a node will periodically send a heartbeat to allow the resolver node to track dead nodes.

msc_node-lifetime

Topics

When a node wants to publish to some topic, it has to use the XPUB address given by resolver in the b0::resolver_msgs::AnnounceNodeResponse message. The payload to write to the socket is a b0::core_msgs::MessageEnvelope message.

msc_topic-write

Similarly, when it wants to subscribe to some topic, the messages are read from the XSUB socket.

msc_topic-read

Services

When a node wants to use a service, it has to resolve the service name to an address, via the b0::resolver_msgs::ResolveServiceRequest message.

msc_service-resolve

The request payload to write to the socket, as well as the response payload to be read from the socket, are a b0::core_msgs::MessageEnvelope message.

msc_service-call

Node shutdown

When a node is shutdown, it will send a b0::resolver_msgs::ShutdownNodeRequest message to inform the resolver node about that.

msc_node-shutdown

Additionally, it will send b0::resolver_msgs::NodeTopicRequest and b0::resolver_msgs::NodeServiceRequest to inform about not using or offering the topics or services anymore.

msc_graph-topic
msc_graph-service