|
NAMErwpackchecker - Find unusual patterns that may indicate a corrupt fileSYNOPSISrwpackchecker [--value=TEST=VALUE] [--allowable-count=TEST=ALLOWED] [--print-all] {[--xargs] | [--xargs=FILENAME] | [FILE [FILE ...]]} rwpackchecker --help rwpackchecker --version DESCRIPTIONrwpackchecker reads SiLK Flow records and checks for "unusual" patterns that may indicate the file has been corrupted.rwpackchecker has a default series of tests it runs on every flow record in an input file. Each default test has two numbers associated with it: a value threshold and an allowed count threshold. A test compares a value on the flow record to the value threshold, and if the value violates the threshold, a counter for that test is incremented. In addition, if the flow record violates the value threshold for any test, a global counter is incremented to denote a suspect record. Once rwpackchecker finishes processing a file, it determines whether the file appears to be valid. A file is considered valid if either
If rwpackchecker determines that all files are valid, it does not print any output by default. If rwpackchecker does find an invalid file, it will print the name of the input file, the global number of suspect records it found, and information for those tests where the counter exceeds the allowed count threshold. As an example, if there are 10 tests and the count threshold for each is 10, it is possible for the global suspect counter to be 90 and for rwpackchecker to consider the file valid. To force rwpackchecker to print the results for all tests and for all input files, specify the --print-all switch. Some of the tests that run by default include checking the number of packets, the bytes per second ratio, the bytes per packet ratio, and the bytes per packet ratio for a particular protocol (TCP, UDP, and ICMP). The --value and --allowable-count switches modify the value threshold and allowed count threshold for a test, respectively. The argument to the switch is the test name and the threshold, separated by a equals sign ("="). Repeat the switches to set multiple thresholds. For example, to change the value thresholds for the max-bytes test to 20000 and for the max-packets test to 15000, specify the following: rwpackchecker --value=max-bytes=20000 --value max-packets=15000 ... To get the most value from rwpackchecker, one should customize it for the particular site where it is being used, since the default value for a threshold may or may not be unusual for a particular installation. For example, a router that has Ethernet connections should have no more than 1500 bytes per packet, since that is the Ethernet MTU; however, the default value for that ratio is 16384. In some cases the default value is the largest value that a SiLK IPv4 hourly repository file can store, making it impossible for a record to violate the threshold. rwpackchecker supports additional tests which are not run by default. Representative tests include checking whether an IP is (not) in an IPset or whether a port is (not) in an integer list. To run an additional test, specify the name of the test using the --value switch and provide an argument for the test. To see all of the tests that rwpackchecker supports as well as the value threshold and allowed count threshold for each test, see the "OPTIONS" section below, or run rwpackchecker with the --help switch. rwpackchecker reads SiLK Flow records from the files named on the command line or from the standard input when no file names are specified and --xargs is not present. To read the standard input in addition to the named files, use "-" or "stdin" as a file name. If an input file name ends in ".gz", the file is uncompressed as it is read. When the --xargs switch is provided, rwpackchecker reads the names of the files to process from the named text file or from the standard input if no file name argument is provided to the switch. The input to --xargs must contain one file name per line. OPTIONSOption names may be abbreviated if the abbreviation is unique or is an exact match for an option. A parameter to an option may be specified as --arg=param or --arg param, though the first form is required for options that take optional parameters.
Repeat this switch for each value that you wish to set.
The following tests are always run:
The following tests are only run when the --value switch is used to specify a value for the test.
EXAMPLESIn these examples, the dollar sign ("$") represents the shell prompt and a backslash ("\") is used to continue a line for better readability. The examples do not use the optional "=" between the --value switch and the switch's argument for better readability.Given the SiLK Flow file data.rw where the number of flows with various byte and packet counts are described by this table: Number of flows bytes <= 2000000 bytes > 2000000 TOTAL packets <= 500 379303 308 379611 packets > 500 119586 2679 122265 TOTAL 498889 2987 501876 Running rwpackchecker: $ rwpackchecker --value max-bytes=2000000 \ --value max-packets=500 data.rw data.rw: 122573/501876 flows are bad or unusual 122265 flows where Packet Count > 500 2987 flows where Byte Count > 2000000 The counts for the individual tests are greater than the overall total since 2679 records fall into both categories. To see the effect of the --allowable-count switch: $ rwpackchecker --value max-packets=500 \ --value max-bytes=2000000 --allowable max-bytes=3000 data.rw data.rw: 122573/501876 flows are bad or unusual 122265 flows where Packet Count > 500 $ rwpackchecker --value max-bytes=2000000 \ --value max-packets=500 --allowable max-packets=150000 data.rw data.rw: 122573/501876 flows are bad or unusual 2987 flows where Byte Count > 2000000 In each case the total number of unusual flows did not change; the violation of the other limit is still noted, even when the test is not printed since the test's allowed count threshold was not reached. When the allowed count thresholds for none of the tests are reached, rwpackchecker produces no output by default: $ rwpackchecker --value max-bytes=2000000 --allowable max-bytes=3000 \ --value max-packets=500 --allowable max-packets=150000 data.rw $ Specify the --print-all switch to print the results: $ rwpackchecker --value max-bytes=2000000 --allowable max-bytes=3000 \ --value max-packets=500 --allowable max-packets=15000 \ --print-all data.rw data.rw: 122573/501876 flows are bad or unusual 0 flows where BPP Calculation is incorrect 0 flows where Elapsed Time > 4096 0 flows where Byte/Packet Ratio < 1 0 flows where Byte/Packet Ratio > 16384 0 flows where Byte/Second Ratio < 0 0 flows where Byte/Second Ratio > 4294967295 0 flows where Packet Count < 1 122265 flows where Packet Count > 500 0 flows where Byte Count < 1 2987 flows where Byte Count > 2000000 0 flows where TCP Byte/Packet Ratio < 1 0 flows where TCP Byte/Packet Ratio > 16384 0 flows where UDP Byte/Packet Ratio < 1 0 flows where UDP Byte/Packet Ratio > 16384 0 flows where ICMP Byte/Packet Ratio < 1 0 flows where ICMP Byte/Packet Ratio > 16384 SEE ALSOrwflowpack(8), rwsetbuild(1), silk(7)
Visit the GSP FreeBSD Man Page Interface. |