Hacker News new | ask | show | jobs
by sidkshatriya 98 days ago
>> and approaches Linux performance in some areas (e.g. Networking)

> FreeBSD has been the gold standard for networking features and performance for decades; not sure I'd agree.

This is the accepted wisdom. But reality on the ground is that Linux has probably surpassed FreeBSD in this domain too. With bpf programs making dynamic packet steering decisions in kernel space, io_uring, support for every hardware networking enhancement under the sun and $$$ being spent by everybody on the Linux networking stack (to speed up AI training or supercomputer clusters for example) I doubt a highly tuned Linux box will be slower than the equivalent FreeBSD one.

(P.S. I'm not a networking expert. This is my assessment though. Someone well versed with networking on both FreeBSD and Linux should confirm on this !)

1 comments

> I doubt a highly tuned Linux box will be slower than the equivalent FreeBSD one.

That tracks but there's been a lot of work being done on FreeBSD's stack as well.

Most people are aware about the contributions Netflix has made to FreeBSD; they say their FreeBSD-based CDN streams terabytes per second [1].

In addition to the basic network stack, FreeBSD can load additional stacks like RACK TCP [2] stack (using Recent ACK, PRR, etc.) that can be loaded as a module and selected per-socket or as the system default. This is the re-written stack that Netflix uses after they helped develop it.

It seems that FreeBSD is kind of a testbed for new network implementations like Netgraph [3], a graph-based networking subsystem that enables modular, real-time packet processing inside the kernel and Network Offload and Socket Splicing (SO_SPLICE) [4] that enables kernel-level TCP proxying, resulting in reduced CPU overhead and eliminating unnecessary data copies.

I'm not usually into networking but this stuff sounds very interesting.

[1]: "Case Study: Maintaining the World’s Fastest Content Delivery Network at Netflix on FreeBSD" - https://freebsdfoundation.org/netflix-case-study/ (PDF).

[2]: "The RACK-TLP Loss Detection Algorithm for TCP" - https://datatracker.ietf.org/doc/html/rfc8985

[3]: "Inside FreeBSD Netgraph: Behind the Curtain of Advanced Networking" - https://klarasystems.com/articles/inside-freebsd-netgraph-ad...

[4]: https://klarasystems.com/articles/network-offload-and-socket...

Thanks for the detailed response. Gives me a list of some cool things to explore and learn about !

Every year in various conferences and every new major Linux cycle there are new innovations in the Linux network stack too. To do a true comparison it would be fair to see what innovations exist in the Linux networking stack that have not yet been implemented in FreeBSD. Yes, networking is FreeBSD's pride and joy but Google, Intel and others have done a lot of work on the Linux network stack too (which should not be underestimated).