Network Protocols

A node on the network can provide multiple services. Each service resides on a specific TCP and UDP port of the node.

Connections via TCP provide a feedback if the command issued to the node has arrived or if a time out has occurred. Connections via TCP are also able to read responses from the node.

Commands via UDP are also accepted. These packets will not produce any response from the node and are not guaranteed to arrive the node but are faster and produce less overhead.

Packet Formats

When connecting via TCP the following two formats can be used to transmit data to the node:

The ASCII Protocol

Position 1 2 2 + n 3 + n
Description 'C' = 0x43 n bytes data <CR> = 0x0D <LF> = 0x0A

This format can only be used if the data block does not contain bytes with values of 0x0C or 0x0A.

The Binary Protocol

Position 1 2 3
Description 'B' = 0x42 Length of data block in bytes Data

This format can be used if the contents of the data block are unknown or can contain bytes with values of 0x0C or 0x0A.

These two formats are used to allow access via a normal terminal program as well as transmitting binary data.

Return Codes

The response to one of these commands is either 'N' or 'A':

Response Description
'A' Packet was transmitted successfully
'N' Packet was not transmitted successfully

If a time out occurs the packets has to be regarded as not been sent successfully.

Return Data

If the packet was delivered successfully the node may send a response. This response may either be in the ASCII or binary formats as described above. The client has to be able to parse both formats.

The node may also produce messages by it self. These messages are not related to a packet sent to the node.

To distinguish replies to commands from these unsolicited messages the formats above are slightly modified:

ASCII Protocol:

Position 1 2 2 + n 3 + n
Description 'c' = 0x63 n bytes data <CR> = 0x0D <LF> = 0x0A

Binary Protocol:

Position 1 2 3
Description 'b' = 0x62 Length of data block in bytes Data

UDP packets just contain the plain binary packet data to be transmitted to the node. It is not possible to receive a
response from the node if the packet containing a command is sent via UDP.

  • projekte/uberbus/protocols.txt
  • Last modified: 2021/04/18 12:35
  • by 127.0.0.1