Importing IP, Ethernet, and VoIP Traffic Flows—ASCII Text Format

You can import traffic flows from one or more ASCII text files. NetPlanner supports the following formats:

  • From Text (.tr2, .tr1) Files – IP traffic flows and Layer-2 Ethernet traffic flows supported for compatibility with current and previous releases

From Text (.tr2, .tr1) Files

NetPlanner uses the .tr2 file extension to support the formats for IP and Ethernet traffic flows.

Note: You must use node aliases or the proper hierarchical notation of the node names in the network model to designate sources and destinations in the traffic files. The import engine matches the specified values in the traffic files to the correct nodes in the network model. For more information, see “Working with Aliases“.

Format Specifications for “tr2” Traffic Files (Calendar Times)

Note: The format specification includes both the required and optional fields to successfully import IP and Ethernet traffic flows. In the following example, the bold text indicates the required fields for each of the two types of traffic flows.

#NOTE:The IP traffic flow specifications must begin with the following two lines:
ip_traffic:
source,destination,protocol,source_port,destination_port,tos,start,end,bits_sec,packets_sec,application,source_interface,destination_interface,src_bg,dest_bg,probe,vpn,role_list

#NOTE:The Layer-2 Ethernet traffic flow specifications must begin with the following two lines:
ethernet_traffic:
source,source_interface,destination,destination_interface,source_vlan,destination_vlan,tos,start,end,bits_sec,packets_sec,application,role_list

Key Concept—You can have both IP traffic and Layer-2 Ethernet traffic specifications in the same file and you can have more than one specification for either type of traffic flow that you need. For more details, see Table 7.

Format Specification for “tr2” Traffic Files (Relative Times)

Use start_sec and end_sec to specify the time in seconds since the beginning of the network start time instead of calendar times.

Setting the Network Start Time Using Traffic Files

Use the time_origin and time_end fields when you want to set the network start time using your traffic files. Add two lines to the beginning of the file with time_origin and time_end field—specified as shown in the following example:

time_origin: 13:28:02.000 Nov 19 2009
time_end: 15:28:02.000 Nov 19 2009

Note: In most cases, you can omit the time_origin and time_end fields to import your traffic data.

The following is an example of an IP traffic flow in a .tr2 file.

ip_traffic
source,destination,protocol,source_port,destination_port,tos,start,end,bits_sec,packets_sec,application,source_interface,destination_interface,src_bg,dest_bg,probe,vpn,role_list
"NYCCSCOR01","NYCCSCOR02",IP,-1,-1,-1,1358783220,1358783280,3786.6,1.67,ftp,TenGigE0/1/0/2,GigE0/1,<Not Set>,<Not Set>,Not Set,None,role1:role2
"NYCCSCOR01","NYCCSCOR02",IP,-1,-1,-1,1358783280,1358783340,2758.6,1.67,ftp,TenGigE0/1/0/2,GigE0/1,<Not Set>,<Not Set>,Not Set,None,role1

The following is an example of an Ethernet traffic flow in a .tr2 file.

ethernet_traffic
source,source_interface,destination,destination_interface,source_vlan,destination_vlan,tos,start,end,bits_sec,packets_sec,application,role_list
"IOKHPASW01","13","IOKHPASW04","38",412,412,0,1384041600,1384045200,120000,100,My-Voice,
"IOKHPASW01","13","IOKHPASW02","19",412,412,0,1384041600,1384045200,120000,100,My-Voice,

Traffic Flow Specification for “tr2” Formats—IP and Ethernet Traffic Flows

The following table provides descriptions of the specification fields for tr2 formats.

Table 7: “tr2” Traffic File Format

