Performance progression of IPv6 route lookup on Linux (2018)

Vincent Bernat

In a pre­vi­ous ar­ti­cle, I ex­plained how Linux im­ple­ments an IPv6 rout­ing ta­ble. The fol­low­ing graph shows the per­for­mance pro­gres­sion of route lookups through Linux history:

IPv6 route lookup performance progression
IPv6 route lookup times for various Linux kernel versions. Lookup is done on a table with 40,000 routes. Notable performance changes are highlighted. The shaded surfaces represent the median absolute deviation.

All ker­nels are com­piled with GCC 4.9 (from De­bian Jessie). This ver­sion is able to com­pile older ker­nels as well as cur­rent ones. The ker­nel con­fig­u­ra­tion is the de­fault one with CONFIG_​SMP, CONFIG_​IPV6, CONFIG_​IPV6_​MULTIPLE_​TABLES and CONFIG_​IPV6_​SUBTREES op­tions en­abled. Some other un­re­lated op­tions are en­abled to be able to boot them in a vir­tual ma­chine and run the benchmark.

There are three no­table per­for­mance changes:

  • In Linux 3.1, Eric Du­mazet de­lays a bit the copy of route met­rics to fix the un­de­sir­able shar­ing of route-spe­cific met­rics by all cache en­tries (com­mit 21efcfa0ff27). Each cache en­try now gets its own met­rics, which ex­plains the per­for­mance hit for the non-/128 scenarios.
  • In Linux 3.9, Yoshi­fuji Hideaki re­moves the ref­er­ence to the neigh­bor en­try in struct rt6_​info (com­mit 887c95cc1da5). This should have led to a per­for­mance in­crease. The small re­gres­sion may be due to cache-re­lated issues.
  • In Linux 4.2, Mar­tin KaFai Lau pre­vents the cre­ation of cache en­tries for most route lookups. The most no­tice­able per­for­mance im­prove­ment comes with com­mit 4b32b5ad31a6. The sec­ond one is from com­mit 45e4fd26683c, which ef­fec­tively re­moves cre­ation of cache en­tries, ex­cept for PMTU ex­ceptions.

Mid-2018 update#

Here is a graph for more re­cent ker­nels. Mea­sure­ments were per­formed on an In­tel Xeon Gold 61481 run­ning at 2.4 GHz, with GCC 6.3 from De­bian Stretch:

IPv6 route lookup performance with recent kernels
IPv6 route lookup times for various Linux kernel versions. Lookup is done on a table with 40,000 routes. The shaded surfaces represent the median absolute deviation.

Per­for­mance re­gres­sions in 4.4.147 and 4.9.119 are solely due to the Spec­tre mit­i­ga­tions.2 The small per­for­mance in­crease in Linux 4.14 is from my own com­mit feca7d8c135b which op­ti­mizes the case with­out cus­tom rout­ing rules. In Linux 4.15, the most no­table im­prove­ment can be traced to com­mit 66f5d6ce53e6: Wei Wang re­places the read-write lock by an RCU and a spin­lock. In Linux 4.18, David Ah­ern im­proved the data struc­tures used by route lookup. While the gain is mea­ger, this should bring more per­for­mance im­prove­ments in the fu­ture. This also al­lows a fairer com­par­i­son be­tween IPv4 and IPv6.

Up­date (2026-11)

A more re­cent ar­ti­cle up­dates these fig­ures through Linux 7.3.