lneto
Low-level networking operations.
lneto is pronounced "L-net-oh", a.k.a. "El Neto"; a.k.a. "Don Networkio"; a.k.a "Neto, connector of worlds".
Features
lneto provides the following features:
- Zero Operating System required. Zero. All protocols (including TCP, excepting NTP) are time-independent.
time.Sleep nor time.Now calls unless configured by user.
- Zero scheduling required. No goroutines/channels use in Lneto. Can be run in event loop.
- Heapless packet processing
httpraw is likely the most performant HTTP/1.1 processing package in the Go ecosystem. Based on fasthttp but simpler and more thoughtful memory use.
- httφ - Heapless HTTP router and zero-copy response writing with Go's standard library API.
- Lean memory footprint
- Empty go.mod file. No dependencies except for basic standard library packages such as
bytes,errors,io.
net only imported for net.ErrClosed.
- Can produce very small binaries. Ideal for embedded systems.
- Extremely simple networking stack construction. Can be used to teach basics of networking
- Stack can be fuzz tested efficiently, see benchmarks below:
go test ./x/xnet/ -run FuzzStackAsyncHTTP -fuzz=. fuzzes Ethernet/IP/TCP/HTTP stack with 170k HTTP exchanges per second on 12 core machine: fuzz: elapsed: 4m9s, execs: 42649941 (169428/sec), new interesting: 5 (total: 52)
- TLS: Heapless and memory constrained for use on microcontrollers. Not externally audited, use only if you understand the risks!
Docs and reference
Examples, API reference, protocol support matrix, benchmarks can be found indocs
Users
lneto is currently being used primarily by embedded developers and those who need a lighter alternative to gVisor in terms of memory usage and binary size.- Hewlett Packard Enterprise(2): TCP stack used to stream firmware to datacenter servers at boot time.
- 9elements: Bootloader networking stack on AST 2700
- soypat/cyw43439: Enabling internet access on Raspberry Pi Pico W. See
examples. - tinygo-org/espradio: Enabling internet access on Espressif's ESP32s.
- TamaGo: Enabling networking on Go baremetal projects. See go-net project.
- netbird.io(planned): Secure remote P2P access.
- soypat/lan8720: Enabling internet access with 100M ethernet PHY devices.
Lneto in the media
- Talk FOSDEM26 Networking on Microcontrollers with Go/Lneto - History of Lneto and the reasoning behind its design
- Talk OSFC26 Running baremetal Go in the AST2700 for simpler server management - Running Tamago with Lneto on server hardware, no operating system
- Talk GopherconEU26 Andrea Barisani TamaGo talk - TamaGo showcase mentioning Lneto as a alternative option to gVisor
- Developer tutorial Official Espressif TinyGo Embedded Workshop - Espressif uses Lneto as the networking stack for ESP32 microcontrollers
Packages
lneto: Low-level Networking Operations, or "El Neto", the networking package. Zero copy network frame marshalling and unmarshalling.
lneto/validation.go: Packet validation utilities
lneto/internet: Userspace IP/TCP networking stack. This is where the magic happens. Integrates many of the listed packages.
lneto/internet/pcap: Packet capture and field breakdown utilities. Wireshark in the making.
lneto/http/httpraw: Heapless HTTP header processing and validation. Does no implement header normalization.lneto/tcp: TCP implementation and low level logic.lneto/ipv4/linklocal4: RFC 3927 IPv4 link-local (APIPA) address autoconfiguration. Heapless claim-and-defend state machine for self-assigned 169.254.x.x addresses when no DHCP server is available.lneto/dhcpv4: DHCP version 4 protocol implementation and low level logic.lneto/dns: DNS protocol implementation and low level logic.lneto/ntp: NTP implementation and low level logic. Includes NTP time primitives manipulation and conversion to Go native types.lneto/internal: Lightweight and flexible ring buffer implementation and debugging primitives.lneto/x: Experimental packages.
lneto/x/xnet: net package like abstractions of stack implementations for ease of reuse. Still in testing phase and likely subject to breaking API change.
- lneto/x/nts: Network Time Security (RFC 8915). NTS-KE key exchange over TLS 1.3 and AEAD-authenticated NTP client/server. Ships no cryptography itself; the caller supplies the mandated AEAD_AES_SIV_CMAC_256 cipher.AEAD implementation.
LLM Policy / AI Policy
LLMs are a tool. As such they should be used carefully. The policy for this project is covered in Oxide's RFD576.Examples of LLM contribution in lneto:
- https://github.com/soypat/lneto/pull/19 and https://github.com/soypat/lneto/pull/18: Egon told me he was using an LLM to find bugs in lneto before submitting these PRs.
- https://github.com/soypat/lneto/commit/6b06cb1237071a0c22f86821db5aaa6135996e98: Writing tests to capture functionality in lneto that has been tested and works.
- https://github.com/soypat/lneto/commit/7042a653a6e46999314c2e36dd5c868bcbc68908: adding mutex locking on tcp.Conn