|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +sidebar_label: Introduction |
| 4 | +title: TagoTiP - Transport IoT Protocol |
| 5 | +slug: /tagotip/ |
| 6 | +--- |
| 7 | + |
| 8 | +# TagoTiP - Transport IoT Protocol |
| 9 | + |
| 10 | +Send IoT data to TagoIO in **130 bytes** instead of 487. No JSON, no HTTP headers - just a single human-readable line your microcontroller can build with `sprintf`. |
| 11 | + |
| 12 | +``` |
| 13 | +PUSH|4deedd7bab8817ec|sensor-01|[temperature:=32.5#C;humidity:=65#%] |
| 14 | +``` |
| 15 | + |
| 16 | +## Why TagoTiP? |
| 17 | + |
| 18 | +| | HTTP/JSON | TagoTiP | TagoTiP(s) (encrypted) | |
| 19 | +|---|---|---|---| |
| 20 | +| **Payload size** | ~487 bytes | ~130 bytes | ~119 bytes | |
| 21 | +| **vs. HTTP/JSON** | - | 3.7x smaller | 4.1x smaller | |
| 22 | +| **TLS required?** | Yes | Recommended | No - AEAD encryption built-in | |
| 23 | +| **Parse complexity** | JSON parser | Linear scan, no backtracking | Envelope + linear scan | |
| 24 | + |
| 25 | +### Built for constrained devices |
| 26 | + |
| 27 | +- **Human-readable** - debug frames in a terminal, compose them by hand |
| 28 | +- **Type-safe** - explicit operators for numbers (`:=`), strings (`=`), booleans (`?=`), and locations (`@=`) |
| 29 | +- **C-friendly** - predictable buffer sizes, no dynamic allocation, linear parsing |
| 30 | +- **Compact** - variable, value, unit, timestamp, group, location, and metadata in a single frame |
| 31 | +- **Transport-agnostic** - works over UDP, TCP, HTTP(S), MQTT, or any byte-capable channel |
| 32 | + |
| 33 | +## Encryption without TLS |
| 34 | + |
| 35 | +Need security on raw UDP or constrained links where TLS is too expensive? **TagoTiP(s)** wraps frames in an AEAD authenticated encryption envelope - as little as **29 bytes** of overhead, with built-in replay protection and integrity verification. |
| 36 | + |
| 37 | +| Cipher Suite | Key | Tag | Envelope Overhead | |
| 38 | +|---|---|---|---| |
| 39 | +| **AES-128-CCM** | 128-bit | 8 B | 29 bytes | |
| 40 | +| AES-128-GCM | 128-bit | 16 B | 37 bytes | |
| 41 | +| AES-256-CCM | 256-bit | 8 B | 29 bytes | |
| 42 | +| AES-256-GCM | 256-bit | 16 B | 37 bytes | |
| 43 | +| ChaCha20-Poly1305 | 256-bit | 16 B | 37 bytes | |
| 44 | + |
| 45 | +Learn more in the [Encryption](./specification/encryption) guide. |
| 46 | + |
| 47 | +## How it compares |
| 48 | + |
| 49 | +### TagoTiP vs. other IoT data formats |
| 50 | + |
| 51 | +| | TagoTiP | HTTP + JSON | MQTT + JSON | Protobuf | |
| 52 | +|---|---|---|---|---| |
| 53 | +| **Typical payload** | ~130 bytes | ~487 bytes | ~210 bytes | ~80 bytes | |
| 54 | +| **Human-readable** | Yes | Partially | Partially | No | |
| 55 | +| **Schema required** | No | No | No | Yes | |
| 56 | +| **Debug in a terminal** | Yes | Verbose | Binary framing | No | |
| 57 | +| **Build with `sprintf`** | Yes | Complex | Needs MQTT library | Needs code generator | |
| 58 | +| **IoT type system** | Built-in (number, string, bool, location) | Application-defined | Application-defined | Schema-defined | |
| 59 | +| **Metadata, unit, group, timestamp** | Native syntax | Application-defined | Application-defined | Schema-defined | |
| 60 | + |
| 61 | +### TagoTiP(s) vs. other IoT security |
| 62 | + |
| 63 | +| | TagoTiP(s) | TLS 1.3 | DTLS 1.2 | |
| 64 | +|---|---|---|---| |
| 65 | +| **Handshake** | None - 0 bytes | ~2-4 KB | ~2-5 KB | |
| 66 | +| **Round trips before first data** | 0 | 1-2 | 2-3 | |
| 67 | +| **Per-message overhead** | 29-37 bytes | ~29 bytes + TCP | ~29 bytes | |
| 68 | +| **Session state** | Stateless | Per-connection | Per-connection | |
| 69 | +| **Certificate management** | None | Required | Required or PSK | |
| 70 | +| **Works over raw UDP** | Yes | No | UDP only | |
| 71 | +| **Works without TCP** | Yes | No | UDP only | |
| 72 | + |
| 73 | +## Quick example |
| 74 | + |
| 75 | +Push a temperature reading with unit, timestamp, and metadata - all in one frame: |
| 76 | + |
| 77 | +``` |
| 78 | +PUSH|4deedd7bab8817ec|sensor-01|@1694567890000^batch_42{firmware=2.1}[temperature:=32.5#C;position@=39.74,-104.99] |
| 79 | +``` |
| 80 | + |
| 81 | +Pull the last value back: |
| 82 | + |
| 83 | +``` |
| 84 | +PULL|4deedd7bab8817ec|sensor-01|[temperature] |
| 85 | +<- ACK|OK|[temperature:=32.5#C@1694567890000] |
| 86 | +``` |
| 87 | + |
| 88 | +## SDKs |
| 89 | + |
| 90 | +All language SDKs share a single Rust core (`tagotip-codec`, `no_std`), so parsing and frame building behave identically everywhere. |
| 91 | + |
| 92 | +| Package | Language | Install | |
| 93 | +|---------|----------|---------| |
| 94 | +| [`@tagoio/tagotip`](https://github.com/tago-io/tagotip-sdk/tree/main/tagotip-node) | TypeScript / Node.js | `npm install @tagoio/tagotip` | |
| 95 | +| [`tagotip`](https://github.com/tago-io/tagotip-sdk/tree/main/tagotip-go) | Go | `go get github.com/tago-io/tagotip-sdk/tagotip-go` | |
| 96 | +| [`tagotip`](https://github.com/tago-io/tagotip-sdk/tree/main/tagotip-python) | Python | `pip install tagotip` | |
| 97 | +| [`TagoTiP`](https://github.com/tago-io/tagotip-sdk/tree/main/tagotip-arduino) | C / Arduino | Arduino Library Manager | |
| 98 | +| [`tagotip-codec`](https://github.com/tago-io/tagotip-sdk/tree/main/tagotip-codec) | Rust | `cargo add tagotip-codec` | |
| 99 | + |
| 100 | +Browse the full SDK source at [github.com/tago-io/tagotip-sdk](https://github.com/tago-io/tagotip-sdk). |
| 101 | + |
| 102 | +## Open source |
| 103 | + |
| 104 | +TagoTiP is open source under the [Apache License 2.0](https://github.com/tago-io/tagotip). Implement clients, servers, libraries, or gateways - for any purpose, including commercial use. |
0 commit comments