Sequence and Freshness Checks for Agent-Facing Sensor Streams: A Pre-Registered Measurement over MQTT, Zenoh, ROS 2 and MCP
Language-model agents increasingly read sensor data through general-purpose middleware. A consumer that trusts whichever message arrived last can be misled by duplicated, reordered or stale readings. The usual defence is a receiver-side check that accepts a reading only if its sequence number and source timestamp advance. We measured its cost and whether it needs its own protocol. One Python implementation ran unchanged over MQTT, Zenoh, ROS 2, the Model Context Protocol (MCP) and a direct TCP path in five pre-registered phases (635 timed runs). The check removed every injected duplicate and reordering, as its definition guarantees, and worked as well in plain message fields as in a custom frame. Its tail-latency cost was small, at most about 2ms at p99, but was not reproducible: the same configuration passed and failed a pre-set 1.25×p99 limit in different sessions, and no part of the cost could be attributed to the check. A dedicated delivery path gave no robust advantage, while the transport’s loss recovery and whether the agent was pushed data or polled for it changed outcomes by up to two orders of magnitude. All measurements come from one host over loopback; most receivers were unauthenticated and kept state in memory.
Authors
- Ibrahim Hilali
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-28
- DOI
- https://doi.org/10.5281/zenodo.24631553
- Primary Topic
- Distributed systems and fault tolerance
- Type
- preprint