Skip to content
Terminal Ledger Desk
Directory

Fix Protocol Sbe Ouch Session Latency

FIX Heartbeat (35=0), TestRequest (35=1) & Linux TCP_USER_TIMEOUT Dead-Peer Detection

Default 30-second FIX HeartBtInt (Tag 108) timers leave algorithmic gateways blind to silent NAT/firewall blackholes for up to 36 seconds unless paired with tight TestRequest (35=1) grace intervals and Linux TCP_USER_TIMEOUT.

By Marcus Thorne, CQFReview not recorded · Updated
FIX Heartbeat (35=0), TestRequest (35=1) & Linux TCP_USER_TIMEOUT Dead-Peer Detection — Terminal Ledger Desk 2026 quantitative & supervisory data card
Terminal Ledger Desk (FIX 4.4/5.0 SP2, CME iLink 3 SBE, Nasdaq OUCH/ITCH & Session Recovery): Co-engineering FIX TestRequest (35=1) grace timers with Linux TCP_USER_TIMEOUT=500ms tripwires.Source: Terminal Ledger Desk Institutional Research DeskLicense: CC-BY-4.0

Not all network outages graciously transmit a TCP FIN or RST packet: stateful firewall failovers, fiber optic attenuation bends, and asymmetric cloud router blackholes leave sockets half-open, swallowing outbound NewOrderSingle (35=D) frames into kernel retransmission queues with zero immediate error return from send. Relying on default OS tcp_retries2 = 15 (~13 minutes) or sluggish HeartBtInt = 30 (Tag 108) defaults exposes trading desks to 36+ seconds of unacknowledged blind risk unless session timers and Linux TCP_USER_TIMEOUT sockets are co-engineered.

Exact State Machine of HeartBtInt (108), Heartbeat (35=0) & TestRequest (35=1)#

During Logon (35=A), initiator and acceptor agree on HeartBtInt (Tag 108) in seconds. Under the FIX session layer specification, two independent timers govern liveness:

  • *Outbound Idle Timer (`1.0 HeartBtInt)**: Reset every time *any* application or admin packet is written to the socket. Only if HeartBtInt elapses with zero outbound traffic does the engine emit an unsolicited Heartbeat (35=0) (with no TestReqID`).
  • Inbound Silence Timer (HeartBtInt + Grace_Transmission): Reset every time any valid FIX frame arrives from the peer. When HeartBtInt + Grace expires with zero inbound bytes, the engine does not disconnect immediately; instead, it transmits TestRequest (35=1) carrying a unique TestReqID (Tag 112) (typically a microsecond UTC counter). The peer MUST echo a Heartbeat (35=0) copying that exact TestReqID (112). If a second grace window expires without matching 112, the engine declares the peer dead, closes the socket, and triggers high-availability failover.
Dual-layer dead-peer detection combining Linux TCP_USER_TIMEOUT 500ms ACK checks with FIX TestRequest 35=1
Dual-layer dead-peer detection combining Linux TCPUSERTIMEOUT 500ms ACK checks with FIX TestRequest 35=1Verified Exhibit

Legacy 1990s dial-up guidance suggested setting the TestRequest transmission grace window to 20% to 100% of HeartBtInt. With 108=30, waiting 30s + 6s to send 35=1 and another 30s for the reply means 66 seconds of dead-peer blindness! On modern Equinix colocation cross-connects where physical RTT is 0.15 ms (or cross-continental London-to-Tokyo WAN at 165 ms), institutional venues negotiate 108=5 or 108=10 (and KeepAliveInterval=5000 ms on CME iLink 3 SBE) while tightening post-TestRequest timeout to max(1500 ms, 4 * SRTT).

Simultaneously, beware of head-of-line blocking false disconnects: if your own parser stalls for 4 seconds processing an uncoalesced ResendRequest replay storm, inbound 35=0 frames sit unread inside the kernel TCP receive buffer! Always read kernel RX timestamps (SO_TIMESTAMPNS) or update lastInboundByteNs in the network reader thread before declaring a peer dead.

