Reference Manual
Scripting API for the Layer 4-7 Application January 2008
P/N 71-003808 REV A
Spirent Communications, Inc. 26750 Agoura Road Calabasas, CA 91302 USA
Copyright © 2008 Spirent Communications, Inc. All Rights Reserved. All of the company names and/or brand names and/or product names referred to in this document, in particular, the name “Spirent” and its logo device, are either registered trademarks or trademarks of Spirent plc and its subsidiaries, pending registration in accordance with relevant national laws. All other registered trademarks or trademarks are the property of their respective owners. The information contained in this document is subject to change without notice and does not represent a commitment on the part of Spirent Communications. The information in this document is believed to be accurate and reliable, however, Spirent Communications assumes no responsibility or liability for any errors or inaccuracies that may appear in the document.
Limited Warranty Spirent Communications, Inc. (“Spirent”) warrants that its Products will conform to the description on the face of order, that it will convey good title thereto, and that the Product will be delivered free from any lawful security interest or other lien or encumbrance. Spirent further warrants to Customer that hardware which it supplies and the tangible media on which it supplies software will be free from significant defects in materials and workmanship for a period of twelve (12) months, except as otherwise noted, from the date of delivery (the “Hardware Warranty Period”), under normal use and conditions. To the extent the Product is or contains software (“Software”), Spirent also warrants that, if properly used by Customer in accordance with the Software License Agreement, the Software which it supplies will operate in material conformity with the specifications supplied by Spirent for such Software for a period of ninety (90) days from the date of delivery (the “Software Warranty Period”). The “Product Warranty Period” shall mean the Hardware Warranty Period or the Software Warranty Period, as applicable. Spirent does not warrant that the functions contained in the Software will meet a specific requirement or that the operation will be uninterrupted or error free. Spirent shall have no warranty obligations whatsoever with respect to any Software which has been modified in any manner by Customer or any third party. Defective Products and Software under warranty shall be, at Spirent's discretion, repaired or replaced or a credit issued to Customer's account for an amount equal to the price paid for such Product provided that: (a) such Product is returned to Spirent after first obtaining a return authorization number and shipping instructions, freight prepaid, to Spirent's location in the United States; (b) Customer provides a written explanation of the defect or Software failure claimed by Customer; and (c) the claimed defect actually exists and was not caused by neglect, accident, misuse, improper installation, improper repair, fire, flood, lightning, power surges, earthquake, or alteration. Spirent will ship repaired Products to Customer, freight prepaid, based on reasonable best efforts after the receipt of defective Products. Except as otherwise stated, any claim on account of defective materials or for any other cause whatsoever will conclusively be deemed waived by Customer unless written notice thereof is given to Spirent within the Warranty Period. Spirent reserves the right to change the warranty and service policy set forth above at any time, after reasonable notice and without liability to Customer. TO THE EXTENT PERMITTED BY APPLICABLE LAW, ALL IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE, ARE HEREBY EXCLUDED, AND THE LIABILITY OF SPIRENT, IF ANY, FOR DAMAGE RELATING TO ANY ALLEGEDLY DEFECTIVE PRODUCT SHALL BE LIMITED TO THE ACTUAL PRICE PAID BY THE CUSTOMER FOR SUCH PRODUCT. THE PROVISIONS SET FORTH ABOVE STATE SPIRENT'S ENTIRE RESPONSIBILITY AND CUSTOMER'S SOLE AND EXCLUSIVE REMEDY WITH RESPECT TO ANY BREACH OF ANY WARRANTY.
Contents About this Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Notation Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Hardware Handling/Cleaning Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 How to Contact Us. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Chapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Scripting API Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Installing Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Installing the Scripting API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 On Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 On Linux or Solaris. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Supported Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Upgrading Appliance Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Sample Test Configuration Arrays and Test Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Generate Tcl Scripts from the Layer 4-7 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Setting a Custom Username . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Checksum in Sample Configuration Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Chapter 2: Using the Scripting API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Configuring Tests. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Modifying a Test Configuration Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Modifying a Sample Test Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Executing Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Monitoring Results on the Screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Validating Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Printing and Collecting Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Printing Results to a Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Debugging a Test Script. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Chapter 3: Test Configuration Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Format of a Profile Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Client Test Configuration Array Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Server Test Configuration Array Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Clustered Test Configuration Array Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Test Profile Interface Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Global Test Configuration Array Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Scripting API for the Layer 4-7 Application Reference Manual | 3
Contents
Chapter 4: Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Clustered Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 General Terminology for Clustered Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Query Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 Spirent TestCenter Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Appliance Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Standard Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Interactive Testing Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Appendix A: Statistics Message Indices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Client Statistics Message Indices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Filters to Use for Client Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 TCP Capture-Replay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 UDP Capture-Replay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 DDOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Load Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 POP3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 PPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 PPPoE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Simulated Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 SMTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 Streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 TCPState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 Telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 SIP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 IPSEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 MM4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Server Statistics Message Indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 Filters to Use for Server Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 TCP Capture-Replay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 UDP Capture-Replay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 POP3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 SMTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
4
| Scripting API for the Layer 4-7 Application Reference Manual
Contents
TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 TCP Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 TCP State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 Telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 SIP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 MM4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Appendix B: Sample Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Sample Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Sample Test Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Appendix C: Troubleshooting Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 Troubleshooting Common Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Check your environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Check your debug logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Check the autopath, license directory, and LD_LIBRARY_PATH . . . . . . . . . . . . . . . . 291 Check Spirent TestCenter provisioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Appendix D: ESD Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 General Equipment Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 Workstation Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Appendix E: Fiber Optic Cleaning Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 Cleaning Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Scripting API for the Layer 4-7 Application Reference Manual | 5
6
| Scripting API for the Layer 4-7 Application Reference Manual
About this Guide In About this Guide... •
Introduction . . . . 8
•
Notation Conventions . . . . 8
•
Related Documentation . . . . 9
•
Hardware Handling/Cleaning Practices . . . . 10
•
How to Contact Us . . . . 11
Scripting API for the Layer 4-7 Application Reference Manual
| 7
About this Guide Introduction
Introduction This reference manual provides detailed information on the Tcl scripting API you can use to generate simulated, realistic Internet conditions and load. The Tcl API commands make it easy to configure and run scripting tests from your command interface. This manual is for users running Layer 4-7 tests on Spirent TestCenter ports within a Spirent TestCenter chassis, as well as Avalanche appliances. These users include:
•
Network equipment manufacturers (NEMs) and service providers who need to test multi-function devices such as firewalls, VPN, routing, and web switching.
•
IT professionals testing large enterprise networks and Web infrastructures.
It is assumed that users of this guide are familiar with Microsoft Windows® and Spirent TestCenter, or appliance equipment, and have an intermediate knowledge of data communications theory. Familiarity with Avalanche™ 6.5 or higher software and/or ActiveState ActiveTcl™ software is preferred, but not required. Please see the Release Notes for the ActiveTcl version to use for this release.
Notation Conventions The following notational conventions are used throughout this manual:
8
Notation
Example
Meaning and Use
Courier typeface
WaTestProfile
Indicates elements such as names of parameters, functions, files, and directories.
Angle brackets
Indicates a user variable. Replace the text enclosed in the angle brackets with an appropriate user-specified item. Do not enter the brackets.
Square brackets
[description]
Indicates an optional parameter. Do not enter the brackets.
Curly brackets
{ }
Indicates a Tcl list.
Vertical bar
None | PAP | CHAP
Separates items in a list. You must choose only one item.
Ellipsis dots
...
Indicates that the item preceding the dots can be repeated.
Backslash
\
Indicates that the command continues to the next line.
Blue text
See the AbortTest function for more information.
Indicates a cross-reference. You can click on the cross-reference to jump to the description of that function or parameter.
| Scripting API for the Layer 4-7 Application Reference Manual
About this Guide Related Documentation
Related Documentation See the following documents for information about products that work with the Layer 4-7 Tcl scripting API:
•
Spirent TestCenter Layer 4-7 Application Quick Start Guide - Provides a summary of the major steps you use to set up and run an HTTP-based Quick test on a Spirent TestCenter chassis using the Layer 4-7 Application.
•
Avalanche Commander Quick Start Guide - Provides a summary of the major steps you use to set up and run an HTTP-based Quick test on one Avalanche client appliance and one Avalanche server appliance using Avalanche Commander.
•
Avalanche Analyzer online Help - Describes the Avalanche Analyzer user interface, which allows you to view test result files generated by the Layer 4-7 Application.
•
Avalanche URL Trace Tool online Help - Describes the Avalanche URL Trace Tool user interface, which allows you to view URL Trace file results generated by the Layer 4-7 Application.
•
Avalanche Installation Guide - Provides installation instructions for the Avalanche appliance hardware and software.
•
Getting Started with Spirent TestCenter - Provides details on how to install Spirent TestCenter chassis and modules and how to obtain license keys. Information is also provided on module LEDs, multiple chassis connections, cables, and chassis commands.
•
Layer 4-7 Application online help – Provides information on all procedures required to prepare your testing environment for running tests on a Spirent TestCenter chassis, and Avalanche appliances.
•
Spirent TestCenter System Reference Manual - Provides application overview information, and directs you to appropriate sources for the latest detailed product descriptions.
Note: The Layer 4-7 documentation is located in your installation’s documentation directory. This document is located in your TclAPI installation “Documentation” directory. The Spirent TestCenter documentation is available with your product’s installation.
Scripting API for the Layer 4-7 Application Reference Manual | 9
About this Guide Hardware Handling/Cleaning Practices
Hardware Handling/Cleaning Practices Spirent Communications’ cards and modules contain electronic components that are sensitive to Electrostatic Discharge (ESD) damage. To prevent premature component failure or latent product damage, it is crucial that you handle this equipment following industry standard ESD handling practices. Refer to Appendix D, “ESD Requirements” for further information. Some equipment contains fiber optic components that are very susceptible to contamination from particles of dirt and dust. Product performance may be damaged if these components are not kept clean. Refer to Appendix E, “Fiber Optic Cleaning Guidelines” for proper cleaning practices for these components.
10 |
Scripting API for the Layer 4-7 Application Reference Manual
About this Guide How to Contact Us
How to Contact Us To obtain technical support for any Spirent Communications product, please contact our Support Services department using any of the following methods:
Americas E-mail: [email protected] Web: http://support.spirentcom.com Toll Free: +1 800-SPIRENT (+1 800-774-7368) (US and Canada) Phone: +1 818-676-2616 Fax: +1 818-880-9154 Hours: Monday through Friday, 05:30 to 16:30, Pacific Time
Europe, Africa, Middle East E-mail: [email protected] Web: http://support.spirentcom.com Phone: +33 (0) 1 61 37 22 70 Fax: +33 (0) 1 61 37 22 51 Hours: Monday through Thursday, 09:00 to 18:00, Friday, 09:00 to 17:00, Paris Time
Asia Pacific E-mail: [email protected] Web: http://support.spirentcom.com.cn Phone: 400 810 9529 (mainland China) Phone: +86 400 810 9529 (outside China) Fax: +86 10 8233 0022 Hours: Monday through Friday, 09:00 to 18:00, Beijing Time
The latest versions of user manuals, application notes, and software and firmware updates are available on the Spirent Communications Customer Service Center websites at http://support.spirentcom.com and http://support.spirentcom.com.cn (China). Information about Spirent Communications and its products and services can be found on the main company websites at http://www.spirentcom.com and http://www.spirentcom.com.cn (China).
Company Address Spirent Communications, Inc. 26750 Agoura Road Calabasas, CA 91302 USA
Scripting API for the Layer 4-7 Application Reference Manual | 11
12 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 1
Introduction This chapter introduces the Scripting API for the Layer 4-7 Application Reference Manual, provides a list of the system and PC requirements necessary to run this software, and describes how you get started.
In this chapter... •
Scripting API Overview . . . . 14
•
Installing Java . . . . 14
•
Installing the Scripting API . . . . 15
•
Supported Configurations . . . . 17
•
Upgrading Appliance Software . . . . 18
•
Getting Started . . . . 20
•
Sample Test Configuration Arrays and Test Scripts . . . . 21
Scripting API for the Layer 4-7 Application Reference Manual | 13
Chapter 1: Introduction Scripting API Overview
Scripting API Overview The Scripting API for the Layer 4-7 Application is a Tcl-based API that provides the same functionality you have with the Layer 4-7 Application: you can create and run tests on appliances and Spirent TestCenter ports within a Spirent TestCenter chassis. Use the Tcl commands described in this manual to create a user-specific test script. Consult a standard Tcl reference document for general Tcl information. For the correct version of the ActiveState Active Tcl to use, please see the Release Notes. If you do not have the required version, you can download the version for your platform from one of the following ftp sites: ftp://ftp.activestate.com/ActiveTcl/Linux/ ftp://ftp.activestate.com/ActiveTcl/Solaris/ ftp://ftp.activestate.com/ActiveTcl/Windows/ When you run a test, your script controls the starting and stopping of clients and servers. You do not need to be present to run tests or collect results. Please see the Release Notes for information about system requirements, cable requirements, PC requirements, and network connectivity.
Installing Java Note: The Layer 4-7 Application includes Java when installed in a Windows environment. Therefore, you do not need to install Java, if you plan to run a Layer 4-7 test in a Windows environment. You need to install Java only if you plan to run a Layer 4-7 test in a Unix (Linux/Solaris) environment. To install Java:
14 |
1
Install Java 2 Platform, Standard Edition, version 1.5 (J2SE) on your Linux or Solaris host, if it is not already installed. You can download it from http://java.sun.com/javase/downloads/index_jdk5.jsp. Both version numbers “1.5” and “5.0” identify the release of the Java 2 Platform Standard Edition. (Version “5.0” is the product version, while “1.5.0” is the developer version.)
2
After you have installed Java 1.5, if you are using Solaris or Linux, and there is no Java executable path already defined in the PATH environment variable, then you must set either the PATH or JAVA_HOME environment variable. (If you set both, then the PATH will take precedence.) Examples: csh: setenv JAVA_HOME “” sh: JAVA_HOME =“” export JAVA_HOME bash: export JAVA_HOME=“”
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 1: Introduction Installing the Scripting API
Notes: •
On Linux and Solaris platforms, you must add the Java executable path into either the PATH or JAVA_HOME environment variable for the result files to be merged seamlessly. If one of these environment variables is not set correctly, the following error will appear at the end of a test run during the result files merge time:
Transferring Client Cluster ResultsERROR: Error invoking merge: couldn't execute "java": no such file or directory
•
On Windows machines, you do not need to set the JAVA_HOME or PATH environment variable.
Installing the Scripting API You use the Scripting API for the Layer 4-7 Application to establish a connection and configure your appliances or Spirent TestCenter cards. For Linux and Solaris systems, the Scripting API software can be downloaded from the Spirent Communications Customer Service Center website at http://support.spirentcom.com or copied from the CD shipped with your order. The Scripting API software for Windows XP SP2 is automatically installed when you install the Layer 4-7 Application. See the Release Notes for step-by-step instructions on installing the Scripting API for the Layer 4-7 Application.
On Windows To Install the Scripting API Software on Windows XP Run the Layer 4-7 Application installation program on your Windows XP PC, and follow the instructions in the InstallShield Wizard. Note: When you uninstall the software (via Add/Remove Programs on your PC), additional files may be left in the installation directory. The uninstaller only removes those files explicitly installed by the installer, and does not remove any additional files or directories created after installation.
On Linux or Solaris To Install the Scripting API Software on Linux or Solaris Be sure to read the Release Notes for important installation, configuration, and test guidelines that may have been updated since this document was written. This section of the documentation covers important information for successfully installing the Scripting API software on Linux or Solaris machines. Also, read the Release Notes for additional information about installing the Tcl API on Linux and Solaris machines.
Scripting API for the Layer 4-7 Application Reference Manual | 15
Chapter 1: Introduction Installing the Scripting API
The Scripting API for the Layer 4-7 Application for Solaris and Linux is delivered as a tarball archive. Note: The following programs must be installed on your system, and the path of their executables should be set in your PATH: Java 1.5, tar, gunzip, and ActiveTcl. Refer to the Release Notes for the correct version of ActiveTcl to use for the current release. 1
Transfer the tarball (.tgz file) to your Linux/Solaris host. Note: Tcl API functionality is dependent on the tar and gzip commands. The Tcl API does not call these two commands with their absolute paths; their location is assumed to be part of the user's PATH environment variable. If that is not the case, then you will get an error message such as ‘tar –cf test.tar .: Command not found.’ If “tar” and “gzip” commands are not part of your PATH environment variable by default, add their locations into your PATH environment variable. You can check if the path to “tar” and “gzip” commands is in your PATH variable by using the “which tar” and "which gzip" commands. If they are already in your PATH variable, then the full path/location for these commands will be successfully returned.
2
Unzip the tarball file to extract its contents. The following example is for a Solaris tarball: gunzip Spirent_TestCenter_Auto_Solaris_2.xx.tar.gz
3
Untar the unzipped tarball. At this point, the tarball will only have a “.tar” extension. The following example untars the Solaris tarball: tar -xvf Spirent_TestCenter_Auto_Solaris_2.xx.tar
4
The following directory structure is then created in your current directory: |_ Spirent_TestCenter_2.xx |_ Layer_4_7_Application_Solaris |_ STC |_ TclAPI
5
Define your appropriate environment variables as follows: bash example: export LD_LIBRARY_PATH=“//Spirent_ TestCenter_2.xx/Layer_4_7_Application_Solaris/STC:/ /Spirent_TestCenter_2.xx/ Layer_4_7_Application_Solaris/TclAPI/SmartLib/unix/ solaris:$LD_LIBRARY_PATH”
Note: If you plan to generate a portable Tcl test from the Layer 4-7 Application (for example, you many want to generate a test in Windows, and then execute it on another operating system or computer), then you must set the following additional system environment variable on every computer on which you intend to run the test: SPIRENT_TCLAPI_ROOT SPIRENT_TCLAPI_LICENSEROOT (only needed for appliances)
16 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 1: Introduction Supported Configurations
The first variable should point to the root API installation directory on the computer. The second variable should point to a directory housing the correct TclAPI license(s) (appliances only) on that computer. If these two variables have been configured correctly, and a valid license file exists within the license directory (appliances only), the test should run successfully. If you do not want to set these environment variables on your computer, you can manually modify the test script to include these variables. bash: export SPIRENT_TCLAPI_ROOT=”/ Spirent_TestCenter_2.xx/Layer_4_7_Application_Solaris/ TclAPI”
Supported Configurations This section provides a brief overview of the various capabilities of the scripting API.
Current Supported Functionality The API supports the following features:
• Creation and manipulation of Client Load, Network, Interface, Subnet, and User profiles
• Creation and manipulation of Server Network, Interface, Subnet, Server, and Transaction profiles
• Ability to create, start, and stop a test • Ability to retrieve results from a test.
Scripting API for the Layer 4-7 Application Reference Manual | 17
Chapter 1: Introduction Upgrading Appliance Software
Upgrading Appliance Software To install the latest product software on Client or Server appliances, if you are using a Windows system, use the Software Upgrade button in Avalanche Commander (the Layer 4-7 Application GUI). (See “Upgrading Appliance Software” in the Layer 4-7 Application online help for more information.) Because Avalanche Commander is not available for Solaris or Linux systems, if you are using the Tcl API on a Solaris or Linux system, you must use the following steps to upgrade your Avalanche appliance (2500, 250, or 2700) with Avalanche Commander:
To upgrade appliance software 1
Open a console window in your Linux or Solaris host machine.
2
Transfer the avalanche_.tgz file to your host.
3
Go to the directory in which the .tgz file now resides, for example: cd /var/ftp/ TGZ/
4
FTP to the IP address of the appliance, for example: ftp 10.20.30.40.
5
Type root for your login ID, and welcome for your password. These are the default credentials for the appliance.
6
Go to the /disk/images directory: cd /disk/images.
7
Upload the avalanche binary file to /disk/images and exit: put avalanche_.tgz bye
Note: For the 2700 appliance, you must use the .tgz file with “-lx” in its name. 8
Telnet to the IP address of the appliance using the same login ID and password as before: telnet 10.20.30.40 login: root password: welcome
9
If you are upgrading the 2700 appliance, run /swat/bin/upgradeswat. A menu appears in which you must choose which version to install. Choose the Avalanche Commander image that you previously uploaded. The Avalanche Commander process automatically restarts. Note: You may want to leave only the new.tgz file in the /disk/images directory and move the old .tgz file into a repository type of directory before issuing a shutdown command. This extra step helps to ensure that the appliance will reboot without any problems.
10 If you are upgrading an appliance other than the 2700, reboot the system with shutdown -f
18 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 1: Introduction Upgrading Appliance Software
The following example illustrates this process: To FTP the Layer 4-7 Application software to the 2700 appliance: ftp 10.20.30.40 login: root password: welcome cd /disk/images bin put avalanche-lx_.tgz bye
To upgrade the image currently in use: telnet 10.20.30.40 login: root password: welcome /swat/bin/upgradeswat
exit
To FTP the Layer 4-7 Application software to any appliance other than the 2700: ftp 10.20.30.40 login: root password: welcome cd /disk/images bin put avalanche-lx_.tgz bye
To upgrade the image currently in use: telnet 10.20.30.40 login: root password: welcome shutdown -f
Scripting API for the Layer 4-7 Application Reference Manual | 19
Chapter 1: Introduction Getting Started
Getting Started Before you develop your own tests, it is a good idea to practice the basic steps you must complete to configure and run a test. The following procedure summarizes the basic steps you follow to run an existing sample test on your hardware. The Scripting API for the Layer 4-7 Application includes sample test configuration arrays and test scripts. To modify/configure and run an existing client/server test: 1
Check license and network information.
2
Select the hardware that you want to use with the test.
3
Configure the client and server in the test configuration file.
4
Create or modify one of the Tcl test scripts.
5
Run, validate, and monitor the test.
6
View and analyze test results.
For detailed information on checking license and network information and setting up the hardware to use with your test, see the Layer 4-7 Application online help). To configure and run a test on devices using the scripting API, you must first set up the required test parameters in a test configuration array file. You use any text editor to modify the parameters in a provided sample test configuration array file. At a minimum, you must modify the provisioning entries for Spirent TestCenter ports. Once you configure the test configuration array, you can modify the test script to run the test. This script contains a call to the file containing the test configuration array you modified. You must check to be sure that the following parameters in your test script are correct and modify them if necessary:
• Path to the core API files (set auto_path command) • Path to the file containing the test configuration array (source command)
• • • •
IP address(es) of the client IP address(es) of the server Test name (testId variable definition) Test directory (testDirectory variable definition) that specifies the location of the test configuration XML files that will be generated and uploaded onto the Spirent TestCenter or appliance platform, and the result files that will be generated at the end of the test run.
For more detailed instructions on modifying a test configuration array and test script, see Chapter 2, “Using the Scripting API.”
20 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 1: Introduction Getting Started
Sample Test Configuration Arrays and Test Scripts The Scripting API for the Layer 4-7 Application includes sample test configuration files and test scripts that you can use to configure and run your tests. These sample files are included in the SampleTests directory. The following directory contains the sample tests for the Linux version: //Spirent_TestCenter_2.xx/ Layer_4_7_Application_Linux/TclAPI/SampleTests
The sample tests in this directory have these caveats:
• They are designed to be run between client and server units when these systems are connected through the same vlan on a switch.
• They run optimally on appliances with dual CPUs and GigEthernet connectivity. They do not account for the complexities of various network topologies and should only be used as an example for creating custom tests.
• They can be copied, but should not be modified, as they were designed to acquaint customers with the product.
Generate Tcl Scripts from the Layer 4-7 Application You can also generate Tcl test scripts from the tests you create in the Layer 4-7 Application. The resulting Tcl test files (a test configuration array and a Tcl test script) are stored in the specified output directory. See Chapter 2, “Using the Scripting API” for more information about creating and modifying test scripts. Also, see the Layer 4-7 Application online Help topic “Converting a Test to a Tcl Script” for more about converting a test to a Tcl script. Tip: If you get an error message when generating a Tcl script from a test created in the Layer 4-7 Application, check the log files created in the GUI2TclDebug and TestDivide directories to help you troubleshoot the issue: Gui2Tcl_out.log, Gui2Tcl_err.log, Divide.err, and Divide.out.
Setting a Custom Username In the Layer 4-7 Application, you can set a custom username by choosing Preferences from the Tools menu, and then clicking on “User Name” under “Miscellaneous.” Select the “Custom” radio button, and enter a new user name in the field next to the button. To set a custom username in the Tcl API: On a Windows platform, enter the following in the command prompt window in which the Tcl script will run: set username=
Scripting API for the Layer 4-7 Application Reference Manual | 21
Chapter 1: Introduction Getting Started
On a Unix (Linux/Solaris) platform, enter the following in the console window in which the Tcl script will run: export USER= (for bash shell)
This command changes the ownership information used by the Tcl API. Tip: When you reserve port groups, you can see this username information in the Layer 4-7 Application's Administration window for both appliances and Spirent TestCenter while a Tcl API test is running (assuming you have a PC with the Layer 4-7 Application installed in your environment).
Checksum in Sample Configuration Arrays Each sample script includes a checksum element within its corresponding configuration array. The checksum is there so that we can easily determine if someone has modified the configuration array. If the checksum is not valid, it does not prevent the test from running. It is only there to help us determine whether a test script was modified after it was generated from the Layer 4-7 Application. This helps us narrow where the problem is when we get a problem script from a customer. You can manually remove the checksum element without consequence.
22 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 2
Using the Scripting API This chapter explains how to use the Scripting API for the Layer 4-7 Application, including how to modify a test configuration array, modify a test script, validate and monitor test results, and debug a test. A test configuration array enables you to specify exactly what you want to test and how you want to test it on the appliance or Spirent TestCenter hardware. Any test you can create an run in the Layer 4 - 7 Application, you can create and run using its Tcl scripting API.
In this chapter... •
Configuring Tests . . . . 24
•
Executing Scripts . . . . 31
•
Validating Scripts . . . . 36
•
Printing and Collecting Test Results . . . . 37
•
Debugging a Test Script . . . . 38
Scripting API for the Layer 4-7 Application Reference Manual | 23
Chapter 2: Using the Scripting API Configuring Tests
Configuring Tests If you are using a Windows machine, we recommend that you use the “Generate Tcl Test” feature in the Layer 4-7 Application to generate your Tcl scripts. The resulting Tcl test files (a test configuration array and a Tcl test script) are stored in the specified output directory. See the Layer 4-7 Application online Help topic “Converting a Test to a Tcl Script” for more information. If you are using a Solaris or Linux machine, we recommend that you start by copying and then modifying one of the sample scripts packaged with your software. The Scripting API for the Layer 4-7 Application includes several sample test configuration arrays and Tcl test scripts. Modifying a sample test involves two types of files:
• A file containing the test configuration array parameters (config.tcl) • A Tcl script that sources the configuration array and runs the test (test.tcl) Note: You can also create one file that contains both the configuration array and the test script. You can run the sample Tcl API scripts on one of the following platforms:
• Appliance • Spirent TestCenter The sample scripts are available in the Tcl API branch under the ../SampleTests directory. Appendix B, “Sample Files” also contains a printout of the sample configuration file for Spirent TestCenter (config.tcl)and its corresponding sample test script (test.tcl). However, refer to the set of sample scripts packaged with the Tcl API for the most recent API scripts. To configure and run a client/server test: 1
Check license and network information.
2
Select the hardware to use with your test.
3
Create or modify the required test parameters in the test configuration file.
4
Create or modify a Tcl test script.
5
Run, validate, and monitor the test.
6
View and analyze test results.
Modifying a Test Configuration Array A test configuration array is the central means by which the API generates the necessary configuration file to upload into the Spirent TestCenter chassis or appliance. It contains hardware information, such as device IP address and test name, to test specific information such as network, interface, and load profile configurations.
24 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 2: Using the Scripting API Configuring Tests
The Scripting API for the Layer 4-7 Application includes sample test configuration array files for you to run or modify. Select the one that most closely matches your Solaris or Linux platform, copy it, and then modify its parameters. Because configuration files are ASCII text files, you can use any text editor to edit them. Open the ConnsPerSecApp config.tcl file in your SampleTests directory to see a typical test configuration array for an appliance. Note the parameters are on the left, and the values for those parameters are in curly braces {} on the right. All of the appliance versions of the sample tests included with your software are designed to run on two 2500 appliances; each 2500 has two units or processors. Note: The term “unit” is used throughout this document to denote either of the following:
• •
CPU number of the unit for an appliance Spirent TestCenter port group number for a Spirent TestCenter chassis
Modifying a Test Configuration Array for an Appliance Next, you will learn how to modify the Open Connections sample configuration array for an appliance. To modify a sample configuration array for your appliance: 1
Go to the /SampleTests directory where the sample files are stored.
2
Find the sample configuration script that most closely matches your hardware and the kind of test you want to run. For example, to edit the Open Connections sample configuration array for a 2500 appliance, go to /SampleTests/OpenConns/ApplianceVersion.
3
Copy the OpenConnsAppConfig.tcl file to your test directory and rename it to something you will remember. Note: You do not have to use the .tcl extension in the name of the test configuration array file. For example, you could name it configAv2500OpenConn.txt.
4
Open the copy of your sample file that you just renamed.
Scripting API for the Layer 4-7 Application Reference Manual | 25
Chapter 2: Using the Scripting API Configuring Tests
5
Configure your test parameters and their values. Add and/or delete necessary sections of the client profiles partially or as a whole in the configuration array. If you plan to use the defaults, you do not need to modify most of the parameters. Refer to Chapter 3, “Test Configuration Array” for an explanation of each parameter. It contains a list of all parameters with their descriptions and default values. However, you must modify the network address subnet that you want to represent for your test ports, and enter the range of IP addresses from which you want to generate traffic for your test ports in the following WaSubnet parameters: WaSubnet,ConnsPerSec_sn0,IpAddressRanges,IpAddressRange {192.168.42.20-192.168.42.30}\ WaSubnet,ConnsPerSec_sn0,Network {192.168.42.0}\
6
\
Set the server profile parameters, starting with WrTestProfile,Description {Advanced Generic Device Test}. Add and/or delete necessary sections of the server profiles partially or as a whole in the configuration array. If you plan to use the defaults, you do not need to modify most of the parameters. Refer to Chapter 3, “Test Configuration Array” for an explanation of each parameter. However, you must modify the network address subnet that you want to represent for your test ports, and enter the range of server IP addresses: WrSubnet,echo_sn0,Network {192.168.42.0}\ WrSubnet,echo_sn0,ServerProfile,0,IpAddressRange {192.168.42.11}\
7
Save the changes to your modified configuration file.
Modifying a Test Configuration Array for a Spirent TestCenter Chassis Next, you will learn how to modify the Open Connections sample configuration array for a Spirent TestCenter chassis. Spirent TestCenter cards are segregated into a number of port groups, each containing one to two individual ports, depending on the model. Once provisioned, these port groups are locked for use by you and flagged as “locked” to other users. To modify a configuration array file for a Spirent TestCenter chassis: 1
Go to the /SampleTests/STC/AdvDevOpenConns directory.
2
Copy the config.tcl file to your test directory and rename it to something you will remember. Note: You do not have to use the .tcl extension in the name of the test configuration array file. For example, you could name it configSTCopenConn.txt.
3
26 |
Open the copy of your sample file that you just renamed.
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 2: Using the Scripting API Configuring Tests
4
Define a provisioning list for each port. You enter the portID parameter in the following format: :,. You must provide all parameters (port ID, MAC address, etc.) for each port and in the order shown in the script. The order of parameter values is very important, so skipping a parameter value or changing the order of these values will give you error messages and prevent your test from running. Your sample Spirent TestCenter configuration file includes a four-port provision list, which you can modify for your configuration. # \ # # lappend stcProvisionList [list "10.47.52.21:3,1" \ "a4-b4-89-00-00-19" "Copper" "Full" "100" "Enable"] lappend stcProvisionList [list "10.47.52.21:3,2" \ "a4-b4-89-00-00-1d" "Copper" "Full" "100" "Enable"] lappend stcProvisionList [list "10.47.52.21:4,1" \ "a4-b4-89-00-00-21" "Copper" "Full" "100" "Enable"] lappend stcProvisionList [list "10.47.52.21:4,2" \ "a4-b4-89-00-00-26" "Copper" "Full" "100" "Enable"]
5
You can add another port by defining a provisioning list for it. You must define a provisioning list for each port you add. In the following script, we have added two ports (shown in bold): lappend stcProvisionList [list "10.47.52.21:5,1" \ "a4-b4-89-00-00-31" "Copper" "Full" "100" "Enable"] lappend stcProvisionList [list "10.47.52.21:5,2" \ "a4-b4-89-00-00-36" "Copper" "Full" "100" "Enable"]
6
Configure your test parameters and their values. Add and/or delete necessary sections of the client profiles partially or as a whole in the configuration array. If you plan to use the defaults, you do not need to modify most of the parameters. Refer to Chapter 3, “Test Configuration Array” for an explanation of each parameter. It contains a list of all parameters with their descriptions and default values. However, you must modify the network address subnet that you want to represent for your test ports, and enter the range of IP addresses from which you want to generate traffic for your test ports in the following WaSubnet parameters: WaSubnet,OpenConns_sn0,Network {192.168.42.0} WaSubnet,OpenConns_sn1,IpAddressRanges,IpAddressRange {192.168.42.65-192.168.42.126}
7
Set the server profile parameters, starting with WrTestProfile {test Description...}. Add and/or delete necessary sections of the server profiles partially or as a whole in the configuration array. If you plan to use the defaults, you do not need to modify most of the parameters.
Scripting API for the Layer 4-7 Application Reference Manual | 27
Chapter 2: Using the Scripting API Configuring Tests
Refer to Chapter 3, “Test Configuration Array” for an explanation of each parameter. However, you must modify the network address subnet that you want to represent for your test ports, and enter the range of server IP addresses: WrSubnet,echo_sn0,Network {192.168.42.0} WrSubnet,echo_sn0,ServerProfile,0,IpAddressRange {192.168.42.11}
8
Save the changes to your modified configuration file.
Modifying a Sample Test Script After you have modified the configuration array for your test, you are ready to select and edit one of the test scripts for your test. You must modify the following parts of your test script:
• Path to the core API files (set auto_path command) • Path to the file containing the test configuration array (source command) IP address(es) of the client
• • IP address(es) of the server • Test name (testId variable definition) • Test directory (testDirectory variable definition) that specifies the location of the test configuration XML files that will be generated and uploaded onto the Spirent TestCenter or appliance platform, and the result files that will be generated at the end of the test run. To modify a sample test script for an appliance: 1
Open the sample test.tcl script.
2
Define a callback procedure. You may add new or delete existing statistics to be displayed in real-time on your screen while running this script. See “RegisterStatsCallback” on page 216 and Appendix A, “Statistics Message Indices” for more information about statistics.
3
Before using the Tcl API commands for the Layer 4-7 Application, you must set the path to the Tcl API installation directory so the API can find the core package: set auto_path [linsert $auto_path 0 "C:/Program Files/Spirent Communications/Spirent TestCenter 2.xx/Layer 4-7 Application/TclAPI"]
4
28 |
Be sure not to change the package require command: package require SPI_AV
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 2: Using the Scripting API Configuring Tests
5
Be sure that the InitializeAPI function appears right after the package require command so that the API is ready for use: SPI_AV::InitializeAPI
6
Be sure that you associate an appropriate license file with the test. You can add more licenses via additional calls to the SPI_AV::AddLicense function. SPI_AV::AddLicense
7
Modify the “source” command with the path to the file containing the test configuration array to use for this test. For example: source "./config.tcl"
8
Modify the testDirectory and testID variables in which the directory names/ locations where your XML configuration and results files are stored.
9
Save your script. Remember to save the script with a different name so you do not overwrite the sample script.
Note: Because they provide access to the API functions, you must always enter the set auto path and package require commands at the beginning of a new Tcl test script. To modify a sample test script for a Spirent TestCenter chassis: 1
Open the sample test.tcl script.
2
Define a callback procedure. You may add new or delete existing statistics to be displayed in real-time on your screen while running this script. See “RegisterStatsCallback” on page 216 and Appendix A, “Statistics Message Indices” for more information about statistics.
3
Before using the Tcl API commands for the Layer 4-7 Application, you must set the path to the Tcl API installation directory so the API can find the core package: set auto_path [linsert $auto_path 0 "C:/Program Files/Spirent Communications/Spirent TestCenter 2.xx/Layer 4-7 Application/TclAPI"]
4
Be sure not to change the package require command: package require SPI_AV
5
Be sure that the InitializeAPI function appears right after the package require command so that the API is ready for use: SPI_AV::InitializeAPI
6
Be sure that you associate the correct chassis IP address(es) with the SPI_AV::AddLicense function to generate a valid license file for the test. SPI_AV::AddLicense -STC 10.47.70.40
Scripting API for the Layer 4-7 Application Reference Manual | 29
Chapter 2: Using the Scripting API Configuring Tests
You can have more than one chassis IP address in the SPI_AV::AddLicense function call, if more than one chassis is involved in the test, using the following syntax: SPI_AV::AddLicense -STC ...
7
Modify the “source” command with the path to the file containing the test configuration array to use for this test, for example: source "./STC/AdvDevOpenConns/config.tcl"
30 |
8
Modify the testDirectory and testID variables in which the directory names/locations where your XML configuration and results files are stored.
9
Save your script. Remember to save the script with a different name so you do not overwrite the sample script.
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 2: Using the Scripting API Executing Scripts
Executing Scripts Before running a test, make sure all the systems you intend to use (clients or servers) are up and running. Spirent Communications recommends that, when creating a new test, you start with a small load to verify the connectivity between clients and servers, and the device or infrastructure under test. Once connectivity has been established, you should start incrementally increasing the amount of traffic generated until the desired load is achieved. The creation of a high load on the first test, without first establishing connectivity, might lead to problems that are easier to identify with a test with a small amount of traffic. Note: We strongly recommend that you run your scripts in separate Tcl shells, instead of running several tests or the same test several times in the same Tcl shell. To run a test script: 1 2
Open a new window. If you are using Windows, choose Run from the Start menu, enter cmd, and then click OK. Change to the directory containing the script to run (for example, cd TclAPI\Tests).
3
Run your Tcl script. For instance, enter tclsh test.tcl as shown in the following example:
Figure 2-1. Running Your Script in Windows
While the script is running, messages appear on the screen displaying live statistics. When the run has finished, you can view the test results in the .csv results files. You can monitor a test while it is running by watching the real-time client and server statistics messages that appear on the screen. You can also print the test results to a file. To collect results, you must configure your script via a callback function.
Monitoring Results on the Screen To check your real-time statistics while a test is running, you must define two callback procedures: one for the client side to pass real-time client statistics and one for the server side to pass real-time server statistics. These two procedures print out client and server real-time statistics on the screen during a test run.
Scripting API for the Layer 4-7 Application Reference Manual | 31
Chapter 2: Using the Scripting API Executing Scripts
To register callbacks to check the real-time messages while a test is running: 1
Define client and server callback procedures that will pass the real-time statistics data captured by the SPI_AV::ClusterController::RegisterStatsCallback functions and display the results on the screen or print them to a log file. Because the data is continuously updated in the array, you can see the progress of the test by looking at the printed messages on the screen. Example:
# Define a Client callback procedure # proc clientStatsCallbackProc {clusterID data} { array set dataArray $data
catch { puts "Client Attempted
: $dataArray(http,attemptedTxns)"
puts "Client Successful
: $dataArray(http,successfulTxns)"
puts "Client Unsuccessful : $dataArray(http,unsuccessfulTxns)" puts "Client Aborted puts "\tTIME (seconds)
: $dataArray(http,abortedTxns)" Elapsed
: $dataArray(timeElapsed)"
puts "\t\t\tRemaining : $dataArray(timeRemaining)" } puts "" }
# # Define a Server callback procedure # proc serverStatsCallbackProc {clusterID data} { array set dataArray $data
catch { puts "Server Per second puts "Server Open
: $dataArray(tcpConn,connsPerSec)" : $dataArray(tcpConn,openConns)"
puts "Server Closed with error : $dataArray(tcpConn,closedWithError)" puts "Server Closed with reset : $dataArray(tcpConn,closedWithReset)"
32 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 2: Using the Scripting API Executing Scripts
puts "Server Closed no error Error)"
: $dataArray(tcpConn,closedWithNo-
puts "\tTIME (seconds)
: $dataArray(timeElapsed)"
Elapsed
} puts "" }
2
For the "SPI_AV::ClusterController::RegisterStatsCallback" function, specify the cluster ID of the client and the cluster ID of the server box or card, the name of the user-defined procedures (clientStatsCallbackProc and serverStatsCallbackProc), and a filter list (time, http, and tcpConn in this example) that specifies the statistics you want to collect during a test run. The callback IDs are saved in the variables named "clientStatsCallbackID" and “serverStatsCallbackID” to be used later for unregistering when the test ends (see the example below).
# # Register a statsCallback for the cluster(s) # set clientStatsCallbackID [SPI_AV::ClusterController::RegisterStatsCallback $clientClusterID clientStatsCallbackProc [list "time*" "http"]] set serverStatsCallbackID [SPI_AV::ClusterController::RegisterStatsCallback $serverClusterID serverStatsCallbackProc [list "tcpConn" "time*" ]] # # Unregister the previously registered callbacks # catch {SPI_AV::ClusterController::UnregisterStatsCallback $clientClusterID $clientStatsCallbackID} catch {SPI_AV::ClusterController::UnregisterStatsCallback $serverClusterID $serverStatsCallbackID}
Here is an example of output displayed on the screen when a test with the above sample code is run: C:\TclAPI\2.xx\Build_0045\ModDefTrasaction>tclsh test.tcl Attempting to provision Spirent TestCenter Ports STC Port (10.47.20.21:1,1) provisioned SUCCESSFULLY STC Port (10.47.20.21:1,2) provisioned SUCCESSFULLY STC Port (10.47.20.21:1,3) provisioned SUCCESSFULLY STC Port (10.47.20.21:1,4) provisioned SUCCESSFULLY STC Port (10.47.20.21:1,5) provisioned SUCCESSFULLY STC Port (10.47.20.21:1,6) provisioned SUCCESSFULLY STC Port (10.47.20.21:1,7) provisioned SUCCESSFULLY
Scripting API for the Layer 4-7 Application Reference Manual | 33
Chapter 2: Using the Scripting API Executing Scripts
STC Port (10.47.20.21:1,8) provisioned SUCCESSFULLY STC Port (10.47.20.21:2,1) provisioned SUCCESSFULLY STC Port (10.47.20.21:2,2) provisioned SUCCESSFULLY STC Port (10.47.20.21:2,3) provisioned SUCCESSFULLY STC Port (10.47.20.21:2,4) provisioned SUCCESSFULLY STC Port (10.47.20.21:2,5) provisioned SUCCESSFULLY STC Port (10.47.20.21:2,6) provisioned SUCCESSFULLY STC Port (10.47.20.21:2,7) provisioned SUCCESSFULLY STC Port (10.47.20.21:2,8) provisioned SUCCESSFULLY Spirent TestCenter Ports SUCCESSFULLY provisioned Generating Test - done Stopping Client Cluster - done Stopping Server Cluster - done Removing Test From Client Cluster - done Removing Test From Server Cluster - done Uploading Test To Client Cluster - done Uploading Test To Server Cluster - done Starting Server Cluster - done Starting Client ClusterServer Per second Server Open
: 0
: 0
Server Closed with error : 0 Server Closed with reset : 0 Server Closed no error TIME (seconds)
: 0 Elapsed
: 12
- done Waiting For Client Cluster To CompleteServer Per second Server Open
: 0
Server Closed with error : 0 Server Closed with reset : 0 Server Closed no error TIME (seconds)
: 0 Elapsed
Client Attempted
: 2706
Client Successful
: 2704
Client Unsuccessful : 0
34 |
Scripting API for the Layer 4-7 Application Reference Manual
: 16
: 0
Chapter 2: Using the Scripting API Executing Scripts
Client Aborted
: 0
TIME (seconds)
Elapsed
: 4
Remaining : 208
Server Per second
: 16921
Server Open
: 18
Server Closed with error : 0 Server Closed with reset : 72473 Server Closed no error
: 0
TIME (seconds)
Elapsed
Client Attempted
: 116092
Client Successful
: 116077
: 24
Client Unsuccessful : 0 Client Aborted
: 0
TIME (seconds)
Elapsed
: 8
Remaining : 204
Server Per second
: 27733
Server Open
: 31
Server Closed with error : 0 Server Closed with reset : 183393 Server Closed no error TIME (seconds)
: 0 Elapsed
: 28
Scripting API for the Layer 4-7 Application Reference Manual | 35
Chapter 2: Using the Scripting API Validating Scripts
Validating Scripts You can trial run test parameters before starting a test by adding the ValidateTest function to your test script. The ValidateTest function trials the test by running once through the Client Actions URL list. It performs an internal consistency check, scanning through configuration files, error checking, and ensuring that all files referenced are available. ValidateTest verifies that all of the URLs are accessible. There is no time limit; it runs
as long as it takes to check each URL once. This process usually finishes quickly, unless the servers are not responding or requests are timing out. If problems are encountered, check the results file to troubleshoot the test. During a trial run, the ValidateTest function generates a PCAP (packet capture) trace file for each individual client and server unit involved in the test, called trace.pcap, showing all the traffic requests and responses as the result of one simulated user. One or more PCAP files shows all the packets sent and received at all interfaces, and can be opened using any sniffer program, such as Ethereal, Netasyst (was Sniffer Pro), or ClearSight. (For more information about accessing PCAP files, see the Analyzing Test Results topic in the online Help.) Also during a trial run, the ValidateTest function generates an XML trace file for individual URLs, which contains errors, bindings of variables, response latency, and so on. One trace file is generated per simulated user, called httptracefile_X_trace.xml, where X is a number that represents the simulated user associated with the file. You can view this file by using the URL Trace Tool. To add the ValidateTest function to one of the sample scripts, you need to replace the function calls to start client and server tests (SPI_AV::ClusterController::StartClusteredTest function calls for $serverClusterID and for $clientClusterID) in the script for the client side. To validate a test: 1
In your test.tcl script, replace “StartClusteredTest” with “ValidateClusteredTest” as follows: SPI_AV::ClusterController::ValidateClusteredTest $clientClusterID $serverClusterID $testId
36 |
2
Before validating a test, you must add the UploadTest function to your script to upload the test to all necessary units.
3
Once ValidateTest verifies that no errors were encountered during the test, it returns a success.
4
Once the trial run is finished, you can view the trace files using the URL Trace Tool (available on Windows only).
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 2: Using the Scripting API Printing and Collecting Test Results
Printing and Collecting Test Results You can monitor a test while it is running by watching the real-time client and server statistics messages that appear on the screen. You can also print the test results to a file. To collect results you must configure your script via a callback function. See ““Executing Scripts” on page 31” for more information on callback functions.
Printing Results to a Log File When you run a test, it always creates results files with the extension .csv, which contains the client and server-related test configuration and performance statistics. Results files appear in the same location as your test XML files, except in a folder named “Results.” The exact location of your test results depends on the specified testIDirectory and testId variables in your test script: set testDirectory "C:/TclAPI/2.xx/Build_0045/Appliance/ AdvDevConnsPerSecAppliance" set testId "AdvDevConnsPerSecAppliance"
Test results for the individual client units are stored in a subdirectory named \\results\clientsubtest_. Likewise, test results for the server are stored in a subdirectory named \\results\serversubtest_. Within each of those folders you will find two results files: realtime.csv and summary.csv.
Additionally, for clustered tests, there is a folder called \\results\merged in which the total aggregate results files, summary.csv, and realtime.csv, for both the client and server are stored under “client” and “server” directories.
Scripting API for the Layer 4-7 Application Reference Manual | 37
Chapter 2: Using the Scripting API Debugging a Test Script
Debugging a Test Script If you do not invoke a Tcl command properly, the system returns an error. Each error description usually explains that the command failed and indicates the correct usage of the command. When you are running a test script, it can be difficult to detect which command failed. Including puts statements in the test script can narrow the problem area, because you can see the output at each point in the script where a puts statement occurs. You can also use the built-in stack trace by calling set errorInfo, or type in the commands one at a time. Currently, each API function returns an appropriate error message indicating if it encountered a problem but also returns a 1 if the operation completed successfully. So, you can write code around each API function call that tests to see if it completed successfully. You can also turn debugging on for a TclAPI script for better debugging purposes. You define a single variable, bEnableLogging, as in the following example taken from an automatically generated test script, test.tcl: set bEnableLogging 0; # Enable (1) to create a log file for enhanced debugging
Setting the bEnableLogging variable to 1 causes a test_apilog.log file to be generated in the same location where the script (test.tcl) resides. Important: To ensure communication between the workstation on which you are running the Scripting API for the Layer 4-7 Application and your appliance, or Spirent TestCenter chassis, port number 1415 must not be blocked (for example, with a firewall or access control list).
38 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3
Test Configuration Array This chapter contains the syntax and descriptions of the parameters in a test configuration array file.
In this chapter... •
Format of a Profile Entry . . . . 40
•
Client Test Configuration Array Parameters . . . . 41
•
Server Test Configuration Array Parameters . . . . 119
•
Clustered Test Configuration Array Parameters . . . . 177
•
Global Test Configuration Array Parameters . . . . 178
Scripting API for the Layer 4-7 Application Reference Manual | 39
Chapter 3: Test Configuration Array Format of a Profile Entry
Format of a Profile Entry The typical format of an entry within the test configuration array is: ,,
•
Specifies the type of profile you are configuring. •
Client (Wa) Enter one of the following types of client profiles: WaTestProfile, WaLoadProfile, WaInterface, WaNetworkProfile, WaSubnet, WaUrlList, WaUserProfile, WaUrlList, WaStaticRouteTable, WaTelnetProfile, WaPPPGroupProfile, WaPPPoEGroupParams, WaDDOSConfig, WaCapRepTCP, WaCapRepUDP, WaCapRepEth, WaContent, WaFormDatabase, WaHttpContent
•
Server (Wr) Enter one of the following types of server profiles: WrTestProfile, WrNetworkProfile, WrInterface, WrSubnet, WrStaticRouteTable, WrServerProfile, WrTransactionProfile, WrDefaultTransactionProfile, WrContent
•
The name to give the profile on the target device. This name is used to reference this profile from within other profiles.
•
One of the valid attributes for the corresponding profile type.
•
The value that the attribute will be assigned within the profile.
40 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
Client Test Configuration Array Parameters This section contains parameters to create and manipulate client Load, Network, Interface, Subnet, and User profiles. The following profiles and parameters are described in this section:
• • • • • • • • • • • • • • • • • • •
WaTestProfile WaLoadProfile WaNetworkProfile WaInterface WaSubnet WaUserProfile WaUrlList WaStaticRouteTable WaTelnetProfile WaPPPGroupProfile WaPPPoEGroupParams WaDDOSConfig WaCapRepTCP WaCapRepUDP WaContent WaFormDatabase WaHttpContent WaCookieJarList WaHostFile
Scripting API for the Layer 4-7 Application Reference Manual | 41
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
WaTestProfile Usage
Test profile entries for the client within the test configuration array.
Syntax
WaTestProfile,
Parameters
The input parameters and their values are described below:
•
Specifies one of the following: •
Description {}
Provide a description of the test. This description appears in the test results files. •
LoadProfile {}
Specify the name of the Load Profile to use within this test. Load profile parameters control the four test phases: ramp up, stepping, sustained and ramp down. These parameters also control performance thresholds (load constraints) and random error generation (burst mode) while testing. •
NetworkProfile {}
Specify the name of the Network Profile to use within this test. Network profile parameters enable special routing (gateway and subnet), DNS (round robin), and caching (proxy configuration) functionality, plus specify TCP parameters, such as maximum segment size (MSS), attempts (retries), and packet contents (piggyback GET request). •
Interface
Interface attributes within the Test Profile should adhere to the following syntax for a single-unit test (that is, one client-side appliance, one server-side appliance, or both): WaTestProfile,Interface,,
Note: See “Clustered Test Configuration Array Parameters” on page 177 for the syntax for Interface attributes within the Test profile for a clustered test. ◊
An integer value within the range 0 - 3, depending upon the total number of available interfaces on the appliance or Spirent TestCenter chassis. ◊
Specifies the parameter as one of the following values: o
Name {}
Specify the name of the Interface Profile to be associated with the interface you specified in . o
42 |
DDOSAttacks { }
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
If DDOS Attacks have been enabled on this interface, then use this parameter to specify which attacks to use. If the name of an attack is specified by itself, then default attack variables will be used (for example, Smurf). To incorporate a user-defined DDOS attack, simply specify the attack name, colon, and then attack profile name. (i.e. Smurf:smurf_User1). o
DDOSConfig
References a specific configuration file which houses the global DDOS Attack variables. o
DDOSEnabled yes | no
Disables or enables DDOS (Distributed Denial of Service) attacks on a specific interface. The default is no. o
PhysIf 0 | 1 | 2 | 3
Specify the physical port number associated with the current interface. The default value for the PhysIf attribute is simply the interface index of the interface. For example, the API assumes that you want interface 0 to correspond to PhysIf 0, interface 1 to correspond to PhysIf 1, and so on. o
PhysIfDisplayString
Specify a string to identify this physical interface (port) more easily in the results (.csv) file. You cannot use commas within this parameter. •
HttpPerformance on | off
Enables or disables HTTP performance. This option provides a higher performance HTTP transaction mode on a test-wide basis. A pre-built HTTP response, derived from the default transaction profile for the server, is used to achieve the higher performance. Specific performance/compatibility options are available under the HTTP or HTTPS server configuration. Enabling this option automatically configures HTTP 1.0 and disables KeepAlive and Persistence for all user profiles used by the test. The default is off. •
SslAcceleration on | off
Enables or disables hardware SSL acceleration on a test-wide basis. The default is off. •
SLBBinning on | off
Assists you in determining if the load balancing policy of the SLB (server load balancer) is working as expected. Enabling this option provides detailed granular information, such as statistics per server on a test-wide basis. The default is off. •
DetailedHSC on | off
Enables you to view the cumulative HTTP status codes received by the client during a test. The default is off. •
DDOSEnabled on | off
Enables or disables DDOS (Distributed Denial of Service) attacks on a test-wide basis. DDoS is enabled/disabled on a port basis. The default is off.
Scripting API for the Layer 4-7 Application Reference Manual | 43
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
•
SaveCookieJars on | off
Enables or disables cookie saving. When cookie saving is enabled, the client records all cookies transmitted during a test, enabling you to create Cookie Jar files automatically. Cookie Jar files must not exceed 64 megabytes. The default is off. •
PktTrace on | off Enables or disables the creation of a packet trace file. Enable this option if you want the client to produce a PCAP (packet capture) file in addition to its normal set of results files. The PCAP file (called trace.pcap) shows all packets sent and received, and it can be read by many standard sniffer programs, such as Ethereal, Netasyst (was Sniffer Pro), or ClearSight. The default is off.
•
PktTraceBytes The maximum size of the PCAP file in bytes. The maximum value that you can enter is 9,999,360 bytes, which is also the default.
•
UrlTrace on | off Enables or disables the creation of an XML trace file. Enable if you want an XML trace file for individual URLs, which contains errors, bindings of variables, response latency, and so on. One trace file is generated per simulated user, called httptracefile_X_trace.xml, where X is a number that represents the simulated user associated with the file. You can view this file by using the URL Trace Tool. The default is off.
•
UrlTraceOnError on | off Enable if you want only 4XX and 5XX HTTP error codes and content validation failures reported. The default is on.
•
UserLoadEnabled yes | no Enable for a user-based profile. Use this type of profile if you want multiple load curves, each of which describes the load for an individual user (client) profile. User-based load profiles are associated with a unique user (client) profile. The default is no.
•
Notes
You can enter general notes about your test. Notes attributes within the Test Profile should adhere to the following syntax: WaTestProfile,Notes,
Note: Tcl-sensitive characters are not permitted within any of the Notes parameters. ◊
Specifies the parameter as one of the following values: o
Technician
Enter the name or ID of the technician associated with this test.
44 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
o
Author
Specify the name or ID of the author associated with this test. o
DuTConfig
Enter information about the device under test (DUT) configuration associated with this test. o
RunName
Enter a descriptive name for the current test run. o
Comments
Enter any other comments associated with this test. •
RunTimeStatistics
Run-time statistics attributes within the Test Profile should adhere to the following syntax: WaTestProfile,RunTimeStatistics, ◊
Specifies the parameter as one of the following values: o
TimeInterval
Specify the interval that you want to use for sampling real-time statistics on the client. Values greater than 1000 are interpreted as being in seconds. Values less than 1000 are interpreted as being in milliseconds.
WaLoadProfile Usage
Use the client load profile parameters to configure the amount of network traffic the client will generate when you run your test. A test consists of a sequence of phases defined in a load profile. Client Load profile parameters control the four test phases: ramp up, stepping, sustained, and ramp down. These parameters also control performance thresholds (load constraints), and random error generation (burst mode) while testing.
Syntax Parameters
WaLoadProfile,,
The input parameters and their values are described below:
•
Specify the name for this Load Profile on the target device. This name is used to reference this profile from within other profiles.
•
Specifies one of the following: •
Description {}
Provide a description of the load profile. •
LoadSpecification
Scripting API for the Layer 4-7 Application Reference Manual | 45
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
Defines the units in which the load is measured as one of the following values: 0 = Bandwidth 1 = Connections 2 = Connections/second 3 = SimUsers 4 = SimUsers/second 5 = Transactions 6 = Transactions/second 7 = BodyBytes 10 = SimUsers/hour 11 = Connections/hour 12 = Transactions/hour Each value is described below: ◊
Bandwidth
Specifies the amount of data that can be transmitted in a fixed amount of time over all combined interfaces. Bandwidth is usually expressed in bits per second (Kbps). ◊
Connections
Defines the number of simultaneous network connections initiated from the client. This setting generates enough load to reach and sustain a target number of TCP connections. These TCP-based connections include protocols such as HTTP, FTP, and SMTP. Open TCP connections depend on user arrival rates (sessions/second), system efficiency, and user behavior, such as Think Time. Like Sessions, TCP connections are an effect, not a cause, so specifying the same number of TCP connections on different systems does not mean the traffic generated will be the same. An open connection does not necessarily have nonstop activity. This load type is the default value. Use caution when interpreting results using this criteria because a rapidly climbing number of open TCP connections usually means that the system is overloaded or exhibiting latency. Pay attention to the time it takes a TCP connection to complete, the time to SYN/ACK, and the number of successful versus failed transactions at a specified number of open TCP connections. ◊
ConnectionsPerSecond
This load type is often preferred by network equipment manufacturers for testing network devices. One TCP connection can contain up to hundreds of transactions, depending on client profile configuration and server response.
46 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
While the basic unit of load generated is Sessions (“Sessions” is the same as “SimUsers” in the Layer 4-7 Application, the client calculates this load type based on historical data. The client dynamically adjusts the rate of user arrival (as in SessionsPerSecond) to match the targeted ConnectionsPerSecond rate. When either ConnectionsPerSecond or ConnectionsPerHour is specified, the net load on a system is no longer affected by URL list length. ◊
Sessions
This load type generates enough load to reach and maintain a target number of concurrent simulated users. (“Sessions” in the TclAPI is equivalent to “SimUsers” in the Layer 4-7 Application). It allows you to determine the maximum number of concurrent users your device, infrastructure, or system can handle. Use this specification if you want to keep applying load even after the device under test fails. The amount of traffic generated depends on the performance of the device under test. As the system slows down due to overloading, generally each user takes longer to transverse through the URL list, and the load "throttles back" and generates fewer new users. ◊
SessionsPerSecond
Maintains a target number of concurrent simulated users per second or hour. Note that concurrent users does not always equate to active users. If you configure a Think Time, only a few users might be active, while others are in a think time with no network activity. (Same as “SimUsers per second” in the Layer 4-7 Application.) ◊
Transactions
Defines the number of simultaneous transaction generated. This specification generates and maintains enough load to reach an outstanding number of active HTTP transactions, or GETs-in-progress. For example, HTTP 1.1 with Persistence allows you to execute multiple transactions in a single connection. Each transaction equates to the request and transfer of one object, which for a website is call a hit. Under normal circumstances, all simultaneous transaction will be actively setting up a connection, transferring data, or tearing down the connection. Note: The Transactions load type applies to HTTP and HTTPS transactions only. For certain protocols, such as FTP, DNS, Streaming, POP3, SMTP, and so on, you should use the Sessions load type.
Scripting API for the Layer 4-7 Application Reference Manual | 47
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
Calibrating the load to generate a specific transaction/second while maintaining realistic traffic is a challenge. Since load is generated as new users arrive, existing users continue their transactions at non-uniform rates due to Think Time and multiple level-2 URLs (embedded objects). The resulting increase in transactions/second may not be smooth due to traffic bursts created by each individual user.However, this load type is useful for testing proxy servers. For example, browsers normally maintain several persistent connections to the proxy while executing multiple transactions on the same connection throughout the duration of a session. ◊
TransactionsPerSecond
Gradually ramps up the number of HTTP transactions per second for the duration of the test. TransactionsPerSecond might not equal ConnectionsPerSecond when using HTTP 1.1 with Persistence. ◊
BodyBytes
Generates HTTP requests that solicit HTTP response bodies of the specified length from the server and should be complemented with load constraints. The BodyBytes load type only applies when using an emulated server. ◊
SessionsPerHour
Maintains a target number of concurrent simulated users per hour. Note that concurrent users does not always equate to active users. If you configure a Think Time, only a few users might be active, while others are in a Think Time with no network activity. (Same as “SimUsers per hour” in the Layer 47 Application.) ◊
ConnectionsPerHour
This load type is often preferred by network equipment manufacturers for testing network devices. One TCP connection can contain up to hundreds of transactions, depending on client profile configuration and server response. While the basic unit of load generated is Sessions (“Sessions” is the same as SimUsers in the Layer 4-7 Application), the client calculates this load type based on historical data. The client dynamically adjusts the rate of user arrival (as in SessionsPerHour) to match the targeted ConnectionsPerHour rate. When either ConnectionsPerSecond or ConnectionsPerHour is specified, the net load on a system is no longer affected by URL list length. ◊
TransactionsPerHour
Gradually ramps up the number of HTTP transactions per hour for the duration of the test. TransactionsPerHour might not equal ConnectionsPerHour when using HTTP 1.1 with Persistence. Note: The TransactionsPerSecond and TransactionsPerHour load types apply to HTTP and HTTPS transactions only. For certain protocols, such as FTP, DNS, Streaming, POP3, SMTP, and so on, you should use the SessionsPerSecond or SessionsPerHour load types.
48 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
•
RandomizerSeedMode on | off
Enables or disables RandomizerSeedMode. Enable this mode and enter a number in the RandomizerSeed parameter to define the heights in the random phases of the test. If this parameter is disabled or the value is 0, the seed is determined by the time the test is executed. The last repetition of a random pattern is always the same value as when the pattern started (the load height ends at the same height it began). If a single repetition is selected, the load graph on the statistics window will not display a random value. The default is off. •
RandomizerSeed
Defines the heights in the random phases of the test. The default is 1. •
Load Profile Steps Parameter
Steps parameter entries within the LoadProfile should adhere to the following syntax: WaLoadProfile,,Steps, ◊
Specifies the parameter as one of the following values: o
DefaultTimeScale Milliseconds|Seconds|Minutes|Hours
Specify the default time scale unit for each step. Each step can override this value by specifying its own time scale. The default is Seconds. o
Step
Step parameter entries within the LoadProfile should adhere to the following syntax: WaLoadProfile,,Steps,Step,, ∇
Label {label} - Enter a name to identify the step you are defining. This label must be an alphanumeric string.
∇
Pattern Flat | Stair | Burst | Sinusoid | Random - The shape of the load curve. The default is Flat.
∇
TimeScale Default | Milliseconds | Seconds | Minutes | Hours - Specify the unit of time for the selected step’s
load generation. If you want to experiment with a test of short duration, specify Default which uses the value of the default time scale. After you perfect the test, change the time scale to a different unit of time and scale the duration of your test. ∇
Num - If you are using a stair, burst, sinusoid, or random pattern, enter the number of times that you want the pattern to repeat. While it is possible to set up to 100 repetitions, the system performs best if you limit your values between 1 and 10. The actual load generation while running the test will not be adversely affected. The default is 1.
Scripting API for the Layer 4-7 Application Reference Manual | 49
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
∇
Height - Height of the load curve measured in units specified via LoadSpecification. Enter the total amount of load
related to the load specification type (for example, Connections) that the client achieves. To keep the client from overwhelming your network, start small and increase these parameters proportionately. There is no minimum height requirement, but the upper limit must not exceed 10,000,000. ∇
RampTime - Amount of time each step takes to reach
the load type (sessions, connections, and so on) applied to height, in seconds. Once that load level is reached, Step Steady Time begins. There is no minimum limitation, but the upper limit must not exceed 40,000,000. If you are using a Sinusoid pattern, setting RampTime to 1 will result in a smoother waveform. For example, if the ramp up time is 20 seconds, and the load (height) is 30, the client adds load so 30 units of load occur by the end of 20 seconds. If you increase the number of connections to 100, you should also increase the ramp time to 80 seconds. When using a Sinusoid pattern, use the period to describe the period of the sinusoid; the amount of time (or frequency) the waveform takes to complete one cycle. The Ramp phase is especially useful if you already know the relative performance threshold of a system. For example, to test a firewall, you can design a test that ramps up quickly to 2500 connections a second (conns/sec), then steps 50 conns/sec for 10 seconds to pinpoint the threshold.
50 |
∇
SteadyTime - Amount of time to hold the load at the height (that is, the amount of time the step takes). Larger Step Heights should have equally increased step steady times. If the step time is longer than it takes for the load to reach the unit count related to the load specification type, the client decreases load generation to keep the outstanding load at a steady state equal to that of the desired session count. There is no minimum limitation, but the upper limit must not exceed 40,000,000. If you use a Sinusoid pattern, set the Steady Time to 1 to achieve a smooth or waveform.
∇
Period - For Sinusoid pattern only. Enter the amount of time the client takes to gradually achieve the total load designated in the Height parameter. Ramp time allows self-tuning communications to balance the load at the start of a test run. There is no minimum limitation, but the upper limit must not exceed 1,000.
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
•
Load Profile LoadConstraints Parameter
Use Load constraints to control performance thresholds. Constraints are useful if you already know the performance limits of a system. For example, if a firewall can support up to 16,384 connections, but you want to identify its maximum error-free connection rate for 10k files, you would use ConnectionsPerSecond as the load specification and set MaxOpenConnections to 16384. A disabled constraint means there is no limit to the constraint. A zero (0) means no load. Load constraint parameter entries within the LoadProfile should adhere to the following syntax: WaLoadProfile,,LoadConstraints, ◊
Specifies the parameter as one of the following values: o
MaxBandwidth
Controls the upper limit for the incoming bandwidth that occurs throughout the test. If the maximum is exceeded, no more Sessions are generated until the incoming bandwidth falls below this value. The default is empty. o
MaxBorn
Controls the upper limit for the total number of Sessions created during a test. o
MaxBirthrate
Controls the upper limit for the number of Sessions created in any second throughout the test. o
MaxLiving
Controls the upper limit for the number of concurrently running Sessions. o
MaxConnectionsAttempts
Controls the upper limit for the number of connection attempts that are made throughout the test. o
MaxNewConnectionsPerSecond
Controls the upper limit for the number of open connections created in any second throughout the test. o
MaxOpenConnections
Controls the upper limit for the number of open connections. The default is 100. o
MaxConnectionsErrorsPercent
Controls the upper limit for the percentage of connection errors that occur during any second throughout the test. o
MaxTransactionAttempts
Controls the upper limit for the number of transaction attempts that are made throughout the test.
Scripting API for the Layer 4-7 Application Reference Manual | 51
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
o
MaxNewTransactionsPerSecond
Controls the upper limit for the number of transactions that are requested at any second throughout the test. o
MaxTransactionsErrorsPercent
Controls the upper limit for the percentage of errors that occur during any second throughout the test.
WaNetworkProfile Usage
The client network profile describes the DNS, Proxy, and TCP characteristics of your network. Use the network profile parameters to configure the network characteristics that you want to emulate. Client Network profile parameters enable special routing (gateway and subnet), DNS (round robin) and caching (proxy configuration) functionality, plus specify TCP parameters, such as maximum segment size (MSS), attempts (retries), and packet contents (piggyback GET request). These entries are equivalent to setting parameters in the Client Network tab of the Layer 47 Application.
Syntax
Parameters
WaNetworkProfile,,
The input parameters and their values are described below:
•
Specifies the name for this Network Profile on the target device. This name is used to reference this profile from within other profiles.
•
Specifies one of the following: •
Description {}
Provide a description of the network profile. •
RoundRobinDNS on | off
Enable or disable Round Robin DNS. Enabling this option prompts the client to resolve domain names in the URL lists for every simulated user request. If the URL list used contains hostnames (fully qualified domain names) instead of IP addresses, the client normally queries the DNS server and caches the result for future transactions. The default is off.
52 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
•
FairnessThreshold
Specifies the throughput (fairness) threshold per connection that you expect when testing a DUT/SUT (device/system under test) that performs bandwidth management, traffic shaping, or QoS guarantee. You specify the fairness threshold per connection in bytes/second. All data sent and received inside a particular connection is recorded. The rate for every connection is calculated as follows: (bytes sent + bytes received) / connection lifetime This calculation is based on TCP bandwidth, that is, the TCP data minus any Ethernet, IP, or TCP headers. The result determines if a connection is below or above the specified threshold. For example, if a DUT is configured to prevent a connection from exceeding 2048 bytes/second, you would specify a fairness threshold of 2048. The number of connections that exceeded this throughput threshold would appear in the client realtime statistics. The default is 2147483647. •
Proxy,
The Proxy Client allows you to run Tcl API tests via a proxy server. (This option applies only to HTTP.) When using this option, the URL list must explicitly contain the protocol used (that is, http://). For example, an HTTP URL list entry would be 1 http://1.2.3.4/abc.html, not just 1 1.2.3.4/abc.html. Proxy attributes within the Network Profile should adhere to the following syntax: WaNetworkProfile,,Proxy, ◊
Specifies the parameter as one of the following values: o
MaxTxnPerProxyConnection
Specifies the maximum transactions per connection, before the client closes the TCP connection with the proxy, regardless of whether the destination URL is from the same server. The default is 100. o
ProxyConnectionPersistence on | off
Enables or disables persistent connections. If enabled, multiple requests can use the same connection to the proxy. The default is on. o
MaxProxyConnections
Specifies the maximum number of connections per client allowed in a session. A browser such as IE 5.X can make up to 50 persistent connections to a proxy. During any test, the number of sessions can reach the maximum Step Height value. The default is empty.
Scripting API for the Layer 4-7 Application Reference Manual | 53
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
o
ProxyServerAddress
Specifies the proxy server address to which to send requests. When designating the proxy server, make sure that the proxy server can access the client’s test interfaces as if it were a server. The default is an empty string. o
ProxyServerPort
Specifies the proxy server port. o
ProxyConnectionHeader on | off
Enable or disable the proxy connection header. Enabling this header ensures that the proxy server being tested knows that a client explicitly uses a proxy server. The default is off. o
ProxyClientMode on | off
Enable or disable the proxy client mode. Enabling this mode allows the client to make requests to a server via a proxy. This means that HTTP requests must be fully qualified so that the proxy, upon receiving a request, can make the request on behalf of the client. The client, in this case, is Avalanche. The default is off. •
TCPOptions,
TCPOptions attributes within the Network Profile should adhere to the following syntax: WaNetworkProfile,,TCPOptions, ◊
Specifies the parameter as one of the following values: o
RandomizePort on | off
Enable this option if you want to randomly select client TCP ports. If you do not enable this option, the client selects ports sequentially. This option applies only if you have more than one URL in your URL list and the Enable Persistence option is not enabled. The default is off. o
TCPMaxSegSize
Directs the targeted server to send TCP segments not exceeding the specified maximum segment size (MSS). The MSS will be declared initially in the TCP options field in the SYN packet for each connection. This is especially useful for the emulation of clients on specific IP stacks or PPP links. The default value is 1460, which is also the maximum value you can specify. You can enter a value between 128 and 1560.
54 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
o
TCPReceiveWindowSize
Specifies the receive window in which you want the TCP stack to send TCP segments. The receive window informs the peer how many bytes of data the stack is currently able to receive. The supplied value is used in all segments sent by the stack. The number you enter can range from 0 to 1073741823. The default is 32768. o
TCPDelayedAcks on | off
Enable this option to cause the TCP stack to implement the Delayed ACK strategy, which attempts to minimize the transmission of zero-payload ACK packets. The default is on. Acknowledgements will be deferred in the hopes of piggybacking them on top of valid data packets. If successfully deferred, these acknowledgements are free, in the sense that they consume no additional bandwidth. o
TCPDelayedAckTimeout
If Delayed Acks is enabled, this timeout value specifies the maximum time the TCP stack will wait to defer ACK transmission. If this timer expires, the stack will transmit a zero-payload acknowledgement. The default is 200. o
TCPDelayedAckBytes
Enter the number of bytes of data, after the receipt of which, you want the TCP stack to send an ACK packet. This parameter is only used if TCPDelayedAcks is enabled. The default is 2920. o
TCPCongestionControl on | off
Enable this option to invoke the TCP stack's congestion control mechanism. If checked, the TCP stack implements Slow Start and Congestion Avoidance, according to RFC 2581. The default is on. o
TCPTimeout
Enter a TCP Timeout value in milliseconds which will override the internally calculated TCP stack timeout value. The TCP stack calculates the retransmission timeout value internally. This calculation can be overridden by enabling TCPTimeoutOverride and supplying a timeout value. This value is used for the first transmission of a particular data or control packet; it is doubled for each subsequent retransmission. The default is 2000 milliseconds. o
TCPTimeoutOverride on | off
Enable or disable the TCP Timeout override. If enabled, the manual timeout specified in TCPTimeout is used. The default is off.
Scripting API for the Layer 4-7 Application Reference Manual | 55
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
o
TCPRetries
Specify the number of times a timed-out packet should be retransmitted before aborting further retransmission. If the client gets no response after the configured number of retries have been attempted, the error is logged in the results.CSV file as a TCP timeout when a SYN is sent and no SYN/ACK from the server is received. The default is 2. o
TCPInactivityTimeout
Connections inactive for this length of time are reset (the stack sends an RST segment) and abandoned. A value of 0 disables the timer. This timer must be disabled for each streaming test. The default is 0. o
TCPPiggybackGet on | off
Enable or disable piggybacking the HTTP GET request to cause the stack not to send an ACK packet after receiving a SYN/ACK and before sending the connection's first data packet (available only for HTTP). The default is off. The default behavior for a TCP handshake from the client is as follows: SYN -> <-SYN/ACK ACK with GET -> o
IP6MaxSegSize
Enter the maximum Internet Protocol Version 6 (IPv6) segment size (in bytes) you want the TCP stack to receive. Enter a value between 148 and 1440. The default is 1440. •
IpReassemblyTimeout
Specify the fragment reassembly timer in milliseconds. Enter the maximum time in milliseconds that the IP stack should wait for subsequent fragments after receiving the first fragment of an IP datagram. If the entire datagram has not been received by this time, the entire datagram is discarded. The default is 30,000.
WaInterface Usage
The interface profile describes each interface port on the client. For each interface port on the client, assign an interface profile to that port. Client Interface parameters enable gratuitous ARP, enable virtual routing, specify router IP address/netmask bits, enable DDOS attacks, and specify the port number. Note: Do not use both a subnet and virtual router to configure routing for the same test. If you do, in most cases, the virtual router will take precedence. These entries are equivalent to setting parameters in the Client Ports tab of the Layer 4-7 Application.
56 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
Syntax
Parameters
WaInterface,,
The input parameters and their values are described below:
•
Specifies the name for this Interface Profile on the target device. This name is used to reference this profile from within other profiles.
•
Specifies one of the following: •
Description {}
Provide a description of the interface profile. •
GratuitousARP on | off
Enable or disable ARP (Address Resolution Protocol). Enable this feature to broadcast an ARP (Address Resolution Protocol) request with the port’s IP address at the beginning of each test. This ensures that a device connected to the port has the correct ARP cache data. The default is on. •
Subnets { }
Specify the subnet profile name(s) of the current subnet(s). •
Router
Router attributes within the Interface Profile should adhere to the following syntax: WaInterface,,Router, ◊
Specifies the parameter as one of the following values: o
IpAddress
The outbound address of the router emulated by the interface. Use CIDR notation, that is, specify the address in dotted decimal notation. o
NetmaskBits
The number of bits in the specified network that comprise the network part of the address. o
StaticRouteTable
Specify the name of the XML file containing the static routing table. Use the WaStaticRouteTable parameter to populate the route table. o
Enabled on | off
Enable or disable this router profile. The default is off. Note: You can enable only one router profile definition (via the Router or RouterSet parameter) at any one time. If you enable more than one router profile definition, all profiles will default to “off.”
Scripting API for the Layer 4-7 Application Reference Manual | 57
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
•
FlatSubnet
Use the FlatSubnet option to configure a "flat" subnet (that is, one single subnet that you can use for multiple ports). When you generate a flat subnet, you assign the subnets IPs to each port so that they do not overlap. You can define the beginning IP (the offset value), count (the total number of IPs in the range to use), and the increment (the next IP in the range to use). Interface profile FlatSubnet attributes within the test configuration array should adhere to the following syntax: WaInterface,,FlatSubnet,, ◊
Iterates with each new flat subnet definition from 0 onwards. ◊
Specifies the parameter as one of the following values: o
Name
Enter the baseline subnet profile name from which this flat subnet is derived. o
Offset
Enter the offset value. The offset value determines the beginning IP address in the range of hosts for the associated subnet. For example, if the range is 192.168.1.1-192.168.12, and the offset is 1, then the first IP used to send traffic is 192.168.1.2. The default is 0. The offset value must be compatible with the IP range in the named profile and the and values specified. o
Count
Enter the total number of hosts in the range to use. For example, if the starting IP is 10.10.10.1 and the ending IP is 10.10.10.10, the count could be 10 to use all of the IPs. The default is 254. The value you specify must be compatible with the and values specified. o
Increment
Enter the increment value. The increment value that determines the next IP in the range to use. For example, if the beginning IP is 10.10.10.1 and the increment is 2, the next IP used is 10.10.101.3. The default is 1. User profile FlatSubnet attributes within the test configuration array should adhere to the following syntax: WaInterface,,FlatSubnet,,UserProfile,, ◊
Iterates with each new flat subnet user profile association from 0 onwards.
58 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
◊
Specifies the parameter as one of the following values: o
Name
Enter the user profile name to associate with the current flat subnet. o
Percentage
Specify the percentage load that this particular user profile will generate (from 0 - 100%). •
RouterSet
Use the RouterSet option to configure a router for this subnet. Interface profile RouterSet attributes within the test configuration array should adhere to the following syntax: WaInterface,,RouterSet,, ◊
Iterates with each new router definition from 0 onwards. ◊
Specifies the parameter as one of the following values: o
IpAddress X.X.X.X
Specify a virtual router IP address. o
NetmaskBits
Specify the virtual router’s netmask. o
StaticRouteTable
Specify the name of the XML file containing the static routing table. Use WrStaticRouteTable to populate the static routing table. o
InsertVlanTag on | off
Enable or disable VLAN tagging. The default is off. o
VlanId
Specify a VLAN ID to include when InsertVlanTag is enabled. The default is 1. o
Enabled on | off
Enable or disable this router profile. The default is off. Note: You can enable only one router profile definition (via the Router or RouterSet parameter) at any one time. If you enable more than one router profile definition, all profiles will default to “off.” Interface profile RouterSet MacMasquerade attributes within the test configuration array should adhere to the following syntax: WaInterface,,RouterSet,,MacMasquerade,
Scripting API for the Layer 4-7 Application Reference Manual | 59
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
◊
Iterates with each new router definition from 0 onwards. ◊
Specifies the parameter as one of the following values: o
Enabled on | off
Enable or disable MAC masquerading. The default is off. o
Mac0 <00-FF>
Specify the first MAC address byte. The default is 00. o
Mac1 <00-FF>
Specify the second MAC address byte. The default is 00.
WaSubnet Usage
Use the Subnet parameters to configure subnet configuration profiles. Client Subnet parameters enable you to define static routing, IP fragmentation, realism, PPP/PPPoE, and IPSec for one or more subnet profiles, plus subnet and netmask details. These entries are equivalent to setting parameters in the Client Subnets tab of the Layer 47 Application. Tip: You can also use a virtual router to configure routing. However, do not use both a subnet and virtual router to configure routing for the same test. If you do, in most cases, the virtual router will take precedence.
Syntax Parameters
WaSubnet,,
The input parameters and their values are described below:
•
Specify the name for this subnet profile on the target device. This profile name is used to reference this profile from within other profiles and uniquely identifies the subnet configuration.
•
Specify one of the following: •
Description {}
Write a short sentence describing the subnet configuration profile. •
IpVersion 4 | 6
Enter either 4 for IPv4 or 6 for IPv6 based on the IP version of the gateways. •
Network
(IPv4 only.) Enter the network address of your subnet, using CIDR notation (dotted decimal).
60 |
Scripting API for the Layer 4-7 Application Reference Manual
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
•
NetmaskBits
(IPv4 only.) Enter the number of bits in the network part of the address. For example, 24 represents 255.255.255.0, while16 represents 255.255.0.0. The default is 24. •
IpAddressRange
(IPv4 only.) Subnet profile IpAddressRange attributes within the test configuration array should adhere to the following syntax: WaSubnet,,IpAddressRange, ◊
IpAddressRange
Enter an IP address or a range of IP addresses from which you want to generate traffic for your test ports. Use CIDR notation (dotted decimal). Alternatively, leave this parameter blank to use all addresses that could exist on the network that you specify in the Network and NetmaskBits parameters. Note: The appliance uses only the address or addresses that you specify to emulate clients. However, all addresses in the subnet are assigned to the parent interface for packet routing purposes. Therefore, do not assign the same addresses to more than one interface. For example, the ranges 192.168.1.1-192.168.1.10 and 192.168.1.11-192.168.1.20 do not overlap, but subnets 192.168.1.1-192.168.1.10/ 24 and 192.168.1.11-192.168.1.20/24 actually belong to the same subnet because of the netmask bits, and are therefore bound to the same interface. •
SendSide
Subnet profile SendSide attributes within the test configuration array should adhere to the following syntax: WaSubnet,,SendSide, < SendSide Parameter> ◊
ConnectionNoise
The percentage of desired packets lost per million packets sent. This entry emulates noisy network traffic by deliberately dropping a certain number of packets at random. Enter the percentage packet loss multiplied by 1000 on the link. For example, 50% packet loss equates to a ConnectionNoise value of 50000. The default is 0. ◊
ConnectionSpeed
Enter the bits per second (bps) or link speed that a simulated user will use to connect to a network. The default is 0. ◊
NPacketsToDrop
Enter the number of packets to drop. When a packet must be dropped, the number of successive packets dropped is decreased by one. Any succeeding packets for that same subnet will be dropped, until the packets dropped value in the subnet becomes zero. Once this value is zero, the cycle repeats. The default is 0.
Scripting API for the Layer 4-7 Application Reference Manual | 61
Chapter 3: Test Configuration Array Client Test Configuration Array Parameters
◊
EndToEndDelay
Enter the delay in milliseconds that emulates the distance of the subnets involved. The default is 0. To this delay, you can also specify a delay variation method (see DelayVarianceMethod) that emulates the queuing and processing delay at intermediate hops in the internet/network. The sum processing of these two delays is the total delay used per packet. You configure these delays on a per subnet basis for outgoing and incoming traffic separately (that is, Receive Side and Send Side of the interface). ◊
DelayVarianceMethod 0 | 1 | 2
Specify the method used to determine the delay variance. Possible values are 0, 1, or 2: 0 is equivalent to none (no delay variation is applied), 1 is equivalent to uniform distribution (a uniform distribution has the same probability for all the members of the population), and 2 is equivalent to normal distribution, frequently referred to as a Bell Curve, which has a concentration of members around the middle and less on the tails of the curve. The default is 0. ◊
DelayVarianceVal1
If you specified 1 or 2 for the DelayVarianceMethod, then this parameter specifies the start of the delay variances. The default is 0. ◊
DelayVarianceVal2
If you specified 1 or 2 for the DelayVarianceMethod, then this parameter specifies the end of the delay variances. The default is 0. •
RecvSide
Subnet profile RecvSide attributes within the test configuration array should adhere to the following syntax: WaSubnet,,RecvSide,