3 releases
0.0.2 | Feb 8, 2020 |
---|---|
0.0.1 | Jan 4, 2020 |
0.0.1-wip | May 6, 2019 |
#22 in #ethernet
Used in ethox-io-uring
1MB
19K
SLoC
A standalone library for user-space networking and unikernels.
Table of contents
This is also a recommended reading order but feel free to skip ahead, each chapter tries to be somewhat self-contained.
Highlights
The most interesting features in overview:
- Zero-copy and bufferless TCP (re-)transmission
- Free choice of policy for packet queueing
- Optional tuntap and raw socket adapters with gigabit data rates
Also, I'm very grateful for @whitequark's smoltcp
. The overall structure may be quite
different but the large portions of the wire
module wouldn't have been possible without and
lessons learned from studying it were integral to the design. (Maybe also look at her other
projects if you have the time, very often delightful).
Design and relevant core concepts
This library handles network packets with a tree of callbacks. Don't expect builtin socket interface although such adaptors may be written using the library.
Nothing within ethox
ever dynamically allocates memory (and there is no arbitrary
recursion). It may call user callbacks where you can optionally do so but it is never
required for operating. This may seem restrictive at first but in practice it simply means that
setup code will explicitely pass in preallocated memory to use instead of it being a runtime
choice. The philosophy of upfront, explicitely resource management also extends beyond
allocation. If there is any resource that connections may compete for then it tries to
partition them prior in a way that some minimum share is guaranteed for each or, where this is
not clearly possible, exposes that choice to the caller.