The Runtime Theory
High-Frequency Trading

Colocation and Hardware Acceleration

How trading firms colocate servers at exchanges, use FPGAs and kernel bypass to shave microseconds off latency.

The Runtime Theory Team1 min read
▸ On this page

Colocation and Hardware Acceleration

In high-frequency trading, the physical distance between your server and the exchange's matching engine matters. A millisecond is a mile. Firms spend millions colocating to shave microseconds.

Colocation

Colocation is the practice of placing your trading servers in the same data center as the exchange. The closer your server is to the exchange's matching engine, the lower your network latency.

Physical Distance

Light travels at approximately 200,000 km/s in fiber optic cables (slower than vacuum due to the refractive index).

plaintext
NY to Chicago: ~1,100 km → min latency ≈ 7.5 ms
NY to London: ~5,500 km → min latency ≈ 28 ms

Colocation can reduce this to single-digit microseconds within the same data center.

Rack Placement

Even within a data center, rack position matters:

  • Front-rack placement minimizes cable length to the exchange switch
  • Same row as the exchange's matching engine servers
  • Cross-connects — direct fiber cables between cages

Kernel Bypass

The Linux kernel adds latency to network I/O: context switches, buffer copies, interrupt handling. Kernel bypass eliminates this:

  • DPDK (Data Plane Development Kit) — userspace networking
  • Solarflare Onload — TCP stack in userspace
  • Solarflare OpenOnload — kernel-bypass library
plaintext
Traditional: NIC → Kernel → App → Kernel → NIC  (~20-50 μs)
Kernel bypass: NIC → App → NIC  (~1-5 μs)

FPGA Acceleration

Field-Programmable Gate Arrays (FPGAs) implement logic in hardware — orders of magnitude faster than CPUs for specific tasks:

cpp
// CPU: parse market data in software → microseconds
// FPGA: parse market data in hardware → nanoseconds
 
FPGA use cases:
1. Market data parsing → nanosecond order book updates
2. Risk checks → nanoseconds per order
3. Ping-pong strategies → microseconds round-trip

Microwave Towers

Between major financial centers, some firms deploy microwave towers — straight-line paths that are shorter than fiber routes:

plaintext
NY to Chicago:
  Fiber: ~1,400 km → ~7.5 ms
  Microwave: ~1,100 km → ~6.0 ms
  Time saved: 1.5 ms

That 1.5ms translates to millions in annual profits for a high-volume strategy.

The Latency Stack

LayerLatencyOptimization
Decision100 ns - 10 μsOptimize algorithm
Risk Check100 ns - 1 μsFPGA
Encoding/Sending1-5 μsKernel bypass (DPDK)
Network5-50 μsColocation, microwave
Exchange Processing1-5 μsCo-located server, FPGA
Matching100 ns - 1 μsLock-free data structures
Total RTT~10-80 μs

Every microsecond is fought for. The fastest firms deploy FPGAs, custom hardware, and microwave towers. But the gains follow diminishing returns — the last microsecond costs more than the first hundred.

Not started

Sign in to save your learning progress.

Sign in to save