Traffic Exchange API Overview
The traffic import/export API allows you to programmatically import/export a scenario’s point-to-point traffic demands (represented as path objects) into/out of the Riverbed application from/to a self-describing text file that follows the Traffic Exchange File (TREF) Format.
Traffic Exchange File Format
A TREF file is very similar to a Topology Exchange File (TEF), except that it only has one section: the Path section. Path objects may sometimes represent a virtual circuit, but can also be used to store information and visualize other types of traffic, such as packet flows.
The file format is formally described below.
- The
\tstands for a tab character - Terms within a
<>pair must be a string or number that does not contain any\tcharacter - Text outside the
<>or{}pairs are literal keywords (and must be spelled exactly spelled as shown) - Any line that starts with a
#is a comment line and is ignored
Figure 24: Traffic Exchange File (TREF) Format
Number of Path Attributes: <number of path attributes>
{Path Attribute Description Section}
<path1 name>\t<path1 model>\t<path1 source node name>\t
<path1 destination node name>\t<path1 attribute1 value>\t
<path1 attribute2 value> …
…
…
Unlike links, paths are uni-directional (directed), so the order of source and destination nodes does matter. Figure 25 contains a sample TREF file.
Figure 25: Example TREF File
Number of Path Attributes : 3
Bandwidth per Connection (Mbps): double
Number of Connections: int
Protection Type : int
# name, model, source, dest, Mbps, connections, protection
demand_0 optical_demand node_0 node_1 51.840000 1 0
demand_1 atm_demand node_1 node_0 51.840000 1 0
…
From the first path line, we can tell that there is 51.84 Mbps (STS-1) “optical_demand”-type traffic from node_0 to node_1. Also, there is only one connection; its protection type is 0.