SmolNet is an Elixir library for running independent TCP/IP stacks within an OTP application. Built on Rust’s smoltcp, it supports IPv4 and IPv6 over an application-defined raw-IP transport and provides familiar :gen_tcp and :gen_udp interfaces alongside a lower-level socket API. Precompiled native components are available for Linux and Apple Silicon macOS.
Why a userspace network stack?
BEAM applications normally use the host kernel’s network stack, which is the right choice for ordinary clients and servers. An application-owned stack is useful when packets need to travel over something other than a host network interface, or when a program needs isolated addresses, routes, sockets, and failure domains. Examples include encrypted tunnels, network simulations, packet-level tests, and application-defined transports.
gVisor’s Netstack is a larger example of the same architectural idea: its Go userspace network stack lets a sandbox handle network protocols without giving the application direct access to the host network stack. SmolNet applies that idea at a smaller scale for Elixir. It combines
smoltcp’s protocol implementation with OTP supervision, bounded native work, and standard Erlang socket interfaces.SmolNet is transport-neutral. It does not provide an Ethernet device, TUN/TAP setup, or a VPN protocol. Your link process decides where emitted raw IP packets go and feeds packets from that transport back into the stack.


















