UDP Protocol
AdaTrack prioritizes the User Datagram Protocol (UDP) for telemetry ingestion due to its minimal overhead, which is critical for battery-powered IoT devices and unreliable network environments.
The UDP Advantage
While TCP provides reliability through handshakes and acknowledgments, these mechanisms introduce significant data overhead and power consumption. For many IoT sensors, the TCP handshake can be larger than the actual data being sent.
UDP allows for a "fire-and-forget" model:
Lower Latency: No connection setup or teardown.
Lower Bandwidth: Minimal header size (8 bytes).
Power Efficient: Radio remains active for a shorter duration.
Data Packet Structure
While your specific payload is flexible (decoded via Custom Decoders), AdaTrack recommends a standard envelope for secure and reliable transmission:
Device ID
16 Bytes
Unique identifier (UUID).
Timestamp
8 Bytes
UNIX Epoch (Big Endian). Used for ordering and replay protection.
Payload
Variable
Your proprietary binary sensor data.
Signature
32 Bytes
HMAC-SHA256 signature for authentication.
Ingestion Pipeline
When a UDP packet arrives at our ingestion endpoint (Port 1234):
Kernel Ring Buffer: The packet is read from the Linux kernel ring buffer. Our servers are tuned with large
rmembuffers to absorb micro-bursts of traffic.HMAC Verification: The backend fetches the device's shared secret and verifies the
Signature. If the signature is invalid or theTimestampis too old (> 5s), the packet is rejected.Decoding: The
Payloadbytes are passed to the Goja JS VM for processing.Storage & Distribution: The resulting JSON is stored in TimescaleDB and broadcast to connected WebSockets for real-time map updates.
Network Configuration (Self-Hosted)
If you are hosting your own AdaTrack instance, ensure your network and OS are optimized:
Firewall: Allow incoming UDP traffic on your configured ingestion port (Default:
1234).Kernel Tuning: Increase the maximum receive buffer size to prevent packet loss during high traffic.
Worker Pools: Configure the backend worker pool size based on your CPU cores to ensure parallel HMAC and decoding processing.
Reliability over UDP
Since UDP is connectionless, it does not guarantee delivery. AdaTrack handles this at the application layer:
Idempotency: We use the device-provided timestamp to ensure that duplicate or out-of-order packets do not corrupt your historical data.
Sequence Tracking: The system can detect missing packets by analyzing the gaps in received timestamps.
Last updated