Tuning Linux IPv4 route cache (2011)
vincent.bernat.im
vincent.bernat.im
Surely if it was simply removed, network performance would drop, which leads me to think caching must have been added somewhere else as it was removed here? Can anyone clarify?
David Miller has a summary of the route cache removal in http://vger.kernel.org/~davem/columbia2012.pdf. The cache exhaustion argument was .. odd. As I recall the cache entry was created on handshake and was keyed off of src ip, dst IP, dst port. Given that the attacker can (effectively) only vary the src ip thats a lot of addresses to control. The other argument was that not hitting a cache was "only" 10% slower in microbenchmarks.
Personally Im dubious of the route cache removal, though I havent tested. The 10% hit rate, as I recall, was from Google front end servers which Id expect to have a high cardinality of peers along with a simplistic route table. For servers with multiple interfaces, variable route properties, multiple tables, etc and a high packet rate a fast cache should be quite valuable.
The performance of the cache was said to be bad (only 10% hit, but that doesn't match at all my experience where the performances of the cache were pretty good, see the article) and being an hash table, it was the target of DOS attacks. Moreover, many information were tied to the cache, triggering some additional problems, like the "neighbor cache overflow".
1. The content of this article should be valid
for Linux 2.6.38, 2.6.39, 3.0 and 3.1. There are some
clues for Linux 2.6.35, 2.6.36 and 2.6.37 as well
as for Linux 3.2, 3.3, 3.4 and 3.5. Starting from
Linux 3.6, the whole route cache has been removed.