# RTACCT Utility

## Robert Olsson

some_negative_number, 20 Dec 2001

Here is some code for monitoring the route cache. For systems handling high network load, servers, routers, firewalls etc the route cache and its garbage collection is crucial. Linux has a solid implementation.

The kernel patch (not required since linux-2.4.7) adds statistics counters from route cache process into /proc/net/rt_cache_stat. A companion user mode program presents the statistics in a vmstat or iostat manner. The ratio between cache hits and misses gives the flow length.

Hopefully it can help understanding performance and DoS and other related issues.

An URL where newer versions of this utility can be (probably) found is ftp://robur.slu.se/pub/Linux/net-development/rt_cache_stat/

Description

The format of the command is:

> `

>            rtstat [ OPTIONS ]

> `

`OPTIONS` are:

- `-h`, `-help` - show help page and version of the utility.
- `-i INTERVAL` - interval between snapshots, default value is 2 seconds.
- `-s NUMBER` - whether to print header line. 0 inhibits header line, 1 prescribes to print it once and 2 (this is default setting) forces header line each 20 lines.