Fugu is a large-scale high-performance internet networking and cryptography library used by software such as Loop and Dora. It has a userspace IPv4 and IPv6 networking stack that implements UDP and TCP, performing I/O with XDP, Netmap, and other packet APIs. Fugu has asynchronous implementations of the TLS 1.3 and TLS 1.2 standards, and can perform public-key cryptography operations such as digital signatures and key derivation at very high rates using GPUs. Fugu's worker-owned architecture is designed for exceptionally large TCP and TLS concurrent connection density and very high rates of new unresumed TLS handshakes.
Fugu is an internet networking and cryptography library. It is maintained as a reference implementation by closely adhering to the relevant standards. It is packaged for Red Hat Enterprise Linux, Fedora, Ubuntu, Debian, Amazon Linux, and Azure Linux.
Choose userspace or kernel packet paths while retaining the same event-driven, bounded-resource programming model.
Multiple network I/O backends
Select a backend to suit the deployment, from direct Ethernet frame I/O to kernel sockets.
- Linux AF_XDP with packet-ring integration
- Netmap packet I/O backend
- UDP and TCP over kernel sockets
- Unix-domain socket and mock Ethernet backends for integration tests
Exclusive worker thread ownership
Keep transport state on its owning worker thread instead of using shared structures and mutexes.
- Worker thread-local packet, flow, stream and TLS state
- Task-manager integration and direct owner callbacks
- Bounded cross-worker-thread handoff queues
- No per-flow mutex on the raw networking fast path
Multi-queue receive and transmit
Distribute traffic across hardware queues and application workers without handing connection state between owners.
- Device-queue assignment and flow-affinity steering
- Software tuple hashing and controlled packet forwarding
- Optional hardware RSS metadata and qualified table mapping
- Multi-adapter, separately owned networking fabrics
Packet budgets and offload controls
Make packet ownership, buffer capacity and hardware capabilities explicit to the embedding application.
- Bounded RX/TX pools with acquire, commit and cancel
- Exactly-once receive-buffer return
- Negotiated TX TCP/UDP checksum offload
- Conditional verified RX checksum and RSS offload
Build services directly on Ethernet, with transport-independent IP protocol handling and explicit resource limits.
Ethernet and VLAN handling
Receive, validate and generate Ethernet frames for direct attachment to virtual or physical network interfaces.
- Ethernet II header and MAC address validation
- Untagged, single-tag and double-tag 802.1Q frames
- Per-interface routing domain and generation metadata
- Virtual links for deterministic network testing
IPv4 and IPv6
Process dual-stack traffic efficiently inside Fugu instead of delegating packet parsing and construction to the host IP stack.
- IPv4 header, length and checksum validation
- IPv6 header and bounded extension-header processing
- ARP and IPv6 Neighbor Discovery
- IPv6 address states, DAD and duplicate detection
Routing, ICMP and path MTU
Select appropriate next hops, react to validated network errors and enforce packet-size constraints.
- On-link and gateway routing with prefix/metric entries
- ICMPv4 and ICMPv6 error and Echo handling
- Path MTU discovery and expiring PMTU state
- Validated ICMP errors correlated to active transports
Bounded fragment processing
Handle fragmented input without surrendering unbounded memory or accepting overlapping reassembly ranges.
- IPv4 and IPv6 receive-side reassembly
- Limits on fragments, bytes and concurrent assemblies
- Fragment overlap rejection and expiration
- Completed datagram validation before delivery
Use transports to implement application servers, proxies, DNS nameservers and other long-lived services.
UDP
Operate connectionless datagram services using either userspace Ethernet frame I/O or kernel networking.
- IPv4/IPv6 listeners and independent client endpoints
- Source, destination and interface metadata
- Per-send traffic class and hop-limit selection
- Atomic datagram admission and bounded TX queues
Stateful TCP streams
Accept or initiate TCP connections with callback-driven streaming and deliberate buffer ownership.
- Passive and active opens
- Readable, writable, EOF, close and connect callbacks
- Per-stream receive/transmit limits and backpressure
- Orderly bidirectional shutdown and TIME_WAIT handling
Loss recovery and congestion control
Implement reliable TCP transport across out-of-order delivery, loss and changing path characteristics.
- Cumulative ACKs, retransmission and RTO timers
- Out-of-order receive and SACK recovery
- Reno/NewReno and CUBIC congestion control
- Persist probes, ECN policy and optional PLPMTUD
TCP options and admission defense
Negotiate modern TCP features while controlling the cost of unauthenticated handshakes.
- Stateless SYN cookies and bounded half-open admission
- MSS, window scaling, timestamps and PAWS
- SACK-permitted negotiation and selective ACK blocks
- Explicit opt-in TCP Fast Open with replay-aware callbacks
Secure high-concurrency services with an embeddable record and GPU-accelerated TLS handshake engine.
Modern TLS server protocols
Implement TLS server sessions with selectable cryptographic suites, post-quantum cryptography, and bounded state transitions.
- TLS 1.3 and TLS 1.2 server implementations
- X25519, secp256r1, secp384r1, X25519MLKEM768 groups
- TLS 1.3 AES-128-GCM and AES-256-GCM suites
- TLS 1.3 ChaCha20-Poly1305 suite
- Enforceable TLS 1.3 minimum-version policy
Asynchronous handshake crypto
Keep the owning network worker responsive while expensive signature and key-agreement operations execute asynchronously.
- Vulkan GPU cryptography offload, and optional software fallback
- Owner-delivered public-key completion callbacks
- Separate engine shards and pending-work budgets
- Bounded handshake state, time and work admission
Session resumption and early data
Reduce the cost of repeat connections while preserving explicit replay and ticket-key policy.
- TLS 1.2 session tickets
- TLS 1.3 PSK and session-ticket resumption
- Rotatable ticket-key rings
- TLS 1.3 0-RTT under application replay policy
Credentials and handshake selection
Choose identity, protocol and handshake characteristics without allocating full policy copies per connection.
- PEM/DER certificate and private-key handling
- ecdsa_secp256r1_sha256 and ecdsa_secp384r1_sha384 signature algorithms
- SNI and ALPN selection
- HelloRetryRequest and optional hybrid key exchange
- OCSP stapling
Records and session lifecycle
Handle partial records, authenticated application traffic and orderly shutdown with explicit usage limits.
- Incremental TLS record framing and AEAD processing
- TLS 1.3 KeyUpdate and close_notify
- TLS 1.3 exporters and optional diagnostic key logging
- Application-data, record and handshake-buffer quotas
Offload expensive, parallelizable public-key cryptographic operations to GPU co-processors, freeing CPUs for application processing work.
GPU compute and batching
Queue independent public-key jobs to Vulkan devices while retaining asynchronous host-side completion.
- Vulkan compute-shader execution
- Batched job submission and completion delivery
- Device selection and multi-device manager interfaces
- Admission credits and bounded queued work
Digital signatures
Offload signature-oriented workloads including PKI and DNSSEC to GPUs.
- RSA signing and verification kernels
- ECDSA P-256/P-384 signing and verification
- Post-quantum ML-DSA-44 signing and verification
- GPU-offload of signing and verification for all required DNSSEC algorithms
- Ed25519 signing operations (currently CPU-only)
Elliptic-curve key agreement
Offload key exchange algorithms used to establish fresh secure sessions.
- X25519 public-key and shared-secret operations
- P-256 and P-384 public keys and ECDH
- Asynchronous TLS handshake dispatch
- GPU and software execution paths selected by policy
Post-quantum cryptography
Use implemented key-encapsulation and signature primitives in hybrid and post-quantum integration paths.
- ML-KEM-768 encapsulation and decapsulation
- Hybrid X25519MLKEM768 TLS key exchange
- ML-DSA-44 signature processing
- Separate operation, batch and resource accounting
The reusable systems foundation used by the Fugu networking code is also available to application developers.
Task and event execution
Compose asynchronous services around events, task ownership and explicit shutdown notifications.
- Task-manager worker scheduling
- Task event posting, cancellation and detachment
- Exclusive task execution and task pools
- Shutdown and lifecycle callbacks
Timers, inboxes and scheduling hooks
Schedule work without polling every connection or creating a timer thread per operation.
- Worker-local deadline timers and callbacks
- Bounded worker inboxes and wakeups
- Pre-poll hooks for NIC and accelerator progress
- Reusable timers, quotas and rate limiters
Memory contexts and buffers
Keep object lifetime and byte budgets visible in the embedding application's resource model.
- Reference-counted memory contexts and pools
- Input/output buffers, regions and byte cursors
- Bounded per-worker and per-connection reservations
- Explicit ownership transfer and cleanup APIs
Cross-worker coordination
Move results between independently owned workers with narrow, bounded handoff contracts.
- Single-producer/single-consumer (SPSC) work lanes
- Async public-key resume queues
- Wakeup, completion and callback routing
- Avoidance of shared mutable connection state
Admission and backpressure
Protect latency and memory capacity when incoming traffic or expensive handshakes exceeds configured budgets.
- Per-service, per-worker and per-flow limits
- Connection, listener and pending-send quotas
- Explicit backpressure and rejection results
- Retained-byte and asynchronous-job accounting
Reuse higher-level network protocol components without pulling a monolithic application server into the library.
HTTP and URL processing
Parse HTTP-related wire formats and construct outbound requests for embeddable clients.
- HTTP/HTTPS URL parsing and normalization
- Bounded HTTP response-header parsing
- HTTP client request generation and response reading
- Controlled header, body-prefetch and line-size limits
WebSocket protocol support
Integrate persistent bidirectional control channels with an RFC 6455 codec.
- HTTP Upgrade request and acceptance helpers
- Text, binary, continuation and control frames
- Fragment assembly and message-size limits
- Ping, pong and close-frame processing
JWT and authenticated control
Build authenticated service-to-service messages with structured payloads and shared-secret verification.
- HMAC-SHA256 JWT creation and parsing
- Nonce and signed manager-control requests
- Bounded JSON control-message handling
- Typed control responses and error propagation
Akira management integration
Reuse the manager connection components for applications that integrate into the Akira control plane.
- Authenticated bootstrap and manager WebSocket protocol
- Reconnect and retry/backoff state machines
- Configuration, status and graph-response workflows
- Asynchronous runtime and explicit shutdown
Fugu supplies many of the typical utility components that networking services are built on.
Configuration and lexical parsing
Embed typed configuration languages and parsers with clear diagnostics and managed object lifetimes.
- Reusable lexer and token processing
- Typed maps, lists, tuples and value grammars
- Include handling, diagnostics and parse contexts
- Address and network configuration helpers
Names, addresses and access policy
Inspect network identities and apply address- or name-based policy in an application.
- IPv4/IPv6 address and prefix utilities
- Domain-name handling and wire compression
- IP prefix tables and network ACL matching
- Interface enumeration, port sets and scopes
Containers and indexing
Use proven foundational data structures for routing, scheduling and protocol state.
- Hash tables, red-black and radix trees
- Heaps, rings, linked lists and queues
- Symbol tables, counters and reference counting
- Configurable object and resource pools
Encoding and document primitives
Work with network byte streams, structured text and protocol encodings using shared library utilities.
- Base32, Base64, hexadecimal and text encoders
- XML document and element construction
- Safe integer, time and string parsing helpers
- Binary wire, buffer-region and endianness operations
Logging and process utilities
Integrate Fugu services into operating-system process lifecycles and operational diagnostics.
- Structured logging levels and error results
- Statistics, counters and timing utilities
- PID files, file operations and daemon lifecycle
- Privilege, chroot, host and socket utilities
For software vendors, service providers, and cloud operators, Fugu brings large-scale high-performance userspace networking, TLS, GPU cryptography, and the surrounding systems infrastructure into one embeddable C library. Integrate the components your product needs, with explicit choices about transport backends, connection ownership, cryptographic acceleration, and resource budgets.
Fugu is offered under commercial license by Akira. It is packaged for Red Hat Enterprise Linux, Fedora, Ubuntu, Debian, Amazon Linux, and Azure Linux.