The Standby Uplink That Dies Quietly: Keepalive Timers Versus Segment Firewalls in IoMT Gateways

The failover path in most IoMT edge designs is a TCP connection that nobody uses until the primary gateway fails, and a stateful segment firewall has been quietly expiring it the whole time. Each half of the configuration passes review on its own. The gateway team sets keepalive behaviour in one repository, the network team sets flow idle timeouts in another, and nobody's diff contains both. You only find out the two values don't fit together when a patient monitor's alarm sits in a retransmission queue.

Why the failure hides

Picture a typical ward layout. Bluetooth LE wearables and bedside devices report to a pair of edge gateways, which publish upstream to the central monitoring consumer over medical device interoperability protocols such as IEEE 11073 SDC, with mutually authenticated TLS on every hop and a micro-segmentation firewall between the clinical VLAN and the data centre. The active gateway's connection carries continuous traffic, so the firewall keeps its flow entry fresh. The standby connection is idle by design: it finishes the TLS handshake, maybe renews a subscription, then sits there. When the firewall's idle timer runs out, it deletes the flow without sending anything, and both endpoints still think the socket is open. That leaves a half-open connection that every health check reports as up, because the checks run on the active path.

The parameter that decides it

On Linux the default net.ipv4.tcp_keepalive_time is 7200 seconds, and it only matters if the application turns SO_KEEPALIVE on at all, which many SDC and MQTT client stacks leave off unless you ask. Enterprise firewalls typically expire idle established flows much sooner. My rough estimate is about one hour on common vendor defaults, and clinical segment policies often tighten that further. So the first keepalive probe arrives after the flow is already gone. When the primary fails, the standby writes an alarm notification into a dead socket. The firewall drops it, or answers with a reset if it's configured to reject, and the kernel starts retransmitting with exponential backoff. With default retry limits, giving up can take around fifteen minutes by my estimate. For a monitoring system, that's an alarm delivered after the clinical decision it was meant to trigger.

A detection step for today

On each standby gateway, read net.ipv4.tcp_keepalive_time with sysctl, then run ss with its timer option against the uplink socket to the monitoring consumer: if the socket shows no keepalive timer, or one counting down from the kernel default, compare it with the established idle timeout configured on every stateful hop to the data centre, and if the keepalive interval isn't below half of the smallest of those timeouts, your failover path is already dead and simply hasn't been called on yet.

Making it fail in CI instead of on the ward

The rule that holds up in practice: the application keepalive interval, whether TCP keepalive or an SDC or TLS level heartbeat, must be less than half the shortest idle timeout of any stateful device on the path. Enforce it in a pipeline job that pulls both values from their source of truth, the gateway's deployment manifest and the firewall policy export, and fails the build when the relationship breaks. Back that with a scheduled drill: leave the standby idle for longer than the firewall timeout, fence the primary, and measure how long the first alarm takes to reach the consumer. Application heartbeats beat kernel keepalives here, because they also prove the TLS session and the SDC subscription are alive, not just the TCP flow. The cost is constant background traffic and log noise on every standby link in the hospital, and the next argument with the network team is whether to accept that or raise the idle timeout for this one flow class, which weakens the segmentation you put the firewall in for.

Wouldn't the standby reconnecting on demand when failover happens avoid all of this?

It avoids the half-open socket, but it puts a full TCP and mutually authenticated TLS handshake, plus SDC discovery and subscription, on the critical path at exactly the moment the system is degraded. That only works if the certificate store, the DNS path and the firewall rules for new flows are verified on the standby too, and those are usually the parts that drifted. A warm connection kept alive by heartbeats is cheaper to prove correct.

Back to HealthIoMT · Domains

← Back to HealthIoMT
Engineering & Architecture Brief

The Standby Uplink That Dies Quietly: Keepalive Timers Versus Segment Firewalls in IoMT Gateways

