Cory Upchurch

Home / Writing

My firewall wasn't slow. The port was.

Summary

After upgrading to 1 Gbps symmetric fiber, my OPNsense firewall topped out at 930 Mbps both ways, while the fiber gateway showed over 1,100. I assumed the firewall was too slow. It wasn't. A 1 GbE port can't carry much more than 940 Mbps of real data, and my ISP provisions the line above 1 Gbps. The firewall was within about 1% of the ceiling the whole time.

The setup

For a while, every packet in my house went through OPNsense running on a small Shuttle mini PC: a 3rd-generation Intel i5, 16 GB of RAM and Realtek network ports. It handled routing and firewalling for the whole network, and it was rock solid. No dropped connections, no latency spikes, nothing.

Then I moved to 1 Gbps symmetric fiber.

The symptom

Speed tests through OPNsense landed around 930 Mbps down and 930 Mbps up, every time. That looked fine until I plugged a device straight into the fiber gateway's multi-gig port and saw it go past 1,100 Mbps.

PathDownloadUpload
Through OPNsense (1 GbE ports)930 Mbps930 Mbps
Device on the gateway's multi-gig port1,100+ Mbpsnot tested

Same line, almost 200 Mbps apart. The obvious suspect was the box in the middle: an older i5 doing routing and firewalling at gigabit speeds.

What I tried

I went after it the way most people would: I adjusted QoS and traffic shaping settings, hoping smarter queuing would free up headroom. It didn't move the number at all.

In hindsight that makes sense. QoS decides which traffic goes first when a link is full, and it can cap traffic below the link speed. It can't make a link carry more than it physically can. On an older CPU, shaping at gigabit speeds is more likely to cost throughput than add it.

What was actually happening

Two things, and neither was the firewall.

1. Gigabit Ethernet tops out around 940 Mbps of real data. "1 Gbps" is the raw signaling rate of the port. Every packet also carries Ethernet framing, IP and TCP headers, plus required gaps between frames, and all of that uses link time without carrying your data. With a standard 1,500-byte packet:

Data per packet (TCP payload, with timestamps):   1,448 bytes
Time on the wire per packet:
  1,500-byte IP packet
  + 14 Ethernet header + 4 checksum
  + 8 preamble + 12 inter-frame gap            = 1,538 bytes

1,448 / 1,538 = 94.1%  →  ~941 Mbps maximum on a 1 Gbps port

Speed-test overhead takes it a little lower, which is how you land at 930 to 940. My firewall was delivering about 99% of what its ports could carry. In both directions. Without breaking a sweat.

2. My ISP provisions the line above 1 Gbps. Many fiber providers give gigabit customers some headroom so speed tests consistently show the advertised number. The gateway has a multi-gig port, so a device with a multi-gig network card plugged straight into it can use that headroom. My Shuttle's ports are 1 GbE, so OPNsense could never see it, no matter how fast its CPU was.

Two paths to the internet Before: the fiber gateway connects over 1 GbE to the OPNsense firewall, which connects over 1 GbE to the switch and devices, for 930 Mbps both ways because 1 GbE links cap usable throughput at about 940 Mbps. After: a device on the gateway's multi-gig port sees over 1,100 Mbps. Before: OPNsense routing Fiber gateway line above 1 Gbps OPNsense firewall Shuttle, Realtek 1 GbE ports Switch, devices 930 / 930 Mbps 1 GbE links cap usable data at about 940 Mbps After: gateway routing Fiber gateway now routing multi-gig port Multi-gig device 1,100+ Mbps down
The firewall wasn't the narrow part. Every link in the "before" path was 1 GbE.

What I decided, and what it cost

I moved routing back to the fiber gateway. That gets the full provisioned speed, but it isn't free, and I'd rather be honest about the trade-off:

  • I gave up control. OPNsense gave me detailed firewall rules, logging and visibility into everything leaving the network. The ISP's gateway is a much simpler firewall that I can't inspect as deeply.
  • The speed gain is narrower than it looks. The extra bandwidth only shows up on a fully multi-gig path. Any device behind a 1 GbE switch port still tops out around 940, the same as before. The win is mostly total bandwidth when several devices are busy at once.

For now that trade is fine for a home network. For a business, I'd make the opposite call. Visibility and control matter more than 170 extra megabits.

What I'd do differently

  • Check every link in the path before blaming a device. Port speed, cable, switch, NIC. The slowest link sets the ceiling, and here it was the most boring part of the setup.
  • Know what "maximum" looks like. 930 to 940 Mbps on gigabit Ethernet is a pass, not a fail. Knowing that up front would have saved me an evening of tuning.
  • Buy firewall hardware for the line you'll have, not the one you have. The next firewall in my lab will have 2.5 GbE ports and network cards with solid FreeBSD driver support, so I can have both the speed and the control.

Takeaways

The firewall did its job perfectly. What I'd misread was the measurement. When a number looks low, figure out what the theoretical ceiling is before you start tuning. Sometimes the fix is a different port, not a faster box.