Fix Protocol Sbe Ouch Session Latency
FIX ResendRequest (35=2) vs SequenceReset-GapFill (35=4): Preventing Replay Storms
Uncoalesced FIX ResendRequest (35=2) loops after a 4-second firewall blip can trigger 50,000+ disk reads and stale order transmissions unless gateways collapse skipped numbers via SequenceReset-GapFill (35=4, GapFillFlag=Y).

When a transient BGP flap or firewall state-table failover stalls a high-throughput FIX connection for just 3.5 seconds during the US cash open, an active liquidity provider can advance 18,000 sequence numbers ahead of the downstream OMS. If both peers naively exchange overlapping ResendRequest (35=2) frames (BeginSeqNo 7, EndSeqNo 16=0) and replay individual Heartbeat (35=0) or stale MassQuote (35=i) messages from disk, socket send buffers saturate, triggering cascading timeouts. Institutional session engines eliminate replay amplification by coalescing every non-fill record into a single contiguous SequenceReset-GapFill (35=4, GapFillFlag 123=Y, NewSeqNo 36).
Protocol Rules Governing ResendRequest (35=2) & Infinity EndSeqNo#
Under the FIX session layer specification, every inbound frame's MsgSeqNum (34) is compared strictly against NextExpectedMsgSeqNum. If MsgSeqNum > NextExpectedMsgSeqNum, an out-of-order gap exists: the engine must queue or discard the higher-numbered message (depending on optimistic vs strict in-order buffering) and emit ResendRequest (35=2).
Version nuances matter here. In FIX 4.0 and 4.1, EndSeqNo (16)=999999 signified "replay through the latest outbound sequence," whereas FIX 4.2, FIX 4.4, and FIXT.1.1 / 5.0 SP2 standardize EndSeqNo (16)=0 as open-ended infinity. Using a specific bounded 16=N during active traffic creates a classic race condition: by the time the sender finishes replaying up to N, live messages N+1..N+400 were already dropped while out-of-order, provoking a second, third, and fourth ResendRequest cascade. Conversely, 16=0 instructs the counterparty to replay the gap and seamlessly transition back to live sequence emission.
GapFill (123=Y) vs Hard SequenceReset-Reset (123=N) Danger Zones#
Message type 35=4 (SequenceReset) operates in two radically different modes controlled by GapFillFlag (123):
- GapFill Mode (
123=Y): Conformant to normal sequence-stream rules. ItsMsgSeqNum (34)MUST equal the starting sequence number of the skipped range,PossDupFlag (43=Y)andOrigSendingTime (122)must be populated, andNewSeqNo (36)sets the next expected sequence number after the skipped block. If messages105..499were heartbeats and cancelled quotes while500is anExecutionReport (35=8), the sender transmits a single35=4|34=105|43=Y|123=Y|36=500followed immediately by35=8|34=500|43=Y. - Reset Mode (
123=Nor omitted): BypassesMsgSeqNum (34)validation completely! It forces the receiver'sNextExpectedMsgSeqNumdirectly toNewSeqNo (36), silently obliterating any unrecovered fills in between. Production gateways governed by SEC and FINRA audit mandates block inbound123=Nduring intraday trading hours unless manually authorized by operations after cross-checking out-of-band Drop Copy (35=8).
| Replay Scenario / Message Class | Default Naive QuickFIX Action | Institutional Storm-Safe Action | Wire Sequence Semantics | ||||
|---|---|---|---|---|---|---|---|
Admin Frames (35=0, 1, 2, 4, 5) | Never replayed per FIX spec | Coalesced into contiguous GapFill | `35=4\ | 34=M\ | 123=Y\ | 36=K\ | 43=Y` |
Stale Outbound NewOrderSingle (35=D) | Re-sent with 43=Y (High Risk!) | Intercepted (DoNotSend) -> GapFill | Skipped cleanly; prevents toxic late fill | ||||
Outbound OrderCancelRequest (35=F) | Re-sent with 43=Y & 122=... | Re-sent immediately with 43=Y | Ensures resting risk is pulled on venue | ||||
Venue Outbound ExecutionReport (35=8) | Re-sent verbatim from store | Re-sent verbatim (43=Y, 122=Orig) | Preserves 100% ledger fill completeness | ||||
Overlapping ResendRequest (35=2) | Re-triggers full disk replay loop | Debounced within 2 * RTT window | Eliminates quadratic bandwidth amplification |
Storm-Control Behavior Across Institutional & Retail Gateway Engines#
Different execution stacks handle outbound replay safety very differently—especially regarding whether unacknowledged NewOrderSingle (35=D) frames are re-emitted or skipped via GapFill to avoid unintended stale fills.
- Tdrain = (Bytestransmitted * 8) / BWsessioncap + Tstoreseek
- Where:
- N_gap = 18,000 total missed sequences (17,958 quotes/heartbeats + 42 fills)
- Bavg = 240 bytes; Bfill = 285 bytes; Bgapfill = 112 bytes; Nruns = 43 GapFill spans
- BWsessioncap = 100 Mbps per-client broker QoS policer (12,500 bytes/ms)
- Tstoreseek = 0.09 ms (MMAP offset array) vs 410 ms (unindexed SQL query)
- Worked Storm vs Coalesced Comparison:
- Naive Replay Bytes = 18,000 * 240 = 4,320,000 bytes -> T_drain = 345.6 ms + 410 ms = 755.6 ms (x3 storm = 2.27 s)
- Coalesced GapFill Bytes = 42(285) + 43(112) = 11,970 + 4,816 = 16,786 bytes
- T_drain (MMAP + GapFill)= 16,786 / 12,500 + 0.09 ms = 1.43 milliseconds!
- Compression Factor A_replay = 4,320,000 / 16,786 = 257.4x wire volume reduction.
Why Outbound Order Gateways Must Never Blindly Replay Stale 35=D Orders#
Consider what happens if an algorithmic strategy sends a 50-lot EUR/USD market sweep (35=D, 34=812) at 14:30:00.050 during Non-Farm Payrolls, the TCP packet drops on an intermediate router, and 900 milliseconds later the broker's cTrader FIX gateway or ECN bridge sends ResendRequest (35=2, 7=812, 16=0). A default QuickFIX configuration (PersistMessages=Y without an outbound toApp age interceptor) automatically pulls 34=812 from disk, stamps 43=Y, and fires that stale market order into a price 65 pips away!
Institutional execution engines override outbound toApp during resend: any NewOrderSingle (35=D) or OrderCancelReplaceRequest (35=G) whose SendingTime (52) exceeds a strict staleness budget (typically 50 ms to 250 ms) is suppressed and converted into a SequenceReset-GapFill (35=4, 123=Y), while OrderCancelRequest (35=F) frames are allowed through. Pair this rule with idempotent PossDupFlag=Y (43) deduplication and our FIX, SBE & OUCH Architecture Guide.
Duplicate ResendRequest Debouncing and Memory-Mapped Replay Indexes#
During asymmetric packet loss, a peer may transmit five identical 35=2|7=1040|16=0 requests within 12 milliseconds before the first replay frame arrives across the WAN. Without debouncing, the sender replays messages 1040..3200 five consecutive times, multiplying bandwidth consumption 5x.
Production session state machines maintain a LastServicedResendRange { beginSeq, highWaterSeq, timestampNs } guard: if an incoming ResendRequest covers a range already transmitted within 2 * smoothed_RTT, the duplicate request is logged and ignored. Combined with memory-mapped NVMe sequence offset indexes, gap coalescing scans 100,000 sequence slots in under 90 microseconds—protecting risk limits sized in the Terminal Margin VaR & ES Calculator. See the FIX, SBE & OUCH Topic Hub for complete session runbooks.
Frequently asked questions
What is the difference between GapFillFlag=Y and GapFillFlag=N in FIX SequenceReset (35=4)?
GapFillFlag=Y (Tag 123) fills a specific sequence gap in response to a ResendRequest (35=2) and must carry the exact expected MsgSeqNum (34) plus PossDupFlag=Y (43). GapFillFlag=N forces an unconditional jump to NewSeqNo (36) while ignoring MsgSeqNum (34), risking permanent data loss if fills were in flight.
Why should an institutional OMS suppress NewOrderSingle (35=D) during a FIX ResendRequest?
If a network drop prevented an order from reaching the broker, replaying that NewOrderSingle seconds later with PossDupFlag=Y submits a live market or limit order against a completely changed order book. Converting aged orders into GapFill (123=Y) guarantees fail-closed execution safety.
How does an in-memory out-of-order queue eliminate back-to-back ResendRequest loops?
When Seq 501 arrives while expecting Seq 105, discarding 501..650 while waiting for 105..500 to replay forces a second ResendRequest for 501..650 afterward. Caching 501..650 in a pre-allocated ring buffer lets the engine drain them immediately once replay reaches 500.
What happens if NewSeqNo (36) in a SequenceReset-GapFill is lower than the current MsgSeqNum (34)?
Lowering sequence numbers violates FIX session monotonicity; the receiving engine must immediately reject the SequenceReset (35=4) with a session-level Reject (35=3, SessionRejectReason=5 Value is incorrect for NewSeqNo) and raise a critical operational alert.
Publication record
- Published
- 14 November 2026
- Updated
- 15 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 15). FIX ResendRequest (35=2) vs SequenceReset-GapFill (35=4): Preventing Replay Storms. Terminal Ledger Desk. https://terminalledgerdesk.com/reports/fix-resend-request-tag-35-2-sequence-reset-gap-fill-storm-controlRelated 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
PossDupFlag (Tag 43) vs PossResend (Tag 97): Idempotent FIX Execution DeduplicationFix Protocol Sbe Ouch Session Latency
FIX Drop-Copy (35=8) Reconciliation Gateways: Shadow Position & Clearing ArchitectureFix Protocol Sbe Ouch Session Latency
Nasdaq OUCH 5.0 Binary Order Entry: SoupBinTCP Framing & Optional Tag AppendagesFix Protocol Sbe Ouch Session Latency
Nasdaq TotalView-ITCH 5.0 & MoldUDP64: L3 Multicast Order Book ReconstructionFix Protocol Sbe Ouch Session Latency
CME MDP 3.0 SBE Market Data: A/B Multicast Arbitration & Snapshot SynchronizationFix Protocol Sbe Ouch Session Latency
Cboe BOE v3 Bitfields vs NYSE Pillar Binary Gateway: Wire Efficiency & LatencyFix Protocol Sbe Ouch Session Latency
FIX/FAST Protocol PMAP & Stop-Bit Decoding: Why Exchanges Migrated to SBERegulatory Compliance
Supreme Court agrees to hear Robinhood challenge to IPO information omission lawsuitMatching Engine Clob Colocation Ptp
LMAX Disruptor Ring Buffers: Mechanical Sympathy in Matching Engine CoresMatching Engine Clob Colocation Ptp
Intrusive O(1) Limit Order Books: Slab Pools, Doubly-Linked Queues & Price ArraysMatching Engine Clob Colocation Ptp
FIFO Price-Time vs Pro-Rata Matching Algorithms: CME Split, LMM & TOP Mechanics
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.
