arts++: C++ Class Library

Next Previous Contents

## 3. C++ Class Library

The `arts++` package includes a C++ class library which provides an API for ARTS data. The class library contains a top-level `Arts` class which may contain any type of ARTS data. The class library also contains derived classes for each of the ARTS data objects used by CAIDA.

## 3.1 The `Arts` Class and Contained Classes

The `Arts` class is a top level class in the class heirarchy. It is used to hold any of the ARTS data types.

All `Arts` objects contain a header section represented by a contained `ArtsHeader` object. `Arts` objects also normally contain one or more attributes in a vector of `ArtsAttribute` objects (literally a `vector<ArtsAttribute>` using STL). Finally, each `Arts` object contains a data portion. The data portion is where the specific type of data (AS matrix, net matrix, etc.) is stored.

You may obtain a reference to the `ArtsHeader` in an `Arts` object by calling the `Header()` member from the `Arts` class.You may obtain a reference to the vector of attributes in an `Arts` object or one of the `Arts` descendants by calling the `Attributes()` member from the `Arts` class.

The type of the data in the data portion of an `Arts` object can be determined by looking at the `Header().Identifier()` in the object. The class library will handle the following values:

Header().Identifier() Description

`artsC_OBJECT_AS_MATRIX` An AS matrix object.
`artsC_OBJECT_NET` A net matrix object.
`artsC_OBJECT_PORT` A port table object.
`artsC_OBJECT_PORT_MATRIX` A port matrix object.
`artsC_OBJECT_SELECTED_PORT` A selected port table object.
`artsC_OBJECT_PROTO` A protocol table object.
`artsC_OBJECT_TOS` A TOS table object.
`artsC_OBJECT_IP_PATH` An IP forward path and RTT object.
`artsC_OBJECT_INTERFACE_MATRIX` An interface matrix object.
`artsC_OBJECT_NEXT_HOP` An IP nexthop table object.
`artsC_OBJECT_BGP4` A BGP4 route table object.
`artsC_OBJECT_RTT_TIME_SERIES` A RTT time series object.

### The `ArtsHeader` Class

The `ArtsHeader` class is used inside each `Arts` object to hold information which is generic to all ARTS data types. For example, the object identifier, the version of the object, or the number of attributes in the object.

### The `ArtsAttribute` Class

A vector of `ArtsAttribute` objects is used inside an `Arts` object to hold various attributes which may apply to a variety of ARTS data types. For example, a period attribute is used in several objects to hold a time interval for which the ARTS data holds information. A host attribute is frequently used to hold the IP address of a host or router from which the ARTS data was collected.

### The `ArtsAsMatrixData` Class

The `ArtsAsMatrixData` class is used to hold AS matrix data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_AS_MATRIX`, you may obtain a pointer to the `ArtsAsMatrixData` object in the `Arts` object by calling the `AsMatrixData()` member from the `Arts` class.

An `ArtsAsMatrixData` object contains a vector of `ArtsAsMatrixEntry` objects.

### The `ArtsAsMatrixEntry` Class

The `ArtsAsMatrixEntry` class contains a source AS number, a destination AS number, the packets sent from the source AS to the destination AS, and the bytes sent from the source AS to the destination AS.

### The `ArtsNetMatrixData` Class

The `ArtsNetMatrixData` class is used to hold net matrix data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_NET`, you may obtain a pointer to the `ArtsNetMatrixData` object in the `Arts` object by calling the `NetMatrixData()` member from the `Arts` class.

An `ArtsNetMatrixData` object contains a vector of `ArtsNetMatrixEntry` objects.

### The `ArtsNetMatrixEntry` Class

The `ArtsNetMatrixEntry` class contains a source network address and netmask length, a destination network address and netmask length, the packets sent from the source network to the destination network, and the bytes sent from the source network to the destination network.

### The `ArtsPortTableData` Class

