High performance SMB1/2/3 server.
smb-server-rs is a from-scratch implementation of the SMB family of
protocols, built directly against the public Microsoft Open Specifications —
MS-CIFS,
MS-SMB,
MS-SMB2 and
MS-NLMP.
It serves files and directories over the network to standard clients
(smbclient, Windows Explorer, macOS, the Linux kernel CIFS
upcall) with real NTLMv2 challenge/response authentication, message
signing on every dialect, and SMB 3.x negotiate contexts including
pre-authentication integrity and applied AES-GCM/CCM encryption.
It's organised as a focused cargo workspace — protocol codecs, transport, VFS abstraction, POSIX backend, auth, crypto service provider, server — so each layer stays readable and independently testable. The API docs below are generated straight from that workspace's doc comments.
Design
High performance — async Rust on io_uring
The server runs on a tokio_uring current-thread runtime:
networking and file I/O both go through io_uring with owned buffers —
no blocking std::fs/std::net, no ad-hoc
thread pool. Because io_uring resources are !Send,
per-connection state is driven entirely on one thread; cross-task
wakeups (async STATUS_PENDING completions, oplock/lease breaks,
CHANGE_NOTIFY) travel over mpsc channels to a dedicated
writer task.
VFS — trait-based backend support
One dialect-neutral Vfs trait separates protocol handling
from storage. SMB1 and SMB2 dispatchers translate wire commands into
the same neutral operations, so every dialect drives identical backend
behavior and stays behaviourally consistent. The bundled
smb-server-backend-posix implements it directly against
POSIX semantics; a new storage backend is just a new Vfs impl.
Interop testing — three suites, full SMB1/2/3 coverage
unit (in-process Rust tests), system (a Rust
harness driving the server through Python's smbprotocol),
and protocol (Microsoft's own MS-SMB2 Server Test Suite,
vendored as a submodule) all feed the live results above. Coverage
spans every dialect from NT LM 0.12 through 3.1.1 plus the advanced
feature set — oplocks, leases (v2/v3) with break notifications,
durable/persistent handles, an enforced byte-range lock conflict
matrix, and SMB3 encryption/compression.
CSP — modular crypto service provider
One stable API (MD4, HMAC-MD5/SHA256, AES-GCM/CCM, RC4, SHA-256, AES-CMAC/GMAC) behind two interchangeable backends chosen at compile time: maintained RustCrypto crates by default (hardware-accelerated AES-NI where available), or a bundled from-scratch implementation with zero external dependencies. Both must produce byte-identical output against the same test vectors.
Type-state request lifecycle
Each SMB2 command's lifecycle — accepted, pending, completed,
unsolicited — is encoded as distinct Rust types instead of a runtime
enum plus comments. A request is decoded once into its owning
Command handler and resolved to an Outcome;
illegal sequences (completing a request twice, replying to one that
was never accepted) become compile errors instead of runtime bugs.
API documentation
The server binary: CLI, accept loop, observability wiring.
Dialect-neutral protocol primitives: codec trait, NT status codes, FILETIME, buffer helpers.
SMB1 (MS-SMB/MS-CIFS) wire structures: headers, commands, TRANS2 information levels.
SMB2 wire structures (MS-SMB2).
SMB3 additions over SMB2: encryption, pre-authentication integrity.
Async SMB message transport abstraction: TCP/NBSS and in-memory implementations.
Dialect-neutral virtual filesystem interface implemented by storage backends.
Default POSIX async-fs storage backend for the VFS.
NTLMSSP messages, SPNEGO wrapping, NTLMv1/v2 verification.
Crypto service provider: RustCrypto-backed with bundled fallbacks.
Pluggable durable/persistent SMB handle store (local and replicated backends).
Conformance/interoperability test harness for the server.
REST + web dashboard exposing test pass/fail status from a CSV.
Testing
Live results from the three-suite model (unit, system,
the vendored protocol suite) — regenerated from
test_status.csv on every push. See
test/README.md
for how to run them locally.
| Suite | Passed | Failed | Skipped | Total |
|---|
| Suite | Name | Category | Status |
|---|