The failover path in most IoMT edge designs is a TCP connection that nobody uses until the primary gateway fails, and a stateful segment firewall has been quietly expiring it the whole time. Each half of the configuration passes review on its own. The gateway team sets keepalive behaviour in one repository, the network team sets flow idle timeouts in another, and nobody's diff contains both. You only find out the two values don't fit together when a patient monitor's alarm sits in a retransmission queue.

Why the failure hides

Picture a typical ward layout. Bluetooth LE wearables and bedside devices report to a pair of edge gateways, which publish upstream to the central monitoring consumer over medical device interoperability protocols such as IEEE 11073 SDC, with mutually authenticated TLS on every hop and a micro-segmentation firewall between the clinical VLAN and the data centre. The active gateway's connection carries continuous traffic, so the firewall keeps its flow entry fresh. The standby connection is idle by design: it finishes the TLS handshake, maybe renews a subscription, then sits there. When the firewall's idle timer runs out, it deletes the flow without sending anything, and both endpoints still think the socket is open. That leaves a half-open connection that every health check reports as up, because the checks run on the active path.

The parameter that decides it

On Linux the default net.ipv4.tcp_keepalive_time is 7200 seconds, and it only matters if the application turns SO_KEEPALIVE on at all, which many SDC and MQTT client stacks leave off unless you ask. Enterprise firewalls typically expire idle established flows much sooner. My rough estimate is about one hour on common vendor defaults, and clinical segment policies often tighten that further. So the first keepalive probe arrives after the flow is already gone. When the primary fails, the standby writes an alarm notification into a dead socket. The firewall drops it, or answers with a reset if it's configured to reject, and the kernel starts retransmitting with exponential backoff. With default retry limits, giving up can take around fifteen minutes by my estimate. For a monitoring system, that's an alarm delivered after the clinical decision it was meant to trigger.

A detection step for today

On each standby gateway, read net.ipv4.tcp_keepalive_time with sysctl, then run ss with its timer option against the uplink socket to the monitoring consumer: if the socket shows no keepalive timer, or one counting down from the kernel default, compare it with the established idle timeout configured on every stateful hop to the data centre, and if the keepalive interval isn't below half of the smallest of those timeouts, your failover path is already dead and simply hasn't been called on yet.

Making it fail in CI instead of on the ward

The rule that holds up in practice: the application keepalive interval, whether TCP keepalive or an SDC or TLS level heartbeat, must be less than half the shortest idle timeout of any stateful device on the path. Enforce it in a pipeline job that pulls both values from their source of truth, the gateway's deployment manifest and the firewall policy export, and fails the build when the relationship breaks. Back that with a scheduled drill: leave the standby idle for longer than the firewall timeout, fence the primary, and measure how long the first alarm takes to reach the consumer. Application heartbeats beat kernel keepalives here, because they also prove the TLS session and the SDC subscription are alive, not just the TCP flow. The cost is constant background traffic and log noise on every standby link in the hospital, and the next argument with the network team is whether to accept that or raise the idle timeout for this one flow class, which weakens the segmentation you put the firewall in for.

Technical FAQ: Wouldn't the standby reconnecting on demand when failover happens avoid all of this?

It avoids the half-open socket, but it puts a full TCP and mutually authenticated TLS handshake, plus SDC discovery and subscription, on the critical path at exactly the moment the system is degraded. That only works if the certificate store, the DNS path and the firewall rules for new flows are verified on the standby too, and those are usually the parts that drifted. A warm connection kept alive by heartbeats is cheaper to prove correct.

Related Architecture Specifications (HEALTHVIGILANCE): clinicalsoftwareai.com · healthtelemonitoring.com · medicalsoftwareai.com

More Technical Articles on healthiomt.com

Architecting Zero-Trust Hospital IoMT Networks Under FDA Section 524B Cybersecurity Mandates →From Serial Hex to FHIR JSON: Implementing the IEEE 11073-SDC Gateway →The Segmentation Rule That Waits for Your Next Failover →Catching Asymmetric Session Timeouts in Zero-Trust Medical Device Gateways →