Basic Prerequisites: 01 · From Zero and Low-Latency Systems Architecture.
1. Intuition & Practical Objective
Tick-to-trade is a pipeline: a market-data packet enters at one end and an order packet leaves at the other, through a fixed sequence of stages. This page names the stages, gives the latency and throughput of each, and shows why pipelining is the trick that lets a 312.5 MHz FPGA keep up with a 100 Gbps wire even though its clock is slower than a CPU’s.
The pipeline, wire to wire:
- PHY / MAC - the SFP+ transceiver deserializes the optical bitstream; the MAC strips the frame header. Latency ≈ 20–40 ns; the FPGA sees bits, not sockets.
- Feed parser (state machine in silicon) - decodes NASDAQ ITCH 5.0 or CME MDP 3.0 by walking a fixed byte-offset state machine, without buffering the whole packet. Latency ≈ 10 ns; a software parser needs ~200 ns because it reads struct fields from memory.
- Hardware book builder - applies the update to top-of-book registers held in on-chip Block RAM (BRAM). Latency ≈ 5 ns.
- Trigger matrix - hardwired combinational logic:
if bid > threshold then fire. Latency ≈ 10 ns in a single pipeline stage. - Order injector - pre-computed checksums, the OUCH/FIX frame is written to the TX FIFO and pushed straight to the transceiver. Latency ≈ 20 ns.
Total ≈ 65 ns. The same five jobs in kernel-bypass software cost ≈ 1,200 ns, because each one is a loop over memory rather than wire.
Three “aha”s:
- Latency is the sum of stages; throughput is the slowest stage. These are different quantities and the confusion between them causes most bad architecture.
- Pipelining multiplies throughput at constant latency. stages running concurrently process packets at once; end-to-end latency stays , but you emit one packet every instead of every . This is how a 312.5 MHz chip (3.2 ns/tick) feeds a 100 GbE port.
- The wire itself is a stage you cannot optimise away. Serialization is ; a 1,500-byte MTU frame takes 1,200 ns to clock out at 10GbE. If your frames are big, framing is your latency.
Why it matters. Every realistic tick-to-trade number is a sum over these stages. If you cannot point at the dominant stage in your pipeline, you cannot decide where to spend - and you will spend it in the wrong place.
2. Mathematical Ground Truth & Derivations
Pipelined latency and throughput. For stages each of processing time :
whereas a serial (non-overlapping) implementation has
So pipelining gives an throughput gain at zero latency cost - the single most important fact in hardware feed handling. A serial pipeline is unstable whenever the arrival rate ; its queue then grows without bound (Little’s law below), which is why the serial numbers in §3 explode.
Wire serialization. A frame of bytes on a link of rate (bits/ns) occupies the wire for
With the standard 84-byte minimum frame (64 B frame + 8 B preamble/SFD + 12 B inter-frame gap): 67.20 ns at 10GbE, 26.88 ns at 25GbE, 6.72 ns at 100GbE. The corresponding line-rate packet ceilings are : 14.88, 37.20, and 148.81 M pkt/s.
Little’s law (buffering). For a stable system, the mean number in flight is
At line rate 14.88 M pkt/s with ns, packets - less than one packet of buffering is needed. This is the theoretical reason an FPGA can hold its entire book and pipeline in on-chip BRAM and why its queueing delay is effectively zero.
Single-cycle trigger. At MHz, one clock tick is ns. The comparator-plus-register logic fits in a single tick (3.2 ns); with its pipeline registers the trigger stage’s end-to-end latency is ~10 ns - deterministic, not “usually fast.”
3. Computational Implementation - pipelining, wire time, Little’s law
Stdlib only. A deterministic discrete-event simulation runs the same 5-stage parser serially and pipelined, then we tabulate wire serialization and in-flight occupancy.
Three lessons in the numbers. (i) The pipelined parser holds 20.00 ns latency (exactly ) but pushes 166.5 M pkt/s, while the serial version collapses to 50.0 M pkt/s () and its mean latency explodes to 14,013 ns because arrivals (every 6 ns) outrun its 20 ns service time - the queue grows without bound. Same hardware, same stages; the only difference is overlap. (ii) Wire time is not a rounding error: a 1,500-byte frame costs 1,200 ns of wire at 10GbE - larger than an entire FPGA pipeline. Small frames and fast links are a latency feature. (iii) Little’s law says line-rate FPGA needs packets of buffer, so on-chip BRAM is ample and queueing delay is nil.
For reference, the same trigger stage as silicon - one clock tick, deterministic:
4. Failure Modes & First-Principles Breakdowns
- Confusing latency with throughput. Buying a 100 GbE NIC to “reduce latency” when your feed is 10 GbE and you are latency-sensitive is a throughput purchase that changes nothing. Latency is a chain; throughput is a bottleneck.
- Serial (non-pipelined) hot paths. A software parser that decodes one packet fully before starting the next is ; under a burst it queues and its latency (not just its throughput) explodes, exactly as the simulation shows (14,013 ns). Overlap or die.
- Big frames / undersized links. 1,200 ns of MTU wire time at 10GbE dominates a 65 ns FPGA. Optimise your framing and line rate before your logic.
- Buffering everything. If your design must buffer whole packets before parsing, you have reintroduced the memory hierarchy the FPGA was supposed to eliminate - latency returns to software-like values.
- Ignoring the inter-frame gap. Line-rate packet ceilings (14.88 M pkt/s at 10GbE) include preamble and IFG; capacity plans that assume 64 B payloads will be ~30% optimistic.
5. References
- Nasdaq - TotalView-ITCH 5.0 Specification, message formats and the software/FPGA decode variants the parser must implement.
- Leber, Geib & Litz (FPL 2011)
- De Schryver (ed.) - FPGA Based Accelerators for Financial Applications (2015), HFT hardware-design chapters: pipeline depth, clock budgets, HLS mapping.
- DPDK documentation
- Hasbrouck & Saar (2013), “Low-latency trading,” JFM 16(4)
6. Connected Graph Bridges
- Back: 01 · From Zero · Index Hub
- Forward: 03 · FPGA vs CPU vs GPU · 04 · Kernel Bypass & Networking
- Software counterpart: Low-Latency Systems Architecture · High-Performance C++ for Trading
- Why the order matters: Queue Position & Fill Probability · Limit Order Book Mechanics