Skip to main content
  1. Posts/

The Nanosecond War: Deep Dive into Hundsun O45/A8 vs. Kingdom Distributed Trading Architecture

Introduction: The Physics of Finance
#

In the world of institutional asset management and high-frequency trading (HFT), latency is not just a metric—it is a physical barrier to profit. As the Chinese market transitions toward “Xinchuang” (Domestic Innovation) and institutional-grade algorithmic trading, the underlying communication middleware has evolved from millisecond-level legacy brokers to microsecond-level distributed buses.

This article dissects the architectural transition from Hundsun (O32/T2) to the new LDP-powered O45/A8 and compares them against Kingdom’s F2 distributed framework.


1. Layer 4 Fundamentals: The Death of TCP in HFT
#

The most fundamental shift in trading systems is the move away from the standard Linux networking stack.

1.1 The Legacy: TCP-based T2 & KCXP (O32 Era)
#

Legacy systems like Hundsun O32 and Kingdom KCXP relied heavily on TCP (Transmission Control Protocol).

  • The Overhead: Every packet requires a 3-way handshake and continuous acknowledgement (ACK). In a congested network, TCP’s Head-of-Line Blocking means if one packet is lost, the entire trading stream freezes until retransmission occurs.
  • Kernel Bottleneck: TCP is managed by the Linux kernel. Every trade involves a “context switch” between User Space and Kernel Space, adding 50–100 microseconds of “invisible” latency.

1.2 The Modern Era: Reliable UDP & Multicast (O45/A8/F2)
#

Modern systems like O45 and Kingdom’s New-Gen systems utilize UDP or Reliable Multicast.

  • The ASAR Advantage: Hundsun’s ASAR (the core of the LDP platform) uses UDP with a custom reliability layer. It doesn’t ask “Did you receive this?”; it only acts when a receiver sends a NAK (Negative Acknowledgement) indicating a missing sequence number.
  • Kernel Bypass: By utilizing DPDK (Data Plane Development Kit), ASAR allows the application to read directly from the NIC (Network Interface Card). This bypasses the kernel entirely, dropping latency from milliseconds to single-digit microseconds.

2. Middleware Evolution: T2 vs. ASAR vs. F2
#

2.1 Hundsun: The Journey to LDP (Lightweight Distributed Platform)
#

  • T2 (The Broker): A centralized message broker. Think of it as a post office where every letter must be sorted before delivery. High reliability, but high congestion.
  • ASAR/LDP (The Highway): Used in O45, A6, and A8. It is a peer-to-peer (P2P) bus.
    • Zero-Copy: Data is written once into a shared memory ring buffer and read by the business logic without copying bytes between memory addresses.
    • Flat Serialization: Unlike O32’s “Pack/Unpack” which parses strings, ASAR uses binary memory mapping (similar to FlatBuffers), making serialization virtually “free” in terms of CPU cycles.

2.2 Kingdom: The F2 Distributed Memory Bus
#

  • KCXP/KCBP: The traditional SOA (Service Oriented Architecture). Great for complexity, poor for speed.
  • F2 Bus: Kingdom’s answer to LDP. F2 focuses on a Distributed Memory Bus architecture. It treats the entire cluster as a single memory space, using RDMA (Remote Direct Memory Access) capabilities to allow one server to write directly into the RAM of another server.

3. Deep Tech Comparison: Architecture & Internals
#

MetricHundsun O32 (Legacy)Hundsun O45/A8 (Modern)Kingdom F2 (Distributed)
ProtocolTCP / Centralized BrokerReliable UDP / MulticastUDP / RDMA Support
MessagingT2 (Broker-based)ASAR (LDP Bus)F2 (Memory Bus)
OS InteractionStandard Socket syscallsKernel Bypass (DPDK)Shared Memory / P2P
CPU UtilizationInterrupt-drivenSpin-lock / PollingHybrid Polling
ConsistencyDatabase TransactionRaft / SMR (Memory-based)Distributed Snapshot
Latency (E2E)2ms - 10ms< 10μs< 20μs

4. Why A8 and O45 “Sweep” the Market: Hardcore Optimizations
#

Hundsun’s recent dominance with the A6, A8, and O45 series isn’t just about business logic—it’s about hardware-level engineering.

4.1 Cache Line Alignment
#

In modern CPUs, memory is read in 64-byte “Cache Lines.” If two threads modify different variables in the same cache line, they trigger False Sharing, killing performance. Hundsun’s ASAR uses Memory Padding to ensure that trading instructions are perfectly aligned with CPU caches, maximizing L3 cache hits.

4.2 CPU Pinning & Isolation
#

In an O45 deployment, specific CPU cores are isolated from the Linux OS. These cores run in a continuous Polling Loop, checking the network card for new packets every nanosecond. There is no “sleeping,” hence no “wake-up” delay.

4.3 Localization (Xinchuang) Optimization
#

The transition to Kunpeng (ARM) and Haikuang (x86) CPUs required a total rewrite of assembly-level instructions. Hundsun’s LDP platform manually optimizes the Instruction Pipeline for these domestic chips, ensuring that “Xinchuang” versions aren’t just compliant, but are actually faster than legacy Intel-based systems.


5. Summary: From “Trusting the OS” to “Bypassing the OS”
#

The evolution of investment trading systems can be summarized in one sentence: The less the Operating System does, the faster the trade happens.

  • O32/KCXP trusted the Linux Kernel to handle networking and the Database to handle state.
  • O45/A8/F2 bypass the Kernel for networking and use Distributed Memory (Raft/SMR) to handle state.

For architects, the choice between Hundsun and Kingdom now depends on ecosystem lock-in vs. flexibility. Hundsun’s LDP/ASAR offers a vertically integrated, ultra-fast stack that is difficult to beat in raw speed. Kingdom’s F2 offers a more modular, distributed approach that appeals to firms looking for horizontal scalability.


Final Thought: In the nanosecond world, there is no magic—only the brutal suppression of CPU context switches and the elimination of memory copies.

Related