OpenBSD BGP Router Benchmarking
I had an Open BSD 5.9 router that started to loss packets with moderate traffic levels (sometimes as low as 300 Mbs). The router had 1 Gbs upstream interfaces so I figured that the fault was with packets per second limits. What I needed to do is figure out was way to have the router forward a large amount of packets per second and see how it holds up I booted up a spare Linux server and hooked it up to one end of the router. Downloaded and compiled a UDP packet generator and ran the following
./snd -l DestinationIP:1234 -m 1000 -n 1000000000
DestinationIP is any IP that routes through the router. Interestingly the because UDP is connectionless protocol, the IP doesn't even have to belong to an actual server - much less to a server you control. As such port 1234 can be any number. What's happening is that you're essentially pointing a UDP fire hose to flow through your router into a non existent destination. On the router I watched the stats while decreasing -m until 28 (-m is the packet size and smaller size results in higher PPS)
#On Router
systat ifstat
I got only 50K PPS before packet loss appeared. This is way too low for the hardware that I was using ( decent server model circa 2015 ) Reading other people's benchmark results, it appeared that upgrading to the latest OpenBSD 6.4 may help. After the upgrade there was a huge increase. I am now getting: Lab test: 1400K PPS (very close to theoretical maximum for 1 Gbs connection with 84 byte packets) Real world: 680K PPS Just the upgrade of the OS increased the PPS performance by more than 13x. This without even trying additional tweaks found here: How to receive a million packets per second