Skip to content
← All work

Engineering

UDP Communication for Healthcare

A custom UDP-based protocol for medical device communication: thousands of concurrent devices per node, sub-millisecond delivery for alarms and vital signs, encryption that costs microseconds, and failover measured in tens of milliseconds.

A hospital network connects thousands of devices to a small number of servers, and the messages that matter most, alarms and vital signs, cannot wait behind the ones that matter least. TCP is the wrong tool at that density. The protocol replaces it with reliability built at the application layer, encryption designed for the latency budget, and failover at every level from the network path to the server cluster.

Why not TCP

TCP's head-of-line blocking means that when one packet is lost, everything behind it on that connection waits for the retransmission. With more than 3,000 connected devices, the connection management alone consumes a large share of server resources, and one network disruption can turn into a system-wide latency spike. A medical network needs the opposite property: a lost packet delays one message, never the stream.

What we built

  • Per-message selective acknowledgment, so a lost message never blocks the others.
  • Forward error correction that reconstructs lost packets without retransmission for up to 5% packet loss.
  • Priority-based quality of service. Alarms and vital signs get guaranteed delivery inside strict latency bounds; lower-priority telemetry tolerates best-effort delivery.
  • Security built for the latency budget. DTLS 1.3 for the handshake and key exchange, then AES-128-GCM for the session, adding 28 bytes per message and under 50 microseconds of processing. Devices authenticate with certificates from the hospital's own PKI, with automatic rotation. Every message is authenticated and encrypted, every session is logged with tamper-evident audit trails, and a device cannot negotiate down to weaker encryption.
  • Dual-path connectivity. Each device holds connections over two independent network paths, typically wired and wireless, with handover in under 50 ms when the primary path degrades.
  • Active-active server clustering with distributed consensus for device session state, so an endpoint failure causes no message loss.
  • Device-side store-and-forward buffers that hold up to 60 seconds of data through a total network outage.
  • Device lifecycle support: discovery, health monitoring, firmware updates over the air and automatic failover between redundant paths.
  • HL7 integration: captured data is parsed to HL7 and routed through a message bus to storage, real-time visualization, clinical alerting and hospital information systems.

Validation

Medical device software has a high bar, and the validation was built to be reviewed. Unit tests with full branch coverage of the protocol state machine. Integration tests with hardware-in-the-loop simulators for 15 device types. Stress tests with 5,000 simulated devices generating realistic traffic for 72-hour continuous runs. Fault injection that degrades the network with packet loss, reordering, duplication and latency spikes while the safety invariants are checked. A protocol fuzzer that feeds the parser malformed messages. The suite runs in CI, every release must pass it, and every result is traceable to a requirement. The design follows the security requirements hospitals audit medical device communication against, and the failover chain is exercised in quarterly chaos engineering drills.

In use

An infusion pump on a ward with weak Wi-Fi switches to its wired path in the time between two heartbeats. A monitor's alarm arrives at the clinical alerting system ahead of the telemetry queued behind it. A server node is taken out for maintenance and no device notices, because the consensus protocol already gave the next node the session state. A compliance officer opens the dashboard and sees every connection measured against the policy.

Where it fits

Medical device networks, and any environment with thousands of devices per server where alarms must beat telemetry: hospitals, device manufacturers, high-density industrial sensing.

What we learned

Security and latency only conflict if the handshake and the session use the same mechanism. Reliability at the application layer is more work than TCP and the only way to get the priorities a hospital needs. And the test suite is part of the product: for medical software, the evidence that it works is a deliverable.

Technology

A UDP-based protocol with per-message selective acknowledgment, forward error correction and priority-based quality of service. DTLS 1.3 key exchange with AES-128-GCM sessions. Device certificates from the hospital PKI. Dual-path connectivity. Active-active clustering with distributed consensus. Device-side store-and-forward. HL7 parsing and a message bus. Hardware-in-the-loop simulation, fault injection and protocol fuzzing in CI.

Production Notes

All notes