VILLASframework
Modular co-simulation framework
Custom VILLAS Binary

We designed a lightweight message format (or protocol) to facilitate a fast transmission with minimal (de-)serialization overhead. The on-wire format of the network datagrams is not subject to a standardization process.

In constrast to the Custom VILLAS Human Readable format, this binary format is space efficient and commonly used for network communication.

Usually a a simulator sends one message per timestep. A message contains a variable number of values. Each message contains a header with the following fields:

  • 32 bit floating-point or integer values
  • 32 bit timestamp (integral seconds)
  • 32 bit timestamp (integral nanoseconds)
  • 16 bit sequence number
  • 4 bit version identifier

Timestamps are represented in Unix time.

The format of the packets is described by the following code:

msg_format.svg

For now, only the first message type (data) is used. Therefore the complete protocol is stateless. Later we might want to support more complex simulation scenarios which require some kind of controlling.

All values are sent in network byte order (big endian)!

See also
msg for implementation details.

Implementation

The source code of the format-type is available here: https://git.rwth-aachen.de/acs/public/villas/node/-/blob/master/lib/formats/villas_binary.cpp

Configuration

The Custom VILLAS Binary format-type supports all generic format options.

In addition the following settings are supported:

source_index (integer) = 0

Configures the source index field which is a 8bit field in the packet header.

Example Configuration

nodes = {
node = {
type = "file"
uri = "/dev/null"
format = {
type = "villas.binary"
source_index = 99
}
}
}

Example Payload

wireshark_udp.png
Wireshark capture of UDP traffic