TCP/IP Transport¶
Overview¶
Networked ANURA transceivers (such as the TR1) expose the Transceiver API over a TCP/IP transport. This transport provides reliable, stream-oriented communication over standard TCP/IP networks.
Connection Parameters¶
Parameter |
Value |
|---|---|
Protocol |
TCP |
Port |
7645 |
IP Address |
Dynamic (obtain via e.g. mDNS or DHCP lease table) |
Frog Fact
At the time the port number was selected, amphibiaweb.org listed 7645 species in the order Anura (frogs and toads).
Message Framing¶
CBOR-RPC messages are transmitted over the TCP stream with a simple length-prefixed framing protocol:
Length Prefix: Each message begins with a 16-bit unsigned integer in big-endian byte order, indicating the length of the following CBOR payload in bytes.
CBOR Payload: Immediately following the length prefix is the CBOR-encoded message payload.
The maximum message size supported by the framing protocol is 65,535 bytes (2¹⁶ - 1). In practice, this is further limited by device-specific constraints.
Framing Format¶
Field |
Size |
Description |
|---|---|---|
Length |
2 bytes |
Big-endian uint16 indicating payload length |
Payload |
N bytes |
CBOR-encoded message (N = value of Length field) |
Connection Lifecycle¶
Transceiver implementations expect a single client connection that remains open indefinitely for the duration of monitoring operations.
Connect: Client establishes TCP connection to transceiver on port 7645.
Keep-Alive: Client must send a request at least once every 5 seconds. The transceiver will close the connection if no message is received within this interval. (The
pingmethod exists for this purpose.)Exchange Messages: Client and server exchange length-prefixed CBOR-RPC messages.
Disconnect: Either party may close the TCP connection at any time.
Note
While the transceiver accepts multiple concurrent client connections, this is not a supported use case for production deployments. Concurrent connections may be useful for debugging purposes, such as using a CLI test client to probe a transceiver that is otherwise managed by a monitoring system.
Example Message Frame¶
Consider a simple request to call the ping method:
CBOR Message: [0, 1, "ping", null]
Encoded CBOR (hexadecimal): 84 00 01 64 70 69 6E 67 F6
Complete TCP Frame:
Data (hexadecimal) |
Description |
|---|---|
|
Payload Length (big-endian): 0009h = 9 bytes |
|
CBOR Payload: |