smoltcp-rs/smoltcp
67.1
Adequate · 30 September 2026
48.3k
lines of production code
Rust
primary language
2
measurements over time
What this system is
This system is a standalone, zero-dependency TCP/IP network stack library for Rust, designed to handle packet parsing, serialization, and protocol logic without relying on an operating system's network driver. It provides comprehensive support for Ethernet, IPv4, IPv6, TCP, UDP, ICMP, DHCP, DNS, and 6LoWPAN, including advanced features like fragmentation reassembly, neighbor caching, and configurable TCP congestion control. The library exposes a user-managed socket API with explicit buffer control and async waker support, allowing applications to integrate networking capabilities directly into embedded or custom environments.
How it got here
2016 — comprehensive network stack rewrite
9 changes.
The project underwent a major architectural overhaul, introducing a new modular network interface subsystem, explicit socket management with async support, and a comprehensive phy layer for hardware abstraction. This period also saw the addition of extensive wire-layer parsers for foundational protocols and the release of version 0.14.0, which adopted the Rust 2024 edition and expanded feature sets for testing and configuration.
2017–2022 — Network stack architecture and tooling
6 changes.
This period focused on restructuring the network stack by splitting interface logic into dedicated protocol modules and introducing a new storage layer with ring buffers and TCP assembly. Development also included adding comprehensive fuzzing targets, benchmarking suites, and a PCAP conversion utility to support testing and analysis.
2023–2025 — RPL and TCP congestion control implementation
7 changes.
This period focused on implementing foundational networking features, including the RPL routing protocol for low-power networks and configurable TCP congestion control algorithms like Reno and CUBIC. Significant effort was also dedicated to expanding 6LoWPAN support and enhancing test coverage through comprehensive unit and network simulation tests to validate throughput and fairness.
Features
Add 6LoWPAN fragment and IP header compression support
The \src/wire/sixlowpan\ module now implements parsing and representation for 6LoWPAN Fragment headers (RFC 4944) and IP Header Compression (RFC 6282). Users can now process fragmented 6LoWPAN packets and decompress compressed IPv6 headers, including handling of address modes, hop limits, and next-header compression via the new \frag\, \iphc\, and \nhc\ submodules.
src/wire/sixlowpan · high confidence
Add TCP Reno and CUBIC congestion control algorithms
The TCP socket layer now includes configurable congestion control algorithms, specifically Reno and CUBIC, alongside a no-control option. This allows the network stack to manage bandwidth and react to packet loss according to standard TCP behaviors (RFC 5681 for Reno, RFC 9438 for CUBIC), improving throughput and fairness in varying network conditions.
src/socket/tcp/congestion · high confidence
Add packet2pcap utility for converting raw packets to PCAP format
A new command-line utility, packet2pcap, has been added to the utils directory. This tool allows users to convert raw packet files into standard PCAP format by specifying an input file, an output file, and a link type (either 'ethernet' or 'ip') via command-line arguments. It leverages the smoltcp library's PcapSink to handle the PCAP header and packet writing, providing a simple way to analyze captured network data with standard tools.
utils · high confidence
Add raw socket and TUN/TAP interface support for Unix platforms
This change introduces the underlying system interfaces for network packet capture and virtual network devices on Unix-like systems. For Linux and Android, it adds \RawSocketDesc\ (using \AF\_PACKET\ sockets) and \TunTapInterfaceDesc\ (using \/dev/net/tun\), allowing the library to send and receive raw Ethernet or IP packets and interact with virtual TUN/TAP devices. For other Unix platforms (macOS, iOS, FreeBSD, NetBSD, OpenBSD), it adds \BpfDevice\ support via Berkeley Packet Filter (BPF) interfaces to provide equivalent raw socket functionality. These components are gated behind new feature flags (\phy-raw\_socket\ and \phy-tuntap\_interface\) and are not automatically enabled by the \phy-tuntap\_interface\ feature, requiring explicit opt-in.
src/phy/sys · high confidence
Initial implementation of RPL routing protocol components
This change introduces the foundational building blocks for the RPL (Routing Protocol for Low-Power and Lossy Networks) implementation in \src/iface/rpl\. It adds core data structures and algorithms required for DODAG formation and maintenance, including a lollipop sequence counter for version tracking, a rank calculation system for parent selection, an objective function (OF0) for path cost evaluation, a parent set manager for storing neighbor information, and a relations table for tracking next-hop mappings. Additionally, it implements the Trickle algorithm for efficient DIO message dissemination and defines protocol constants such as sequence window size and default intervals.
src/iface/rpl · high confidence
New and updated network examples
The examples directory now includes a comprehensive set of demonstration applications: a TCP client and server, an HTTP client, a DNS resolver, a DHCPv4 client, ICMP ping (supporting both IPv4 and IPv6), and benchmarks for both standard and 6LoWPAN loopback interfaces. Additional examples demonstrate multicast communication over IPv4 and IPv6, and a dedicated 6LoWPAN example for IEEE 802.15.4 networks. These examples showcase the library's socket APIs, interface configuration, and support for various network mediums.
examples · high confidence
New phy module with device abstractions and middleware
The \src/phy\ module introduces a \Device\ trait for network hardware abstraction, along with several concrete implementations and middleware components. Users can now utilize a \Loopback\ device for zero-dependency testing, a \RawSocket\ adapter for direct frame access on Unix systems, and a \TunTapInterface\ for virtual TUN/TAP networking. For debugging and testing, the module provides a \Tracer\ to pretty-print packets, a \PcapWriter\ to capture traffic in libpcap format, a \FaultInjector\ to simulate packet loss and corruption, and a \FuzzInjector\ to mutate packets for fuzzing internal state machines.
src/phy · high confidence
New storage module with RingBuffer, PacketBuffer, and TCP Assembler
The \src/storage\ module introduces specialized containers for network data handling. It adds a zero-copy \RingBuffer\ supporting both discrete (single-element) and continuous (slice-based) operations, a \PacketBuffer\ that manages separate metadata and payload rings for UDP/ICMP/Raw sockets, and a new \Assembler\ for reassembling out-of-order TCP segments while tracking data gaps. These components provide the underlying memory management and reassembly logic for the network stack's socket implementations.
src/storage · high confidence
New wire-layer packet parsers for ARP, DHCPv4, DNS, Ethernet, ICMP, IEEE 802.15.4, IGMP, IP, and IPsec AH
The \src/wire\ module now includes representation and packet types for several foundational network protocols. This adds the ability to parse and emit Ethernet II frames, ARP requests and replies, DHCPv4 client/server messages (including option writing and DNS server limits), DNS queries and responses, ICMPv4 and ICMPv6 messages (with support for IPv6 extension headers and multicast listener protocols), IEEE 802.15.4 link-layer frames, IGMPv1/v2 group management, generic IP version detection, and IPsec Authentication Header validation. These changes enable the library to handle lower-layer protocol interactions and address resolution without requiring external dependencies.
src/wire · high confidence
Architecture
Network interface logic split into dedicated protocol and medium modules
The interface implementation has been reorganized by splitting the monolithic code into separate modules for Ethernet (\ethernet.rs\), IEEE 802.15.4 (\ieee802154.rs\), IPv4 (\ipv4.rs\), IPv6 (\ipv6.rs\), 6LoWPAN (\sixlowpan.rs\), TCP (\tcp.rs\), UDP (\udp.rs\), and multicast (\multicast.rs\). This change isolates the processing and dispatching logic for each network layer and medium type, making the interface easier to maintain and allowing features to be enabled or disabled independently via Cargo features.
src/iface/interface · high confidence
Behavioural changes
2 commits (0 fixes) modifying fuzz/corpus
A change to existing behaviour in fuzz/corpus — 2 commits, 10 files.
fuzz/corpus · medium confidence · unverified
Introduce explicit, user-managed socket API with async waker support
The networking stack now uses a new socket module where applications explicitly allocate and manage transmit and receive buffers for TCP, UDP, ICMP, raw IP, DHCPv4, and DNS sockets, rather than relying on implicit OS buffering. This change introduces a unified \Socket\ enum and \AnySocket\ trait for type-safe downcasting, and adds async \async\ support via \WakerRegistration\ on all socket types, allowing applications to be notified of state changes (such as data availability or buffer space) without polling.
src/socket · high confidence
Library restructured with new internal modules and refined time handling
The library's internal structure has been reorganized: the \enum\_with\_unknown\ macro and Ethernet frame logic have been moved from \lib.rs\ and \ethernet.rs\ into dedicated \macros.rs\ and \parsers.rs\ modules, while a new \rand.rs\ module provides a simple PRNG for socket port selection. Additionally, the \time.rs\ module now uses microsecond precision for \Instant\ and \Duration\, fixing previous conversion bugs with \std::time\ and improving display formatting.
src · high confidence
New network interface subsystem with packet reassembly and neighbor caching
The \src/iface\ module introduces a new network interface implementation that includes a packet assembler for reassembling fragmented IPv4/IPv6 and 6LoWPAN packets, a neighbor cache backed by a heapless LinearMap with rate-limiting and expiration, a route table supporting default gateways for IPv4 and IPv6, and socket metadata tracking for neighbor discovery state. This change replaces the previous interface logic with a modular architecture featuring fragmentation handling, neighbor cache eviction, and SLAAC integration for IPv6 address configuration.
src/iface · high confidence
Project license changed from Apache-2.0 to 0-Clause BSD
The project license has been switched from the Apache License 2.0 to the 0-Clause BSD License. The Apache and MIT license files have been removed and replaced with a new LICENSE-0BSD.txt file, and the CONTRIBUTING.txt file has been updated to reflect the new license terms.
(repo-wide) · high confidence
TCP congestion control API redesign with configurable controllers
The TCP socket layer now supports pluggable congestion control algorithms, allowing users to select between Cubic, Reno, or no control based on compile-time features or runtime configuration. The new \Controller\ trait defines the interface for these algorithms, and the \AnyController\ enum manages the active instance, prioritizing Cubic for throughput or Reno for conservative, low-power scenarios. This change provides a more flexible foundation for loss-based congestion algorithms in TCP connections.
src/socket/tcp · high confidence
Test coverage
Add network simulation test snapshots; Added benchmark tests for network packet emission; Added fuzzing targets for network protocol parsers and interface logic; Added network simulation tests for TCP throughput and multi-flow fairness; Expanded network interface test coverage for IPv4, IPv6, and 6LoWPAN.
Dependencies
smoltcp v0.14.0 release with Rust 2024 edition and dependency upgrades
The smoltcp library has been updated to version 0.14.0, adopting the Rust 2024 edition and raising the Minimum Supported Rust Version (MSRV) to 1.91. This release upgrades several core dependencies, including \managed\ to 0.8, \byteorder\ to 1.0, and \heapless\ to 0.9, while also adding \libc\ as an optional dependency for raw socket support. A new fuzzing crate (\smoltcp-fuzz\) has been introduced to test packet parsers and interface logic using \libfuzzer-sys\. The feature set has been expanded with new compile-time configuration options for interface address counts, multicast group limits, neighbor cache sizes, and route counts, alongside features for TCP congestion control algorithms (Cubic, Reno) and segmentation offload.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 71 → 67 (-4.0)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 86 → 86 (+0.0)
- Architecture 100 → 90 (-10.4)
- Maturity 52 → 52 (+0.1)
- Readiness 85 → 75 (-10.4)
- Security 85 → 90 (+4.9)
- Event Sourcing 100 → 100 (+0.0)
- Performance 80 (new)
Resolved (7)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Hotspot: src/iface/interface/mod.rs (src/iface/interface/mod.rs)
- Hotspot: src/socket/dns.rs (src/socket/dns.rs)
- Hotspot: src/wire/rpl.rs (src/wire/rpl.rs)
- Hotspot: src/wire/tcp.rs (src/wire/tcp.rs)
- Off-boarding risk: anonymized user #1
New (6)
- Dependency hygiene PARTLY measured — Cargo dependencies read, no committed lock to grade for currency
- Duplicate intent across types: Interface and InterfaceInner both expose ipv4_addr and ipv6_addr. InterfaceInner appears to be an internal implementation detail that is accidentally or unnecessarily exposed in the public API with overlapping methods.
- Inconsistent naming and redundancy: get_source_address takes a generic IpAddress but returns IpAddress, while the specific variants take specific types. This creates a confusing API where the generic method might be ambiguous or less efficient than the specific ones, yet they are all exposed.
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
- Redundant operation: poll and poll_egress appear to perform the same core function (processing network events). In many network stacks, poll is the standard entry point. Having a separate poll_egress suggests either a duplicate or a confusing split of responsibilities without clear documentation on why one would use poll_egress over poll.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
smoltcp-rs/smoltcp was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit efcba2efc87b6dcc8a2953de5768dbcc83b8fac6 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.