CAIDA::Traffic2::SubinterfaceInfo - Storage/reading object for subinterfaces
use CAIDA::Traffic2::FileReader;
# Set up $reader and $interval with initialization data my @id_infos = $interval->get_id_infos(); my @types = $id_infos[0]->get_table_types(); my @exist_types = $id_infos[0]->get_existing_types(); my $ip_not_v4 = $id_infos[0]->get_metadata('ip not v4'); $id_infos[0]->set_metadata('ip not v4', 10); my $table = $interval->get_table($id_infos[0], $types[0]);
my $accumulator = new CAIDA::Traffic2::SubinterfaceInfo; $accumulator->add($id_infos[0]); $accumulator->nadd($id_infos[0]);
SubinterfaceInfo is a class that assists in the reading of
Traffic2-style output files. Traffic2-style is that which is output
by crl_traffic2 (now named crl_flow). There is no need to create
a SubinterfaceInfo object explicitly, as they are created by Interval
objects. It also contains the actual table data in a file, even
though the accessor function (get_table()
) is a member function
of the Interval class. SubinterfaceInfo also stores information
about subinterfaces (for example, for an ATM interface, a subinterface
could be a particular vp/vc pair), such as the number of
packets/bytes/flows in the subinterface, or the timestamps of the
first and latest flow seen.
SubinterfaceInfo has the following member functions:
This should not be necessary to any applications programmer.
get_table()
.
nadd()
is the same as add()
, but it is free to do destructive operations
on SUBINTERFACEINFO. SUBINTERFACEINFO should not be used again
for anything after calling nadd()
.
These functions should not be necessary to any applications programmer.
The CAIDA::Tables, CAIDA::Traffic2::Interval, CAIDA::Traffic2::FileWriter and CAIDA::Traffic2::FileReader manpages.
crl_flow can output in several different formats than the 'Traffic2' format, which are readable by Interval objects, but cause possibly unexpected behavior. crl_flow allows multiple different expiration algorithms, which can cause the output of multiple entries with the same key. These separate entries will be added together when read by these classes. In addition, 'active' flows are currently ignored entirely.
For best results, use crl_flow -I.
If you have any ideas about how better to deal with this (creating different tables for active and expired flows, creating tables that accept multiple separate entries with the same key), please write us at coral-bugs@caida.org
Ryan Koga <rkoga@caida.org>