The `ArtsPortTableData` class is used to hold port table data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_PORT`, you may obtain a pointer to the `ArtsPortTableData` object in the `Arts` object by calling the `PortTableData()` member from the `Arts` class.

An `ArtsPortTableData` object contains a vector of `ArtsPortTableEntry` objects.

### The `ArtsPortTableEntry` Class

The `ArtsPortTableEntry` class contains a port number, the packets sent with a source port equal to the port number, the bytes sent with a source port equal to the port number, the packets sent with a destination port equal to the port number and the bytes sent with a destination port equal to the port number.

### The `ArtsPortMatrixData` Class

The `ArtsPortMatrixData` class is used to hold port matrix data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_PORT_MATRIX`, you may obtain a pointer to the `ArtsPortMAtrixData` object in the `Arts` object by calling the `PortMatrixData()` member from the `Arts` class.

An `ArtsPortMatrixData` object contains a vector of `ArtsPortMatrixEntry` objects.

### The `ArtsPortMatrixEntry` Class

The `ArtsPortMatrixEntry` class contains a source port number, a destination port number, the number of packets sent from the source port number to the destination port number, and the number of bytes sent from the source port number to the destination port number.

### The `ArtsSelectedPortTableData` Clsss

The `ArtsSelectedPortTableData` class is used to hold selected port table data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_SELECTED_PORT`, you may obtain a pointer to the `ArtsSelectedPortTableData` object in the `Arts` object by calling the `SelectedPortTableData()` member from the `Arts` class.

The data portion of this object is stored just like that in the `ArtsPortTableData` class: a vector of `ArtsPortTableEntry` objects, accessible via the `PortEntries()` member function. However, the interpretation of the data is different than that of the `ArtsPortTableData` class. Only selected ports (which are held in an `ArtsPortChooser` object in the `ArtsSelectedPortTableData` class) are allowed to have inidividual entries, and traffic for ports which aren't in the selection list is lumped unoder an entry for port 0. Unlike the `ArtsPortTableData` class, we only count traffic once, for the lower of the source or destination port that was in the selection list (or in the entry for port 0).

### The `ArtsProtocolTableData` Class

The `ArtsProtocolTableData` class is used to hold protocol table data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_PROTO`, you may obtain a pointer to the `ArtsProtocolTableData` object in the `Arts` object by calling the `ProtocolTableData()` member from the `Arts` class.

An `ArtsProtocolTableData` object contains a vector of `ArtsProtocolTableEntry` objects.

### The `ArtsProtocolTableEntry` Class

The `ArtsProtocolTableEntry` class contains a protocol number, the number of packets sent using the protocol and the number of bytes sent using the protocol.

### The `ArtsTosTableData` Class

The `ArtsTosTableData` class is used to hold TOS table data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_TOS`, you may obtain a pointer to the `ArtsTosTableData` object in the `Arts` object by calling the `TosTableData()` member from the `Arts` class.

An `ArtsTosTableData` object contains a vector of `ArtsTosTableEntry` objects.

### The `ArtsTosTableEntry` Class

The `ArtsTosTableEntry` class contains a TOS value, the number of packets sent using the TOS and the number of bytes sent using the TOS.

### The `ArtsInterfaceMatrixData` Class

The `ArtsInterfaceMatrixData` class is used to hold interface matrix data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_INTERFACE_MATRIX`, you may obtain a pointer to the `ArtsInterfaceMatrixData` object in the `Arts` object by calling the `InterfaceMatrixData()` member from the `Arts` class. The interface matrix data is held in a vector of `ArtsInterfaceMatrixEntry` objects inside the `ArtsInterfaceMatrixData` class.

### The `ArtsInterfaceMatrixEntry` Class

The `ArtsInterfaceMatrixEntry` class contains a source (input) interface index, a destination (output) interface index, the number of packets sent from the source interface to the destination interface and the number of bytes sent from the source interface to the destination interface.

