This article details the architectural challenges of maintaining reliable telemetry in high-latency, unreliable network environments, specifically with Windows CE devices. It explains how standard TCP/IP limitations like window exhaustion and head-of-line blocking fail in these scenarios. The solution presented is a custom application-layer sliding window protocol over UDP to ensure timely data delivery by prioritizing freshness over absolute completeness.
Read original on Dev.to #systemdesignWhen building systems for unreliable networks, especially with embedded devices like the Windows CE device mentioned, standard Transmission Control Protocol (TCP) can become a bottleneck. The article highlights how TCP Window Exhaustion occurs when acknowledgments (ACKs) are delayed due to high Round Trip Time (RTT), causing the sender's buffer to fill up and cease transmission. This is exacerbated by Head-of-Line (HoL) Blocking, where the retransmission of a lost packet delays all subsequent packets, even if they've already arrived, due to TCP's strict in-order delivery guarantee.
Why TCP Configuration Isn't Always the Answer
Architects often consider tuning OS-level TCP parameters. However, in constrained environments like Windows CE, this is often infeasible due to: 1. Inflexibility: Registry changes might require reboots, preventing dynamic adjustment. 2. Memory Constraints: Large TCP buffers can exhaust limited RAM on embedded devices. 3. Application Requirements: TCP's strict ordering is unsuitable for real-time data where freshness is paramount, and old data is irrelevant.
To overcome TCP's limitations, the team implemented a custom sliding window protocol directly at the application layer, using UDP as the underlying transport. This approach gives the application full control over packet pacing, ordering, buffer management, and retransmission policies, decoupling application state from the OS network stack.
This case study underscores critical lessons for designing robust distributed systems, especially at the edge or with IoT: