vikrant69g blog

Someone built a 100 Gbps packet generator in Go

A network engineer pushed Go to saturate a 100 Gbps link using AF_XDP. The surprising bit is not the speed, it is that Go got there at all.

Network interface card with fibre optic cables connected to ports, close-up of circuit board and LED indicators

A network engineer named Andree Toonk just published Wireblast, a packet generator written in Go that saturates a 100 Gbps network link. The interesting bit is not the raw speed. Packet generators are supposed to be fast. The interesting bit is that Go is usually the wrong tool for this job. Most packet generators are written in C or assembly. They bypass the kernel network stack entirely using techniques like DPDK or kernel bypass drivers. The kernel is slow when you need to shove millions of packets per second through a NIC. Go has a garbage collector and a runtime scheduler, both of which add latency spikes that kill throughput at line rate. Toonk used AF_XDP, a Linux socket type that maps NIC ring buffers directly into userspace. Packets skip most of the kernel. The NIC writes directly to memory that the application can read. No copies, no context switches. AF_XDP is newer than DPDK and still has rough edges, but it works with standard Linux networking instead of requiring custom drivers. The part that caught my attention is how he tuned the Go runtime. He pinned goroutines to specific CPU cores, disabled the garbage collector during packet transmission, and preallocated all memory up front. Go is not designed for real-time performance, but if you remove the GC pauses and control scheduling, it gets close enough. The code is on GitHub. It is readable, which is rare for packet generators. Most of them are optimised C that reads like assembly with extra steps. Wireblast trades a bit of theoretical max performance for maintainability. For testing network equipment or DDoS mitigation systems, that trade makes sense. You need sustained load, not the absolute highest burst rate. I would not use this for production traffic shaping. But for lab work or capacity testing, this is the first packet generator I have seen that I could actually debug without relearning C pointer arithmetic.


Source: Wireblast a 100 Gbps packet generator in Go using AF_XDP