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?


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

  • 5
    Is 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 Jun 11 '15 at 14:45
  • 1
    I 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 Jun 12 '15 at 7:34
  • From the previous link, it suggests to use the net_test_tools kernel modules such as kbench_mod.so and then the perf tools – mveroone Jun 12 '15 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.