For those unfamiliar, tokio-tun provides asynchronous bindings for allocating and working with TUN/TAP devices directly within Tokio's event loop.
I’d like to share a major update that dramatically expands platform reach and performance, marking a significant milestone as the crate matures toward its v1.0 release.
What’s New?
1. Cross-Platform Expansion: FreeBSD, macOS, iOS, and Android
tokio-tun is no longer Linux-only. You can now build unified, cross-platform networking tools and VPN clients with first-class support for:
-
macOS & FreeBSD: Native asynchronous allocation and configuration via the standard builder pattern.
-
Mobile (iOS & Android): Support for wrapping raw file descriptors provided by platform VPN APIs (such as Android’s
VpnServiceor Apple'sNEPacketTunnelProvider) directly into Tokio’s async reactor.
2. Linux Packet Offloading (GSO / GRO / VirtIO)
On Linux, throughput is paramount. The crate now supports kernel offloading features (virtio_net_hdr handling, GSO, and GRO). This allows:
- Passing larger aggregate buffers directly to/from userspace.
- Drastically cutting down syscall and context-switching overhead under heavy networking workloads.
1 post - 1 participant


