Software
protobuf_comm
By Fawkes Robotics, from github.com/fawkesrobotics/protobuf_comm (opens in a new tab)
- Middleware
- Library
- GPL-2.0-only
A lightweight C++ library for sending Protocol Buffers messages over a network, with a framing protocol that adds length, type and optional AES encryption.
Facts
- GitHub stars
- 1read on 28 Nov 2026
- Last update
- 25 Jun 2026Newest commit on main
- Maintenance
- Maintaineda commit in the last 12 months
- Difficulty
- Advanced
Checked on GitHub on 28 Nov 2026.
Licenses
- Code
- GPL-2.0-only (opens in a new tab)
Read by Robotheca from LICENSE (opens in a new tab) (GPL-2.0-only) at commit 9284c51 (opens in a new tab), on 16 Oct 2026.
- Commercial use
- Yes
Copyleft: Modified source must be published.
At a glance
- What it is
- Works with proto 2 messages that each carry a CompType enum holding a unique component ID and message type.
- Wraps serialized protobuf messages in an eight-byte frame header and a four-byte message header.
- Supports per-message encryption using AES-128 or AES-256 in ECB or CBC mode, with an initialization vector for CBC.
- Encodes header numbers in network byte order so receivers can read the payload size and message identity correctly.
- Was created by Tim Niemueller as a component for the referee box of the RoboCup Logistics League.
Robotheca's summary of the project's documents, not the creator's words.
- Robots on Robotheca
- No robot on Robotheca uses it yet.
- Licence
- GPL-2.0-only. Commercial use: Yes. Where it was read
- Install
- In the creator's words: The project's README (opens in a new tab)
- Maintenance
- Maintained, last commit on 25 Jun 2026.
Use it
How to install it, in the creator's words: The project's README (opens in a new tab)
Robotheca doesn't review code. Read it before running it.
Files and versions
- Repository on GitHubgithub.com/fawkesrobotics/protobuf_comm (opens in a new tab)
- The version Robotheca read9284c51 (opens in a new tab)
- Latest release0.9.2 (5 Apr 2024)
Robotheca never hosts the code: each link goes to the creator's own page.
The README
The creator's own README, copied as written: README.md by Fawkes Robotics, at commit 9284c51, under GPL-2.0-only (opens in a new tab). The original on GitHub (opens in a new tab).
Read the README here
protobuf_comm
protobuf_comm is a lightweight communication library for Protocol Buffers (opens in a new tab).
It supports messages written using proto 2 syntax and additionally requires every defined message to have a CompType enum containing a unique message ID (composed of a COMP_ID and MSG_TYPE), e.g., as shown below:
message SearchRequest {
enum CompType {
COMP_ID = 100;
MSG_TYPE = 1;
}
required string query = 1;
}
Using this unique identifiers, protobuf_comm defines a simple [framing protocol](#Framing Protocol) that it relies on to (de)-serialize messages.
Protocol Buffers Overview
Protocol Buffers (protobuf) are a data format used for serialisation of structured message data. The format is extensible and provides for basic data types, nesting, structure re-use, efficient serialization and deserialization, and variable-length lists. The message types are defined in a special definition language akin to C/C++ structs. In order to easily serialize and deserialize data in the protobuf format, special compilers are provided. These take the protobuf message definition and automatically create code for creating and reading messages in the provided protobuf definitions in common languages like C++, Java or Python.
Framing Protocol
Since serialized protobuf message do not contain information about the message length or type, or additional space for additional meta data like encryption-related information, a framing protocol is used which wraps the serialized protobuf messages and allows for easier handling of the messages on the receiver's side. The protocol consists of two parts, a protocol frame which contains the message-related meta data and a message header.
Each message that is sent over the network is prepended by the headers. The receiver can use the definition of the header and the information contained within to read the following serialized protobuf message correctly.
Header Format
Header messages must be 4-byte-aligned, i.e. the addresses of the data entries is evenly divisible by 4. The size of the frame header message structure sums up to exactly eight bytes when sent over the network, the message header will be exactly four bytes. All contained numbers must be encoded in network byte order (big endian, most significant bit first). The numbers are encoded as 8 (uint8 t), 16 (uint16 t) or 32 bit (uint32 t) unsigned integers respectively.
When sending a message over the network, first the protobuf message is serialized (to determine the payload size). Then the frame and message headers are prepared with the appropriate component ID, message type, and the payload size as just determined. Then the frame header is sent, possibly followed by an encryption IV, again followed by the message header and the serialized message. Examples of the message layout are provided in the following two figures:

Figure 1: Packet layout diagram for unencrypted messages.

Figure 2: Packet layout diagram for encrypted messages.
Frame Header
The frame header corresponds to the following C++ struct:
typedef struct {
/// Frame header version
uint8_t header_version ;
/// One of PB_ENCRYPTION_ *
uint8_t cipher ;
/// reserved for future use
uint8_t reserved_2 ;
/// reserved for future use
uint8_t reserved_3 ;
/// payload size in bytes
/// includes message and
/// header , _not_ IV
uint32_t payload_size ;
} frame_header_t ;
The following fields are contained:
- protocol version: The version of the protocol. The current protocol version is 2
- cipher: Indicates the cipher suite that is used. The following values can be used:
| Cipher | Byte | initialization vector size / Bytes |
|---|---|---|
| NONE | 0x00 | 0 |
| AES_128_ECB | 0x01 | 0 |
| AES_128_CBC | 0x02 | 16 |
| AES_256_ECB | 0x03 | 0 |
| AES_256_CBC | 0x04 | 16 |
- reserved: Currently unused for future extensions. Bytes must be set to 0.
- payload size: Size in bytes of the following payload. This does include the message header and the serialized protobuf message. It does not include an encryption IV header (if required by cipher). The payload size must be encoded in network byte order (big-endian).
The fields must be contained in the given sizes and order but do not need to be implemented as a C++ struct.
Message Header
The message header corresponds to the following C++ struct:
typedef struct {
/// component id ;
uint16_t component_id ;
/// message type
uint16_t msg_type ;
} message_header_t;
The following fields are contained:
- component ID: General ID, general addressee of message. For refbox message must be set to 2000 (as encoded in the protobuf messages’ COMP ID field of the CompType enum. The component ID must be encoded in network byte order (big-endian).
- message type: Numeric message ID of the specific message serialized in the payload. Must be the ID encoded in the MSG TYPE field of the CompType enum. The message type is specific to the component ID. Different component IDs can have message of the same message type which are unrelated. The message type must be encoded in network byte order (big-endian).
Encryption
The framing protocol supports per-message encryption based on a symmetric block cipher. For now, the supported encryption modes are based on AES with either 128 or 256 bit key length in either electronic code book (ECB) or cipher block chaining (CBC) mode.
An overview of the format of an encrypted message is given in the second figure above, contrasting the first figure which depicts an unencrypted message. It is similar to the unencrypted packet with two key differences. First, the initialization vector is placed between the frame and message headers. And second, the message header and protobuf payload are encrypted.
Acknowledgements
protobuf_comm was created by Tim Niemueller as a component for the referee box (opens in a new tab) of the RoboCup Logistics League (opens in a new tab).
Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.