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).
NY to Chicago: ~1,100 km → min latency ≈ 7.5 ms
NY to London: ~5,500 km → min latency ≈ 28 msColocation 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
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:
// 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-tripMicrowave Towers
Between major financial centers, some firms deploy microwave towers — straight-line paths that are shorter than fiber routes:
NY to Chicago:
Fiber: ~1,400 km → ~7.5 ms
Microwave: ~1,100 km → ~6.0 ms
Time saved: 1.5 msThat 1.5ms translates to millions in annual profits for a high-volume strategy.
The Latency Stack
| Layer | Latency | Optimization |
|---|---|---|
| Decision | 100 ns - 10 μs | Optimize algorithm |
| Risk Check | 100 ns - 1 μs | FPGA |
| Encoding/Sending | 1-5 μs | Kernel bypass (DPDK) |
| Network | 5-50 μs | Colocation, microwave |
| Exchange Processing | 1-5 μs | Co-located server, FPGA |
| Matching | 100 ns - 1 μs | Lock-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.