Binary protocol

From collectd Wiki
Revision as of 21:18, 27 April 2009 by Octo (talk | contribs) (Added some very basic initial information.)

Jump to: navigation, search

Until the network plugin has been factorized out into a library, it is useful to have some documentation to reimplement it.

Well-known numbers

Default UDP port
25826
Default IPv4 Multicast group
239.192.74.66
Default IPv6 multicast group
ff18::efc0:4a42

Protocol structure

Beginning of each “part”: Type and length.

Each packet consists of one or more so called “parts”. Each part starts with the same four bytes: Two bytes that specify the “part type” (what kind of information is enclosed in the part) and two bytes which specify the length of the part, including the four header bytes itself. The maximum length of payload in any part is therefore 65531 bytes.

Using this layout, clients can determine the length of a part they don't know and lets them skip unknown data. This makes the protocol forward compatible so that new features can be added easily.

Implementations

See also