Message Header

IOTMP Message Header

The header is the mandatory first part of every IOTMP message. It provides the essential metadata required to parse the message:

  • Message Type – identifies the purpose of the message.

  • Message Size – defines the length of the message body in bytes (excluding the header).

The header is encoded using varint fields, resulting in a minimum size of 2 bytes.

Field
Type
Mandatory
Description

Yes

Specifies the Message Size, without taking into account the header size.

Message Type

The Message Type field identifies the purpose of the IOTMP message. It is always present in the header and is encoded as a varint.

Message types define the control flow of the protocol, covering actions such as connection management, resource execution, error handling, and data streaming.

The protocol reserves specific numeric values for core operations, while leaving others available for future extensions. This ensures both compatibility and extensibility as new functionality is introduced.

The currently defined message types are:

Message Type
Value
Description

Reserved

0x00

Reserved field, not used

0x01

Acknowledges success

0x02

Indicates an error occurred

0x03

Initiates a connection and specifies its parameters

0x04

Terminates the current connection

0x05

Keep the connection open

0x06

Execute a specific resource on the client or server

0x07

Request a description of available resources

0x08

Starts a stream on the specified resource

0x09

Stops an active stream

0x0A

Transmits data for an active stream

Message Size

The Message Size field specifies the length of the message body, expressed in bytes. It does not include the size of the header itself.

  • Encoded as a varint.

  • Always present in the message header.

  • A value of 0 indicates that the message has no body (only a header).

This field enables the receiver to determine exactly how many bytes to read for the payload and when a message is complete.

Last updated

Was this helpful?