### The `ArtsNextHopTableData` Class

The `ArtsNextHopTableData` class is used to hold nexthop table data within an `Arts` object. When the `Header().Identifier()` of an `Arts` object is `artsC_OBJECT_NEXT_HOP`, you may obtain a pointer to the `ArtsNextHopTableData` object in the `Arts` object by calling the `NextHopTableData()` member from the `Arts` class. The nexthop table data is held in a vector of `ArtsNextHopTableEntry` objects inside the `ArtsNextHopTableData` class.

### The `ArtsNextHopTableEntry` Class

The `ArtsNextHopTableEntry` class contains the IP address of the nexthop and counters for the packets and bytes of traffic sent via the nexthop.

### The `ArtsIpPathData` Class

Not yet documented, used by the `skitter` package.

### The `ArtsBGP4RouteTableData` Class

Not yet documented, used by the `skitter` package.

### The `ArtsRttTimeSeriesTable` class

Not yet documented, used by `skping` and `skpingd` from the `skitter` package.

## 3.2 Derived Classes

For each of the ARTS data types, there is a class derived from the `Arts` class to represent the data. An applicaiotn would typically use one of the derived classes when it knows what type of data to be stored in a given object. Typically these classes are no different than the `Arts` class other than having specialized constructors and shortcut calls to members of the data classes held inside an ARTS object.

### ArtsAsMatrix

This class can be used to hold AS matrix data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_AS_MATRIX`.

### ArtsNetMatrix

This class can be used to hold net matrix data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_NET`.

### ArtsPortTable

This class can be used to hold port table data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_PORT`.

### ArtsPortMatrix

This class can be used to hold port matrix data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_PORT_MATRIX`.

### ArtsSelectedPortTable

This class can be used to hold selected port table data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_SELECTED_PORT`.

### ArtsProtocolTable

This class can be used to hold protocol table data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_PROTO`.

### ArtsTosTable

This class can be used to hold TOS table data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_TOS`.

### ArtsInterfaceMatrix

This class can be used to hold interface matrix data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_INTERFACE_MATRIX`.

### ArtsNextHopTable

This class can be used to hold IP nexthop table data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_NEXT_HOP`.

### ArtsIpPath

This class can be used to hold IP forward path data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_IP_PATH`.

### ArtsBgp4RouteTable

This class can be used to hold BGP4 route table data. An instantiation of this object is no different than an instantiation of an `Arts` object except that the `Header().Identifier()` should always be `artsC_OBJECT_BGP4`.

## 3.3 Helper Classes

### The `ArtsAsMatrixAggregator` Class

The `ArtsAsMatrixAggregator` class may be used to aggregate AS matrix data in the time domain.

### The `ArtsNetMatrixAggregator` Class

The `ArtsNetMatrixAggregator` class may be used to aggregate net matrix data in the time domain.

### The `ArtsPortTableAggregator` Class

The `ArtsPortTableAggregator` class may be used to aggregate port table data in the time domain.

### The `ArtsPortMatrixAggregator` Class

The `ArtsPortMatrixAggregator` class may be used to aggregate port matrix data in the time domain, generating `ArtsPortMatrix` or `ArtsSelectedPortTable` objects as aggregate output.

### The `ArtsProtocolTableAggregator` Class

The `ArtsProtocolTableAggregator` class may be used to aggregate protocol table data in the time domain.

### The `ArtsTosTableAggregator` Class

The `ArtsTosTableAggregator` class may be used to aggregate TOS table table data in the time domain.

### The `ArtsInterfaceMatrixAggregator` Class

The `ArtsInterfaceMatrixAggregator` class may be used to aggregate interface matrix data in the time domain.

### The `ArtsNextHopTableAggregator` Class

The `ArtsNextHopTableAggregator` class may be used to aggregate nexthop table data in the time domain.

## 3.4 More Information

For more detailed information, see the arts++ Class Library Reference.

Next Previous Contents