I need to test (IPv6) route lookup performance in the Linux kernel. I want to know how much time it takes to find a match if there are 100 routes, or 1000, or 10000 and so on. I'm using containers, so the only limit on number of nodes is memory usage.
I can't think of a way to test. If I put in a lot of routes going out the same interface, the kernel might aggregate routes and the lookup will be shorter than expected. Even ignoring route aggregation, if I use only one interface, I can use only one destination address, right? That would put the route being tested in the cache and the result would be faster than using random destinations which might need to be searched in the routing table.
If I create a different node for each destination, I would probably run out of memory and using the disk would still affect results.
Any idea? Is there a standard way of testing this?