Fix Protocol Sbe Ouch Session Latency
PossDupFlag (Tag 43) vs PossResend (Tag 97): Idempotent FIX Execution Deduplication
Distinguishing transport-level PossDupFlag=Y (Tag 43) replays from application-level PossResend=Y (Tag 97) submissions prevents double-fills and corrupted OMS shadow positions during gateway failovers.

Double-execution incidents during broker gateway failovers almost always stem from conflating two distinct FIX boolean headers: session-layer PossDupFlag (43=Y) and application-level PossResend (97=Y). Whereas 43=Y reuses the exact original MsgSeqNum (34) during a protocol-level ResendRequest (35=2) handshake and is filtered automatically by sequence high-water marks, 97=Y arrives on a brand-new MsgSeqNum after an upstream OMS failover, requiring an explicit hash lookup against ClOrdID (11) or ExecID (17) inside an open-addressed idempotency ledger before touching the matching book or clearing balance.
Transport Replay (PossDupFlag 43=Y) vs Application Retry (PossResend 97=Y)#
In a compliant FIX session engine, PossDupFlag=Y (43) indicates that the session layer is re-transmitting a previously assigned MsgSeqNum (34). Every 43=Y packet MUST include OrigSendingTime (122) recording the UTC timestamp when that sequence slot was originally serialized, while SendingTime (52) reflects the current wire re-emission timestamp. If 122 is missing—or if OrigSendingTime > SendingTime—the receiver must emit a session-level Reject (35=3, SessionRejectReason=1 or 10) and increment NextExpectedMsgSeqNum.
By contrast, PossResend=Y (97) originates above the FIX session layer. Suppose an institutional EMS cluster crashes mid-write after handing an order (ClOrdID=ORD-994821) to its outbound network adapter, and the promoted standby node connects on a secondary FIX session (or after a sequence reset) uncertain whether the venue received ORD-994821. Sending that order on a fresh sequence slot with 97=Y instructs the venue's execution engine to check its intraday ClOrdID hash table first: if ORD-994821 already exists, return its current ExecutionReport (35=8) status instead of booking a second order.
Defeating the Fatal MsgSeqNum-Too-Low Logout Trap on PossDup=Y#
One of the costliest bugs in custom C++ or Go FIX adapters occurs when an inbound packet arrives with MsgSeqNum (34) < NextExpectedMsgSeqNum. Under standard session rules:
- If
PossDupFlag=N(or absent) AND34 < Expected: A catastrophic sequence desynchronization has occurred! The receiver MUST immediately sendLogout (35=5)with text"MsgSeqNum too low, expecting X but received Y"and close the TCP socket—never process the payload. - If
PossDupFlag=YAND34 < Expected: The frame is a harmless duplicate from an overlapping ResendRequest recovery pass. The session layer MUST validateOrigSendingTime (122), silently discard the already-processed sequence slot without passing it to the OMS, and keep the connection open! Failing to check43=Ybefore triggering the low-sequence logout kills live sessions right as recovery completes.
| Inbound Scenario | MsgSeqNum (34) vs Expected | PossDup (43) / PossResend (97) | Mandatory Gateway Action | Primary Composite Dedup Key |
|---|---|---|---|---|
| Already Replayed Packet | 34 < Expected | 43=Y, 97=N (Valid 122) | Silently ignore; keep TCP session alive | (SessionID, MsgSeqNum 34) |
| Sequence Desync Fault | 34 < Expected | 43=N (or absent) | Send Logout (35=5) & disconnect socket | Session sequence high-water mark |
| Failover Order Retry | 34 == Expected | 43=N, 97=Y | Query ClOrdID table; echo status if hit | (SenderCompID 49, ClOrdID 11) |
| Primary + DropCopy Fill | Independent Sessions | 43=N or 43=Y | Atomic insert ExecID; drop 2nd arrival | (MarketSegment, Symbol, ExecID 17) |
| Malformed Resend Frame | 34 == Expected | 43=Y, Missing 122 | Emit Reject (35=3, Reason=1); advance seq | Header validation rule (FIX 4.4) |
Idempotency Key Matrix Across Inbound Orders & Inbound Fills#
Building deterministic exactly-once state machines across primary gateways and out-of-band Drop Copy (35=8) aggregators requires composite deduplication keys tailored to each message direction.
- Tdedupinline = Tfnv1ahash + Lexpectedprobes * Tcacheaccess
- Where:
- N_entries = 35,000,000 intraday orders + fills
- N_buckets = 67,108,864 (2^26 slots * 32 bytes = 2,147,483,648 bytes in 1,024 2MB HugePages)
- alpha = Nentries / Nbuckets = 35,000,000 / 67,108,864 = 0.5215 load factor
- Tfnv1ahash = 4.5 ns (24-byte composite key)
- Tcacheaccess = 9.8 ns weighted L2/L3 access with zero page-walk TLB misses
- Worked Inline Deduplication Cost:
- Lexpectedprobes = 0.5 * (1 + 1 / (1 - 0.5215)) = 0.5 * (1 + 2.090) = 1.545 probes
- Tdedupinline = 4.5 ns + (1.545 * 9.8 ns) = 19.64 nanoseconds mean (~29 ns p99).
Designing Sub-50-Nanosecond Robin-Hood Hash Tables for Intraday Dedup#
Checking 25 million intraday ClOrdID and ExecID keys cannot rely on SQL queries or pointer-chasing std::map red-black trees without blowing pre-trade latency budgets. Production gateways allocate a power-of-two open-addressed Robin-Hood hash table (67,108,864 32-byte slots = 2.0 GB pinned in hugepages via MAP_HUGETLB), hashing (SessionID, FNV1a_64(ClOrdID)) with a load factor below 0.55.
Average probe depth stays at 1.18 cache lines (~18 nanoseconds), guaranteeing zero-allocation idempotency checks inline with order entry. On the buy-side OMS, fill accounting uses (VenueID, MarketSegmentID, ExecID Tag 17)—and for trade corrections (ExecType 150=G) or busts (150=H), links back to ExecRefID (19)—so even if identical fill reports arrive simultaneously over both the primary trading port and a shadow Drop Copy feed, unified margin clearing balances increment exactly once. See our FIX, SBE & OUCH Architecture Guide for cross-protocol equivalents on CME and Nasdaq.
Audit Controls & Chaos-Test Scenarios for Exactly-Once Certification#
Before onboarding an execution adapter under SEC, FINRA, or IIROC/CIRO supervision, QA harnesses execute four mandatory packet-injection tests:
- Replay Lower-Sequence
43=YMid-Stream: Inject34=500|43=Y|122=...whenExpected=520; verify zero state mutation and zeroLogout (35=5). - Missing
OrigSendingTime (122)on43=Y: Inject34=520|43=Yomitting122; verifyReject (35=3, 373=1)and proper sequence advancement to521. - Cross-Session
PossResend=Y (97)Order Retry: Submit identicalClOrdIDwith97=Yafter failover; verify prior status echoed with zero duplicate exposure in the Terminal Margin VaR & ES Calculator. - Dual-Feed
ExecID (17)Race: Deliver the same150=Ffill simultaneously on Trading and Drop Copy sockets; confirm atomic CAS (compare_exchange_strong) commits the fill once. Explore related state matrices in FIX OrdStatus & ExecType cancel/replace races and the FIX, SBE & OUCH Topic Hub.
Frequently asked questions
Why does FIX require OrigSendingTime (Tag 122) whenever PossDupFlag (Tag 43) is set to Y?
SendingTime (Tag 52) must always reflect the live wire transmission time to pass clock-drift checks. OrigSendingTime (Tag 122) preserves the exact historical timestamp when the business event originally occurred, allowing compliance audit trails and staleness filters to evaluate message age accurately.
Can ExecID (Tag 17) alone be used globally as a single-column primary key across multiple exchanges?
No. Exchanges guarantee ExecID uniqueness only within a specific venue, trading date, and often market segment or matching partition (e.g., CME channel or Nasdaq symbol partition). Always form a composite key combining TradingDate, Venue/MIC, MarketSegmentID, and ExecID (17).
How should an OMS deduplicate Trade Correct (150=G) and Trade Cancel/Bust (150=H) ExecutionReports?
Every correction or bust carries its own unique ExecID (Tag 17) while referencing the prior fill via ExecRefID (Tag 19). The OMS deduplicates the event itself using Tag 17, then atomically reverses or adjusts the ledger entry pointed to by Tag 19.
What happens if an algorithmic gateway sends a duplicate ClOrdID without setting PossResend=Y (97)?
Without PossResend=Y, an exchange or broker gateway treats the second NewOrderSingle as an erroneous duplicate order attempt and immediately returns ExecutionReport (35=8) with OrdStatus=8 (Rejected) and OrdRejReason=6 (Duplicate Order), leaving the original order intact.
Publication record
- Published
- 14 November 2026
- Updated
- 14 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 14). PossDupFlag (Tag 43) vs PossResend (Tag 97): Idempotent FIX Execution Deduplication. Terminal Ledger Desk. https://terminalledgerdesk.com/reports/possdupflag-tag-43-origsendingtime-tag-122-idempotent-order-dedupRegulatory Directory Cross-Reference
Referenced Institutions & Regulatory Registries
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
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 SBEFix Protocol Sbe Ouch Session Latency
Zero-Malloc FIX Repeating Groups: Parsing NoMDEntries (268) & NoPartyIDs (453)Matching Engine Clob Colocation Ptp
Multi-Region Colocation Architecture: CME Aurora, Equinix FR2 Frankfurt & TY3 TokyoMatching Engine Clob Colocation Ptp
Solarflare Onload / ef_vi vs DPDK Kernel Bypass: NIC RX/TX Ring & PIO TuningMatching Engine Clob Colocation Ptp
FPGA Tick-to-Trade Pipelines: Cut-Through PCS/MAC & Sub-200ns Order TriggeringMatching Engine Clob Colocation Ptp
IEEE 1588v2 PTP Clock Synchronization: GNSS Grandmasters, Boundary Clocks & NIC PHC
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.
