ax-net 0.13.2

Unified network stack for TGOSKits (ArceOS, StarryOS, Axvisor)
Documentation

Unified network stack for TGOSKits systems.

ax-net provides the socket-facing API used by kernels and syscall layers, while delegating TCP/IP protocol mechanics to smoltcp. The crate exposes TCP, UDP, raw IPv4/IPv6 sockets, Unix domain sockets, optional vsock, DNS, DHCP helpers, readiness polling, and interface/control-plane queries.

Architecture

The stack intentionally uses one smoltcp Interface and one global SocketSet. Multiple physical or virtual devices are aggregated below that protocol core by router::Router, which acts as a multi-device smoltcp Device. This keeps socket ownership, port tables, listen queues, and routing decisions centralized instead of duplicating socket state per NIC.

Execution Model

A unique CPU-pinned protocol executor owns every smoltcp poll. Socket methods publish generations with request_poll() and then rely on poll/waker readiness; they never synchronously become a second protocol owner. Separate CPU-pinned queue executors own hard-IRQ continuation, DMA reclaim/refill, and bounded queue polling. Preallocated SPSC rings transfer move-only frame tokens between those two ownership domains.

Main Modules

  • service: owns the smoltcp interface and control plane.
  • poll_runtime: owns generation-based protocol scheduling.
  • queue_runtime: owns IRQ affinity domains and queue executors.
  • router: aggregates protocol ports, route lookup, and loopback.
  • socket, tcp, udp, raw: POSIX-like IP socket surface.
  • listen_table, orphan, wrapper: side tables around smoltcp sockets.
  • unix and vsock: local transports outside the smoltcp IP path.