-
Notifications
You must be signed in to change notification settings - Fork 0
protocol definition
RRDTP version 1 is a data streaming protocol. One host acts as the server, and is the authoritative source for all data values. Multiple clients can connect to the server to send and receive updates to data values. Values can be stored hierarchically in categories.
Each packet will contain an event type. The currently defined event types are listed below.
- Value update: sent to indicate that a value was updated. Either a client, or the server can send this type of packet.
Values can be one of 7 types.
- int - signed 32-bit integer
- long - signed 64-bit integer
- float - single precision floating point number
- double - double precision floating point number
- boolean - true/false boolean flag
- string - string (ASCII or UTF8)
- unformatted - plain unformatted data. The calling code is responsible for endianness conversion.
Values are identified by a hierarchical naming scheme similar to Java packages. If the value isn't stored in any category, then it can be referred to simply by its name, such as "value1". If the value is stored within a category and any number of subcategories, then it can be referred to by separating the categories with a period ".", for example "category.sub-category.value1". Valid characters that can be used in category and value names are letters, numbers, underscores "_", and hyphens "-". Identifiers are case sensitive ("Value1" != "VALUE1" != "VaLuE1"). Value identifiers are always specified as ASCII format strings ending in a null terminator.
Each RRDTP packet begins with a header containing the 4-bit protocol version number, and the 4-bit event type (see Events section above). The rest of the packet format depends on the event type.
A "value update" packet (2) has a different function depending on where it was sent from. Values are owned by either a client, or the server. The first system to create a value is considered the owner. When the server receives a value update packet from the owning client, the value will be updated on the server and propagated to all other clients. If a client tries to update a value that it doesn't own, then the packet is ignored. The server will send a value update packet to all clients whenever a value changes. A value update packet contains the packet identifier, the data type ID (4-bits), the size of the data (16-bits), and the data itself.