Skip to contentSkip to conversation

route cache GC monitoring

DISCUSSION Robert Olsson 5 participants 5 messages Apr 26, 2002 – May 9, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello!

We like to propose four new stats. counters to monitor the garbage process of route cache. This should be useful for tuning and debugging installations which have a large number of flows.

Tuning is another business but we have played with max_size and gc_thresh there are more tuning knobs. The number of buckets in the hash table is something to tune as well be but we have not experimented with this here.

Anyway for most installations the "default" setting does a very good job but when we see high numbers in the new GC counters one should be warned.

Kernel patch.

Use/Experiment.

Cheers.
Robert Olsson, Jens Laas

#1 lore raw

Hello!

Quoted 3 lines

We like to propose four new stats. counters to monitor the garbage process of route cache. This should be useful for tuning and debugging installations which have a large number of flows.

OK.

Quoted 2 lines

Tuning is another business but we have played with max_size and gc_thresh there are more tuning knobs.

There exist one more interesting parameter: gc_elasticity, which is supposed to control length of hash bucket.

Alexey

#2 lore raw

dst_entry and friends

In reply to Robert Olsson

Hi!

I'm working on my Masters Thesis which aims at making a label switched environment. I know there are protocols for doing that but I am supposed to do it at IPv6-level (by altering the IPv6-stack) thus making Linux route on different criteria than the usual routing table.

This is what i want to do:
If the flowlabel in the IPv6 header is set to some value except zero then skip the whole routing behaviour and check for the flowlabel in an internal table, and get the out-device and new flowlabel from that table and send the packet. otherwise:
Just do as usual

My idea is to use netfilter and in the PRE_ROUTING-hook check the flowlabel for values other than zero, and set the dst_entry in the skbuff to something with its input-function to ip6_output. I dont know if I should allocate this fabricated dst_entry myself or if I should scan the list of already existing ones. By setting the input-function-pointer to ip6_output i will skip the whole routing behaviour in a snap. The same goes for the hook LOCAL_OUT where i want to skip ip6_maybe_reroute function and go directly to ip6_output.

This might sound like a quite destructive concept, but the whole thing is that my teacher thought those "small hacks" could be done in notime, whle I have discovered that thats not the case.

Do you know of any easier way of doing this? And if not, how do I get hold of a dst_entry when I know what netdevice that should be the output? I have had a look in rt6_device_match function in route.c and think that it does more or less what I want to do.

I would be grateful if some Linux Ipv6-implementation guru would read this and try to understand what I'm trying to do... :-)

Sincerily

Gabriel

#3 lore raw

Re: dst_entry and friends

Quoted 5 lines · Gabriel Paues

My idea is to use netfilter and in the PRE_ROUTING-hook check the flowlabel for values other than zero, and set the dst_entry in the skbuff to something with its input-function to ip6_output. I dont know if I should allocate this fabricated dst_entry myself or if I should scan the list of already existing ones. By setting the input-function-pointer to ip6_output i will skip the whole

That won't work for most networking protocols, which always route themselves. All you can do is to drop the route later in netfilter and reroute/resubmit

Still your concept will fail for path mtu discovery for example, which assumes that an incoming ICMP can be matched to an dst_entry in the routing cache to communicate the new pmtu.

It may be easier to just change ip_route_output(). Routes are often cached however, so you would need to make sure that the caches are invalidated when the flow label changes (e.g. by setting dst->obsolete)

Overall the concept does not look very promising however. I guess to make the labels unique you'll have to add srcip/dstip to your private tables too, and that means that the label lookup is exactly equivalent in cost to a normal routing cache lookup - even if you didn't need the src/dst it probably wouldn't be much cheaper.

-Andi