Quantitative Distribution · Typical Production Setting
Typical Production SettingWorst-Case Detection Time
01Linux TCPUSERTIMEOUT (FIX A…500 ms (Colo) /…02FIX HeartBtInt + TestReques…108=5, Grace 0.…03SoupBinTCP Heartbeat (Nasda…Fixed 1,000 ms …
Liveness MechanismProtocol / OS LayerTypical Production SettingWorst-Case Detection TimeFailure Mode Caught
Linux tcp_retries2=15 (Default)OS Kernel TCPUnconfigured default~13 to 15 minutesCatastrophically slow on WAN blackholes
Linux TCP_USER_TIMEOUT (FIX API)OS Kernel TCP (setsockopt)500 ms (Colo) / 2,000 ms (WAN)0.50 s – 2.00 sAny un-ACKed outbound order/cancel in flight
FIX HeartBtInt + TestRequest (FIXT)Session Layer (35=0 / 35=1)108=5, Grace 0.5s, Reply 1.0s6.50 sHung peer daemon (TCP stack still ACKing!)
SoupBinTCP Heartbeat (Nasdaq OUCH)Binary Session FramingFixed 1,000 ms (R / H)2.00 s – 3.00 sBoth silent drop & frozen gateway process

Dead-Peer Detection SLA Across Socket & Session Layers#

Coordinating kernel TCP retransmission timeouts with FIX 35=1 probes cuts blackhole detection time by an order of magnitude across institutional and broker platforms like ActivTrader and IG DMA.

Formula or model from the articleNot independently verified
T_detect_idle = HeartBtInt + T_grace_send_35_1 + T_await_112_reply
  • Tdetectactive = min( Tdetectidle, TCPUSERTIMEOUT_ms / 1000 )
  • Driftsigma99 = 2.326 * Sigma1s * sqrt( Tdetect ) * Notional_open
  • Where:
  • Sigma_1s = 0.00018 (1.8 bps per sqrt-second during FOMC volatility)
  • Notional_open = $25,000,000 unhedged resting quote inventory
  • Tstock = 66.0 s (un-tuned 108=30); Ttuned = 0.50 s (TCPUSERTIMEOUT=500ms)
  • Worked 99% Unhedged Price-Drift Exposure Reduction:
  • Drift_99 (Stock 66s) = 2.326 * 0.00018 * sqrt(66.0) * $25M = $84,992 tail exposure!
  • Drift_99 (Tuned 0.5s) = 2.326 * 0.00018 * sqrt(0.50) * $25M = $7,401 tail exposure (-91.3% risk reduction).

Coupling Linux TCP_USER_TIMEOUT With Outbound Unacknowledged Bytes#

Observe a critical blind spot of FIX HeartBtInt=10: if a link blackholes at t = 0.1s right after an inbound market tick, HeartBtInt will not even notice silence until t = 10.1s—yet your strategy may have transmitted an urgent OrderCancelRequest (35=F) at t = 0.2s whose TCP segment is sitting un-ACKed in the Linux retransmission buffer!

Setting setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &ms, sizeof(ms)) (ms = 2000 on WAN, ms = 500 on metro fiber) instructs the Linux kernel to abort the socket with ETIMEDOUT the instant any transmitted TCP data remains unacknowledged by the peer TCP stack for 500 ms! Combined with TCP_NODELAY (see TCP Nagle and delayed-ACK jitter), active order traffic detects silent fiber cuts in 500 milliseconds rather than waiting 12 seconds for HeartBtInt.

Blackhole detection latency across Linux default TCP, 30s QuickFIX default, tuned 5s HeartBtInt, and TCP_USER_TIMEOUT
Blackhole detection latency across Linux default TCP, 30s QuickFIX default, tuned 5s HeartBtInt, and TCPUSERTIMEOUTVerified Exhibit

Coordinating Dead-Peer Timeouts With Venue Cancel-On-Disconnect (COD)#

Whenever an execution gateway severs a blackholed socket, its local timeout MUST align with the exchange-side Cancel-On-Disconnect grace timer under SEC and FCA controls (synthesized in our FIX, SBE & OUCH Session Architecture Guide):

  • If client dead-peer failover switches to Backup Port B at 1.5s while Primary Port A has a 5.0s COD grace timer, Backup Port B must query open orders or wait/force port purge so resting quotes on Port A are not orphaned or double-quoted.
  • Model worst-case unhedged price drift during that 0.5s–5.0s detection window inside the Terminal Margin VaR & ES Calculator and review additional session runbooks in the FIX, SBE & OUCH Topic Hub.

Frequently asked questions

Why is TCP Keepalive alone insufficient to replace FIX Heartbeat (35=0) and TestRequest (35=1)?

Kernel TCP Keepalives are handled entirely inside the remote OS network stack! If the remote broker Java/C++ FIX gateway deadlocks in garbage collection or an infinite loop, the remote Linux kernel continues answering TCP Keepalives while zero orders are processed—only FIX 35=1 proves application liveness.

Can Initiator and Acceptor use different HeartBtInt (Tag 108) values on the same FIX session?

No. Under the FIX session standard, the Initiator proposes HeartBtInt (Tag 108) in its Logon (35=A) and the Acceptor echoes the agreed value back. Both sides must drive their outbound and inbound timers from that single symmetric interval.

What happens if an engine receives a TestRequest (35=1) while in the middle of a sequence gap?

Provided MsgSeqNum (34) is valid or queued per session policy, responding promptly with Heartbeat (35=0) carrying the requested TestReqID (112) prevents the peer from severing the TCP socket mid-recovery while ResendRequest (35=2) drains.

What is the lowest HeartBtInt value supported by institutional exchanges and prime brokers?

Most ASCII FIX 4.4/5.0 prime-broker gateways allow HeartBtInt down to 5 or 10 seconds (rejecting 108=1 to limit admin log noise), whereas binary protocols like Nasdaq SoupBinTCP run native 1-second heartbeats and CME iLink 3 supports 5,000 ms KeepAliveInterval.

Publication record

Published
14 November 2026
Updated
16 November 2026
Author
Marcus Thorne, CQF
Review
Review not recorded
Automated fact check
Passed in the stored pipeline record
Source URLs
3 recorded

AI assistance recorded: anthropic/claude-opus-4.6. This field does not establish human review or source verification.

Academic & Institutional Attribution

Cite This Research & Embed Live Data Card

Open Attribution License (CC BY 4.0)

Standard academic & institutional research paper citation format.

Marcus Thorne, CQF. (2026, November 16). FIX Heartbeat (35=0), TestRequest (35=1) & Linux TCP_USER_TIMEOUT Dead-Peer Detection. Terminal Ledger Desk. https://terminalledgerdesk.com/reports/fix-heartbeat-tag-35-0-testrequest-tag-35-1-half-open-tcp-detection

Regulatory Directory Cross-Reference

Referenced Institutions & Regulatory Registries

Referenced Supervisory Authorities

Explore Fix Protocol Sbe Ouch Session Latency Hub (20) →

Terminal Ledger Desk Data, Benchmarks & Contributor Records

FIX Heartbeat (35=0), TestRequest & TCP Dead-Peer Tuning | Terminal Ledger Desk