Field Description
time_origin (optional) Start of the time window for all traffic. This value should be in one of the following formats: hh:mm:ss Mmm dd yyyy or mm/dd/yyyy hh:mm:ss
time_end (optional) End of the time window for all traffic. This value should be in one of the following formats: hh:mm:ss Mmm dd yyyy or mm/dd/yyyy hh:mm:ss
ip_traffic:
ethernet_traffic:
Leave these fields blank
source Node alias of traffic source or the proper hierarchical node name (e.g., “subnet_name.source_node”)
Note: A non-IP address alias in the .tr2 file must match exactly with the alias on a node. However, an IP address specified in the file can match to a node alias that includes that address in its range. For example, 192.168.0.88 will match to a node with an alias of 192.168.0.1/24.
destination Node alias of traffic destination or the proper hierarchical node name (e.g., “subnet_name.destination_node”)
Note: A non-IP address alias in the .tr2 file must match exactly with the alias on a node. However, an IP address specified in the file can match to a node alias that includes that address in its range. For example, 192.168.0.88 will match to a node with an alias of 192.168.0.1/24.
protocol
(optional, but must be specified if source_port and destination_port are specified)
Socket/IP-level protocol name (for example, TCP, IP, or ICMP).
For more information about the supported values in this field, do the following:
• Create a traffic flow object using the ip_traffic_flow demand model.
• Right-click on the flow and choose Edit Attributes.
• Examine the possible settings for the following attribute: Socket Information > Protocol
source_port
(optional – IP traffic only)
Socket-level port number of the traffic on the resulting flow object. This field assumes standard port numbers (such as 21 for FTP and 80 for HTTP). A value of -1 means that the source port is unspecified.
.For more information about the supported values in this field, do the following:
• Create a traffic flow object using the ip_traffic_flow demand model.
• Right-click on the flow and choose Edit Attributes.
• Examine the possible settings for the following attribute: Socket Information > Source Port
• To see the port number assigned to a specific application, select that application and view the tooltip in the “Value” field.
destination_port
(optional – IP traffic only)
Socket-level port number of the traffic on the resulting flow object.A value of -1 means that the destinaation port is unspecified.
For more information about the supported values in this field, do the following:
• Create a traffic flow object using the ip_traffic_flow demand model.
• Right-click on the flow and choose Edit Attributes.
• Examine the possible settings for the following attribute: Socket Information > Destination Port
• To see the port number assigned to a specific application, select that application and view the tooltip in the “Value” field.
source_interface
(optional)
Source interface address of the traffic on the resulting flow object. For IP traffic flows, you can specify either an IP address or interface name.
If no value is set or this field is not used, the traffic flow source interface address gets the default value “Auto Assigned” for Ethernet Flows and no value for IP traffic flows.
destination_interface
(optional)
Destination interface address of the traffic on the resulting flow object. For IP traffic flows, you can specify either an IP address or interface name.
If no value is set or this field is not used, the traffic flow destination interface address gets the default value “Auto Assigned” for Ethernet Flows and no value for IP traffic flows.
source_vlan
(optional – Ethernet traffic only)
Source VLAN ID of the Layer 2 traffic on the resulting flow object. A value of -1 means that the VLAN ID is unspecified.
destination_vlan
(optional – Ethernet traffic only)
Destination VLAN ID of the Layer 2 traffic on the resulting flow object. A value of -1 means that the VLAN ID is unspecified.
tos
(optional)
Type of Service (ToS) assigned to background traffic sent from this node.
For more information about the supported values in this field, do the following:
• Create a traffic flow object using the ip_traffic_flow demand model.
• Right-click on the flow and choose Edit Attributes.
• Examine the possible settings for the following attribute: Traffic Characteristics > Type of Service
start (for calendar or absolute times) Traffic start times specified as calendar times, in one of the following formats:
hh:mm:ss Mmm dd yyyy
13:28:02.000 Nov 19 2009,14:28:02.000 Nov 19 2009
or
mm/dd/yyyy hh:mm:ss
[05/15/2010 4:0:0-05/15/2010 4:0:30]
Note: You can use absolute times by doing the following:
1) Remove the first 2 lines (time_origin and time_end)
2) Specify "start" and use UNIX epoch format
The UNIX epoch format is the number or secs since Jan 01 1970
Note: You cannot mix calendar and relative times in the same traffic file.
start_sec Traffic start times specified as relative times, in seconds after the network start time.
Note: You cannot mix calendar and relative times in the same traffic file.
end (for calendar or absolute times) Traffic end times specified as calendar times, in one of the following formats:
hh:mm:ss Mmm dd yyyy
Example:
13:28:02.000 Nov 19 2009,14:28:02.000 Nov 19 2009
or
mm/dd/yyyy hh:mm:ss
Example:
[05/15/2010 4:0:0-05/15/2010 4:0:30]
Note: You can use absolute times by doing the following:
1) Remove the first 2 lines (time_origin and time_end)
2) Specify "end" and use UNIX epoch format
The UNIX epoch format is the number or secs since Jan 01 1970
Note: You cannot mix calendar and relative times in the same traffic file.
end_sec Traffic end times specified as relative times, in seconds after the network start time.
Note: You cannot mix calendar and relative times in the same traffic file.
bits_sec Traffic intensity (in bits per second)
packets_sec Traffic intensity (in packets per second)
application (optional) Application name of traffic between source and destination node.
src_bg Name of the Business Group configured in AppResponse, where this flow originated.
dest_bg Name of the Destination Business Group for this flow, as configured in AppResponse.
probe The device that reported this flow to the traffic collector.
role_list (optional) Colon-separated list of roles to assign to the role attribute for the traffic flow object.

