← All projects
Project record1 mention
Originally shared on Hacker News

swgp-go

A WireGuard proxy written in Go that now supports UDP Generic Receive Offload (GRO) and Generic Segmentation Offload (GSO). By coalescing multiple same-sized UDP packets into a single buffer and sending them in one syscall, the proxy traverses the kernel network stack once instead of per-packet, significantly lowering overhead and improving throughput, and it copes with the in-kernel WireGuard driver's lack of UDP GSO by coalescing unsegmented messages received in a single recvmmsg call.

Last shared
01 / The problem

What it addresses

Sending individual UDP packets via sendmsg incurs high kernel overhead, and the in-kernel WireGuard driver does not take advantage of UDP GSO.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. swgp-go

    A WireGuard proxy written in Go that now supports UDP Generic Receive Offload (GRO) and Generic Segmentation Offload (GSO). By coalescing multiple same-sized UDP packets into a single buffer and sending them in one syscall, the proxy traverses the kernel network stack once instead of per-packet, significantly lowering overhead and improving throughput, and it copes with the in-kernel WireGuard driver's lack of UDP GSO by coalescing unsegmented messages received in a single recvmmsg call.

    Problem: Sending individual UDP packets via sendmsg incurs high kernel overhead, and the in-kernel WireGuard driver does not take advantage of UDP GSO.

    Posted by @database64128 · Original source ↗

    Source text · @database64128 · · Source ↗

    I just finished adding UDP GRO & GSO support to my WireGuard proxy software. The work involved rewriting a large part of the program.