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.

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 ifHeartBtIntelapses with zero outbound traffic does the engine emit an unsolicitedHeartbeat (35=0)(with noTestReqID`). - Inbound Silence Timer (
HeartBtInt + Grace_Transmission): Reset every time any valid FIX frame arrives from the peer. WhenHeartBtInt + Graceexpires with zero inbound bytes, the engine does not disconnect immediately; instead, it transmitsTestRequest (35=1)carrying a uniqueTestReqID (Tag 112)(typically a microsecond UTC counter). The peer MUST echo aHeartbeat (35=0)copying that exactTestReqID (112). If a second grace window expires without matching112, the engine declares the peer dead, closes the socket, and triggers high-availability failover.
Why Naive 2.0 * HeartBtInt Grace Windows Are Dangerous on 10GbE Links#
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.
| Liveness Mechanism | Protocol / OS Layer | Typical Production Setting | Worst-Case Detection Time | Failure Mode Caught |
|---|---|---|---|---|
Linux tcp_retries2=15 (Default) | OS Kernel TCP | Unconfigured default | ~13 to 15 minutes | Catastrophically 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 s | Any un-ACKed outbound order/cancel in flight |
FIX HeartBtInt + TestRequest (FIXT) | Session Layer (35=0 / 35=1) | 108=5, Grace 0.5s, Reply 1.0s | 6.50 s | Hung peer daemon (TCP stack still ACKing!) |
| SoupBinTCP Heartbeat (Nasdaq OUCH) | Binary Session Framing | Fixed 1,000 ms (R / H) | 2.00 s – 3.00 s | Both 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.
- 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.
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.5swhile Primary Port A has a5.0sCOD 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.0sdetection 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
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-detectionRegulatory Directory Cross-Reference
Referenced Institutions & Regulatory Registries
Referenced Supervisory Authorities
Related Fix Protocol Sbe Ouch Session Latency & Institutional Briefings
Explore Fix Protocol Sbe Ouch Session Latency Hub (20) →Fix Protocol Sbe Ouch Session Latency
FIX 4.4/5.0 SP2, CME iLink 3 SBE & Nasdaq OUCH 5.0 Session Latency Architecture GuideFix Protocol Sbe Ouch Session Latency
EOD vs Weekly FIX Sequence Reset (Tag 141=Y): Cross-Timezone Rollover EngineeringFix Protocol Sbe Ouch Session Latency
SBE Schema Evolution: Forward & Backward Wire Compatibility via actingBlockLengthFix Protocol Sbe Ouch Session Latency
TCP_NODELAY, TCP_QUICKACK & TLS 1.3 Record Sizing: Eliminating 40ms FIX JitterFix Protocol Sbe Ouch Session Latency
FIX OrdStatus (Tag 39) & ExecType (Tag 150) State Matrices: Cancel/Replace RacesFix Protocol Sbe Ouch Session Latency
FIX PartyIDs (Tag 453) & MiFID II Short-Code Injection: Edge Gateway LEI MappingFix Protocol Sbe Ouch Session Latency
Memory-Mapped (mmap) FIX Sequence Stores: Bypassing NVMe fsync Tail LatencyFix Protocol Sbe Ouch Session Latency
FIX 4.4 ASCII Tag-Value Parsing Overhead vs SBE Zero-Copy Wire Struct LatencyMatching Engine Clob Colocation Ptp
Layer-1 Matrix Switches & Passive Optical Taps: Arista 7130 5ns Fan-Out & MuxingMatching Engine Clob Colocation Ptp
Hidden, Iceberg & Midpoint-Pegged Orders: CLOB Priority & Re-Queue MechanicsMatching Engine Clob Colocation Ptp
Exchange Speed Bumps: IEX 350us 38-Mile Fiber Coil & Asymmetric Delay ShieldsMatching Engine Clob Colocation Ptp
Smart Order Router (SOR) Engineering: Latency-Equalized Sweeps & Poisson Fill Models
Terminal Ledger Desk Data, Benchmarks & Contributor Records
CC BY 4.0 Open Data
Open Institutional Datasets (CSV / JSON) →
Download desk-compiled quantitative series & schemas.
2026 Reference Matrix
2026 Institutional Benchmarks & Thresholds →
Statutory capital, clearing, margin & rate conventions.
Editorial Records
Authors & Review Records →
View named contributors where those records are available.
Complete Index
Master Research & Dossier Archive →
Browse all published briefings by topic pillar & date.
