As I understand, routing cache was removed since Linux kernel 3.6. In systems with older Linux kernel one could view the content of the routing cache with ip route show cache command and routing cache was consulted before the routing tables. However, what is the status of routing cache in latest Linux kernels? Was it simply removed and all the packets go through the routing tables? Is there some sort of (similar) replacement system?
1 Answer
From what I read in LinuxFR article (french)
This cache was suffering bad performance bottleneck relatively to today's latency needs and security problems where sometimes vulnerabilities allowed attackers to poison this cache. Also it's average hit rate was <10%.
There is now a small per-entry cache, but only for additionnal informations (TCP stats, PTMU,...)
Here's the developper's mail recap after 3.6 release
Another comment relative to the performance of the cache : LWN.net
-
6Is there a way to view the content of this per-entry cache? And am I correct that after removing the routing cache each incoming and outgoing IPv4/IPv6 packet is checked directly against routing tables(
local,main, etc)?Martin– Martin2015-06-11 14:45:11 +00:00Commented Jun 11, 2015 at 14:45 -
1I doubt that there is a way to lookup this cache other than dev tools and analyzing kernel dumps. I also highly doubt it would be meaningful for any other purpose than developping this part of the kernel. For the "how" it now works, I suppose it does indeed check directly against the routing tables although the underlying mechanisms seems a bit more complex. See git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/…mveroone– mveroone2015-06-12 07:34:33 +00:00Commented Jun 12, 2015 at 7:34
-
From the previous link, it suggests to use the net_test_tools kernel modules such as
kbench_mod.soand then theperftoolsmveroone– mveroone2015-06-12 07:44:34 +00:00Commented Jun 12, 2015 at 7:44