Note: Specify <Not Set> instead of a value when you do not want to include a value for a particular field.

Key Concept—Not all field values get set in the network model unless you choose the associated option when “Differentiating Traffic Flows“ in the “Import Traffic Flows Dialog Box“.

Format Specification for “tr1” Text Files

This format is supported for old traffic files used in previous releases. Use the tr2 format for the current release. For more information, see Format Specifications for “tr2” Traffic Files (Calendar Times).

Table 8: “tr1” Traffic File Format

Item Description
time_origin Start of the time window for all traffic. This value should be in the following format: mm/dd/yyyy hh:mm:ss
time_end End of the time window for all traffic. This value should be in the following format: mm/dd/yyyy hh:mm:ss
source_node Traffic source (IP address or node name)¹
dest_node Traffic destination (IP address or node name)¹
time_window Traffic duration
packets_per_sec Traffic intensity (in packets per second)
bits_per_sec Traffic intensity (in bits per second)

¹ Do not use a slash (“/”) in source or destination node names.

Converting Traffic Files

ASCII-format text files that contain traffic flows must be converted to CSV (comma-separated value) format before they can be imported. There are two ways to convert traffic files:

Converting Traffic Files Manually

After creating an ASCII file, you must convert it to a comma-separated value (CSV) file and edit the header to the correct format.

Procedure 13: Converting a Traffic File to CSV

  1. Open the ASCII traffic file in a text editor or spreadsheet that supports CSV files, such as Notepad or Excel.

    Note: Because traffic archives are typically large, not all text editors can open them.

    For information about the formats, see:

  2. Use the “Save as” operation to add a “.tr2” or “.tr1” suffix (extension) to the CSV file, depending on the format.

After converting the traffic archive to ASCII format, you can import it. For more information, see “Importing Network Traffic“.

Using Preprocessing Scripts to Convert Traffic files

You might want to import traffic from files that use unsupported ASCII formats. If you have (or can create) executable scripts to convert unsupported file types to Flexible CSV (.tr2) format, you can assign these scripts to specific files during a traffic-import operation. NetPlanner runs these scripts before importing the data, allowing you to import traffic from many different file types at once.

A preprocessing script must be either a shell script or an executable file that takes two command-line arguments. The program should read in the traffic file (specified by argument 1), convert its contents to .tr2 format, and write the results to the output file (specified by argument 2).

To use this feature, you must register each script using the traffic_preprocessor_prog preference. You must enter full path names for any scripts located outside your user path.

After registering your scripts, you can use the Traffic Preprocessor pull-down menu (in the Import Traffic Flows dialog box) to assign conversion scripts to specific archives. All scripts listed in traffic_preprocessor_args appear on this menu. For more information, see the “Traffic Preprocessor” description in “Import Traffic Flows Dialog Box“.

For more information, see “Verifying Traffic-Flow Imports“.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com