Added Deep Packet Capture (see Section 8.1.3) Added Packet/Second Transmit Rate (Section 9.3.2) Added Multi-Burst Transmit Mode (Section 9.3.2) apgLoadStream command modified (Section 9.1.1) Visit www.axtrinet.com/documentation for the latest documentation. Document Conventions INFORMATION: Additional information to clarify functionality or usability...
Page 3
Axtrinet does not warrant that the software will in every case process all data correctly, or that operation of the products, including software, will be uninterrupted, free from error, or secure.
Ethernet Packet Generator TCL API GUIDE Preface About This Document This manual describes the structure and commands of the Axtrinet TCL API, and contains the following sections: Section Description 1. INTRODUCTION Summary of the TCL API interface and capabilities 2. INSTALLATION Installation procedures for the Microsoft™...
Page 5
Ethernet Packet Generator TCL API GUIDE Glossary Axtrinet Packet Generator Application Programming Interface Frame Checksum Inter-Burst Gap Inter-Frame Gap Packets per Second QSFP+ Quad Small Form-Factor Pluggable (40Gbps) Revolutions per Minute Start-of-Frame Delimiter Small Form-Factor Pluggable (1Gbps) SFP+ Small Form-Factor Pluggable (10Gbps)
Page 6
Ethernet Packet Generator TCL API GUIDE Contents INTRODUCTION ....................9 Main Features ....................9 Benefits ......................9 Trademarks ....................9 Software Licences and Support..............10 Contact Details ..................... 10 INSTALLATION ..................... 11 Minimum System Requirements ..............11 Prerequisites ....................11 Testing the Installation ................
Page 7
Ethernet Packet Generator TCL API GUIDE 7.1.5 apgLoadUnit [UNITID] RATES {DURATION} ............26 Get Unit Data - apgGetUnit ................27 7.2.1 apgGetUnit [UNITID] INFO [VAR] ............... 27 7.2.2 apgGetUnit [UNITID] STATUS [VAR] ..............28 PORT COMMANDS ..................29 Load Port Data - apgLoadPort ............... 31 8.1.1 apgLoadPort [PORTID] INFO ................
TCL API for third party scripting. Ideally suited to applications in R&D, Test and Manufacturing environments, and 'on the road' with Field Sales and Application Engineers, the Axtrinet APG Ethernet Packet Generators allow reliable and affordable development and testing of: ...
Page 10
See the Axtrinet APG Software License Terms & Conditions [4] Email based software support is included in the purchase price for the first 12 months after delivery. Extended Software Support is available for purchase; please contact Axtrinet or your reseller for more information.
% tclsh test.tcl APG TCL API V1.0.0 Build Date 1496403379 Target API Version 161016 The Axtrinet TCL API has been successfully installed if test.tcl completes without errors, and displays the API version, build data and target API version. 2.3.2 Linux Environment The Axtrinet TCL package is installed in /usr/share/axtrinet/apg/ To test the installation, run "test.tcl"...
Example files are provided in the demo directory that can be run within your TCL environment: demo_init.tcl Initialise Axtrinet APG API Package demo_connection.tcl Open and Close connections to the Axtrinet APG demo_save_recall.tcl Save and load port and stream configuration demo_unit_commands.tcl Load and display unit information demo_port_commands.tcl...
Page 13
WAN. All accessible units can be managed through the same Control Interface or TCL scripting interface. The APG TCL API and the APG Control Interface share the same API to the Axtrinet Packet Generator: User TCL...
TCL API GUIDE EFINITIONS UNIT A unit is a single physical Axtrinet Packet Generator (APG4, APG8, APG200 or APG208). A unit is assigned a UNITID when the management connection is first opened using the APG TCL API. The UNITID is fixed for the duration of the TCL session, and is used to uniquely identify a unit during the session.
TCL API GUIDE APG C ONFIGURATION The 'master' unit, port and stream configurations are stored on the Axtrinet™ APG unit. The TCL API uses a 'local' database to store the current and modified configurations, before being applied into the unit.
Page 16
Ethernet Packet Generator TCL API GUIDE RANSMIT ONFIGURATION Each port contains a transmit engine that comprises: 8 parallel independent configurable Ethernet stream generators Stream multiplexer Transmit port configuration and status Module configuration and status STREAM 0 Enable Rate STREAM 1...
Page 17
Ethernet Packet Generator TCL API GUIDE The stream transmit mode can be set using apgSetStream CONFIG, and defines how the packets are generated: either Continuously; as a Single Burst of TX_BURST_SIZE packets; or a Multiple Burst of TX_BURST_SIZE packets, repeated TX_BURST_COUNT times, separated TX_IBG.
Ethernet Packet Generator TCL API GUIDE The optional "Timestamp Fields" incorporating the timestamp ID, Sequence Number and Timestamp are enabled on a "per stream" basis using the apgSetStream PAYLOAD TS_ENABLE command, and processed using the apgLoadPort ANALYSIS and apgGetPort ANALYSIS commands.
Ethernet Packet Generator TCL API GUIDE ACKET APTURE A 16KB capture buffer is available per port, that can be enabled using the apgControlPort PORTCAPTURE command. The contents of the capture buffer can be downloaded from the unit with apgLoadPort CAPTURE, and read with apgGetPort CAPTURE PACKET.
Ethernet Packet Generator TCL API GUIDE 4. API I NITIALISATION The Axtrinet APG TCL API is initialised by sourcing the axtrinetApi.tcl file that contains: Path to the APG TCL API "package require" declaration Import APG TCL API Commands ...
# Close connection apgClose $UNITID → 1 ONNECTION 5.1.1 apgOpen [IP-ADDRESS] Opens a connection to the Axtrinet Packet Generator at [IP-ADDRESS]. If the connection is successfully opened, apgOpen polls apgLoadUnit STATUS to determine the hardware status until the unit is READY (apgLoadUnit STATUS READY = 1).
Configuration apgSaveConfiguration [UNITID] [PORTLIST] {FILENAME} apgApplyConfiguration [UNITID] [FILENAME] # Instantiate APG TCL API (Windows) source "C:/Program Files/Axtrinet/APG/axtrinetApi.tcl" ← Load API # Open connection to unit at IP address 192.168.1.100 Open Connection # Returns integer Unit ID → UNITID = 1 set IPADDRESS 192.168.1.100...
Ethernet Packet Generator TCL API GUIDE PPLY ONFIGURATION 6.2.1 apgApplyConfiguration [UNITID] [FILENAME] Applies the stored configuration file FILENAME to unit UNITID. File FILENAME is first scanned for suitability, verifying that the API_VERSION and PRODUCT type match. If there is an API_VERSION mismatch, the commands may not apply. If there is a PRODUCT mismatch, ports and stream configurations may not apply to the unit UNITID.
Page 24
[UNITID] PORTSTATUS apgLoadUnit [UNITID] COUNTERS apgLoadUnit [UNITID] RATES apgGetUnit apgGetUnit [UNITID] INFO [VAR] apgGetUnit [UNITID] STATUS [VAR] # Instantiate APG TCL API (Windows) source "C:/Program Files/Axtrinet/APG/axtrinetApi.tcl" ← Load API # Open Connection set IPADDRESS 192.168.1.100 set UNITID [apgOpen $IPADDRESS]...
Ethernet Packet Generator TCL API GUIDE apgOpen / apgClose apgLoadUnit apgGetUnit LOCAL ‘UNIT’ DATABASE Load the UNIT configuration and status from the hardware into the local database. apgLoadUnit returns 1 if successful, otherwise the command will display an error message and exit the TCL environment.
Ethernet Packet Generator TCL API GUIDE 7.1.4 apgLoadUnit [UNITID] COUNTERS Loads the transmit and receive counters for all ports in the unit into the local database, containing: Time that the counter is read Number of Bytes Number of Good Packets ...
Ethernet Packet Generator TCL API GUIDE apgOpen / apgClose apgLoadUnit apgGetUnit LOCAL ‘UNIT’ DATABASE Get (read) the UNIT configuration and status from the local database. apgGetUnit returns the variable value if successful, otherwise the command will display an error message and exit the TCL environment. 7.2.1 apgGetUnit [UNITID] INFO [VAR] The APG unit information can be read with the...
Ethernet Packet Generator TCL API GUIDE 7.2.2 apgGetUnit [UNITID] STATUS [VAR] The APG unit status can be read with the apgGetUnit STATUS command. apgGetUnit STATUS command must be preceded by at least one apgLoadUnit STATUS, otherwise the command will display an error message and exit the TCL environment. The unit STATUS is dynamic, and should be re-loaded before reading.
[PORTID] [VAR] [VAL] apgApplyPort apgApplyPort [PORTID] apgControlPort apgControlPort [COMMAND] [PORTLIST] apgControlPort [CAPTURE] [PORTLIST] Where PORTID = {UNIT.PORT} or {UNIT.PORT.SUBPORT} # Instantiate APG TCL API (Windows) source "C:/Program Files/Axtrinet/APG/axtrinetApi.tcl" ← Load API # Open Connection Open set IPADDRESS $::DutIpAddress Connection set UNITID [apgOpen $IPADDRESS] set PORTLIST ""...
Page 30
Ethernet Packet Generator TCL API GUIDE for { set ST 0 } { $ST < 8 } { incr ST } { set STREAMID [linsert $PORTID end $ST] if { $ST == 0 } { Stream 0 apgSetStream $STREAMID DEFAULT apgSetStream $STREAMID CONFIG ENABLE 1 Enable apgSetStream $STREAMID CONFIG SIZE_MODE RANDOM...
Ethernet Packet Generator TCL API GUIDE apgGetPort apgLoadPort LOCAL ‘PORT’ DATABASE apgApplyPort apgSetPort Loads the PORT configuration and status from the hardware into the local database. apgLoadPort returns 1 if successful, otherwise the command will display an error message and exit the TCL environment. 8.1.1 apgLoadPort [PORTID] INFO Loads the port information into the local database, containing:...
Ethernet Packet Generator TCL API GUIDE 8.1.4 apgLoadPort [PORTID] ANALYSIS {TSID} The port analysis calculations are performed when apgLoadPort ANALYSIS is called. The analysis calculations are performed on captured data. The apgLoadPort CAPTURE BUFFER command enables capture on the port, and captures until the capture buffer is full. The captured data is then downloaded and processed automatically.
Page 33
Ethernet Packet Generator TCL API GUIDE [VAR] LENGTH DESCRIPTION TOPOLOGY_CAP 16 bits Port topology capabilities: Bit 0-7 = Reserved Bit 8 = Blocked (0x0100) Bit 9 = 1Gbps (0x0200) Bit 10 = Reserved Bit 11 = 10Gbps (0x0800) Bit 12 = 4x10Gbps (0x1000) Bit 13 = 40Gbps (0x2000) Bit 14-15 = Reserved NSUBPORTS...
Ethernet Packet Generator TCL API GUIDE 8.2.2 apgGetPort [PORTID] STATUS [VAR] The port status can be read using the apgGetPort STATUS command. apgGetPort STATUS must always be preceded by at least one apgLoadUnit PORTSTATUS, otherwise the command will display an error message and exit the TCL environment.
Ethernet Packet Generator TCL API GUIDE [VAR] LENGTH DESCRIPTION LINKMODE 8 bits Current MAC-to-Module PMA Link Mode: Bit 0 = 1000Base-X (SFP+ Port only) Bit 1 = SGMII (SFP+ Port only) Bits 3-4 = Reserved Bit 5 = SRLR (QSFP+ only) Note that the unit software will automatically choose the preferred link mode based on the transceiver, but can be over-written by the user.
COUNTERS, otherwise the command will display an error message and exit the TCL environment. # Instantiate APG TCL API (Windows) source "C:/Program Files/Axtrinet/APG/axtrinetApi.tcl" # Open Connection Open set IPADDRESS 192.168.1.100 Connection...
Ethernet Packet Generator TCL API GUIDE 8.2.5 apgGetPort [PORTID] RXSTATS [VAR] The receive counters are read with the apgGetPort RXSTATS command. apgGetPort RXSTATS must always be preceded by at least one apgLoadUnit COUNTERS, otherwise the command will display an error message and exit the TCL environment.
Ethernet Packet Generator TCL API GUIDE 8.2.6 apgGetPort [PORTID] RATES [VAR] The transmit and receive data rates are read with the apgGetPort RATES command. apgGetPort RATES must always be preceded by at least one apgLoadUnit RATES, otherwise the command will display an error message and exit the TCL environment. apgGetPort RATES will change during a test, and should always be preceded by a apgLoadUnit RATES...
CAPTURE CONFIG, otherwise the command will display an error message and exit the TCL environment. # Instantiate APG TCL API (Windows) source "C:/Program Files/Axtrinet/APG/axtrinetApi.tcl" # Open Connection Open set IPADDRESS 192.168.1.100 Connection set UNITID...
Ethernet Packet Generator TCL API GUIDE 8.2.8 apgGetPort [PORTID] CAPTURE PACKET TOTALPACKETS TOTALPACKETS (32 bits) is the total number of packets held in the capture buffer. The capture configuration is loaded with apgLoadPort [PORTID] CAPTURE BUFFER. 8.2.9 apgGetPort [PORTID] CAPTURE PACKET [VAR] [PKTNUM] Read the capture packet data, where [PKTNUM] is the packet number in the capture buffer in the range 1 to [TOTALPACKETS].
Ethernet Packet Generator TCL API GUIDE 8.2.10 apgGetPort [PORTID] ANALYSIS [TYPE] [VAR] The latency measurements are read with the apgGetPort ANALYSIS command. apgGetPort ANALYSIS must always be preceded by at least one apgLoadPort ANALYSIS, otherwise the command will display an error message and exit the TCL environment. If the measurements are not re-calculated, apgGetPort ANALYSIS will return the previous...
Ethernet Packet Generator TCL API GUIDE ONFIGURATION apgGetPort apgLoadPort LOCAL ‘PORT’ DATABASE apgApplyPort apgSetPort apgSetPort returns the set value if successful, otherwise the command will display an error message and exit the TCL environment. 8.3.1 apgSetPort [PORTID] [VAR] [VAL] apgSetPort command allows configuration of the transceiver inserted into the port, and must be followed with apgApplyPort STATE...
Ethernet Packet Generator TCL API GUIDE PPLY ONFIGURATION PPLY apgGetPort apgLoadPort LOCAL ‘PORT DATABASE apgApplyPort apgSetPort apgApplyPort returns 1 if successful, otherwise the command will display an error message and exit the TCL environment. 8.4.1 apgApplyPort [PORTID] STATE apgApplyPort STATE command must be used after apgSetPort command to apply the...
Page 44
STEP Transmit the next packet from the stream queue. The port immediately returns to the PAUSED state. # Instantiate APG TCL API (Windows) source "C:/Program Files/Axtrinet/APG/axtrinetApi.tcl" ← Load API # Open Connection Open set IPADDRESS 192.168.1.100...
Ethernet Packet Generator TCL API GUIDE 8.5.1 apgControlPort [COMMAND] [PORTLIST] Traffic generator control is performed on a group of ports identified by [PORTLIST]. [PORTLIST] is a TCL list of PORTIDs: Starts transmission on ports 1 & 3 apgControlPort STARTTX {{ 1 1 } { 1 3 }} The following control commands can be used to control the port traffic generator: [COMMAND] Description...
Ethernet Packet Generator TCL API GUIDE For example, to capture and display active traffic on connected ports 1 & 5: set PORTLIST {{1 2}{1 5}} Enable port (16KB) apgControlPort PORTCAPTURE $PORTLIST capture on both ports. apgControlPort CLEARCAPTURE $PORTLIST Clear capture buffers and start apgControlPort STARTTX $PORTLIST transmitting...
Page 47
[STREAMID] HEADER [HDR] [FLD] [VAL] apgSetStream [STREAMID] PAYLOAD [VAR] [VAL] apgApplyStream apgApplyStream [STREAMID] Where STREAMID = {UNIT.PORT.STREAM} or {UNIT.PORT.SUBPORT.STREAM} # Instantiate APG TCL API (Windows) source "C:/Program Files/Axtrinet/APG/axtrinetApi.tcl" ← Load API # Open Connection Open set IPADDRESS 192.168.1.100 Connection...
Ethernet Packet Generator TCL API GUIDE TREAM ONFIGURATION TREAM apgGetStream apgLoadStream LOCAL ‘STREAM’ DATABASE apgApplyStream apgSetStream Load the STREAM configuration and status from the hardware into the local database. apgLoadStream returns 1 if successful, otherwise the command will display an error message and exit the TCL environment.
Ethernet Packet Generator TCL API GUIDE 9.2.1 apgGetStream [STREAMID] CONFIG [VAR] The stream configuration status, rate and size information is read with the apgGetStream CONFIG command. apgGetStream CONFIG must either be configured using apgSetStream CONFIG or be preceded by at least one apgLoadStream. If [VAR] has not been defined, apgGetStream CONFIG will display an error message and exit the TCL environment.
Ethernet Packet Generator TCL API GUIDE 9.2.2 apgGetStream [STREAMID] HEADER HEADER_LIST Returns a list of configured header names in the order that the headers appear in the frame. apgGetStream HEADER HEADER_LIST must either be configured using apgSetStream HEADER HEADER_LIST or be preceded by at least one apgLoadStream. If [VAR] has not been defined, apgGetStream HEADER HEADER_LIST will display an error message and exit...
Ethernet Packet Generator TCL API GUIDE apgGetStream HEADER returns the variable value in the following formats: Format Minimum Maximum Comments MAC-ADDRESS 00:00:00:00:00:00 FF:FF:FF:FF:FF:FF HEX4 0xFFFF HEX2ARRAY 0xFF Variable length HEX2 values separated by spaces 9.2.3.1 MACHEADER [FLD] DESC SIZE FORMAT MODE MAC Destination Address 6 bytes...
Page 52
The stream configuration is applied to the unit using apgApplyStream. # Instantiate APG TCL API (Windows) source "C:/Program Files/Axtrinet/APG/axtrinetApi.tcl" ← Load API # Open Connection Open set IPADDRESS 192.168.1.100...
Ethernet Packet Generator TCL API GUIDE 9.3.1 apgSetStream [STREAMID] DEFAULT Sets the STREAMID configuration to default settings, with the following exceptions: STREAM 0 is ENABLED MAC DA is set to 08:$PORTID:$SUBPORTID:$STREAMID:00:00 MAC SA is set to 08:$PORTID:$SUBPORTID:$STREAMID:00:01 9.3.2 apgSetStream [STREAMID] CONFIG [VAR] [VAL] apgSetStream CONFIG...
Ethernet Packet Generator TCL API GUIDE [VAR] Description Default FORMAT PACKET_SIZE_MAX Maximum packet length (including FCS) in bytes. If SIZE_MODE is 0 (FIXED) this value is ignored. PACKET_SIZE_MAX ≤ 16000 bytes Larger values will be set to 16000. Where variable FORMAT has the follow settings: FORMAT HEX2 0xFF...
Page 55
Ethernet Packet Generator TCL API GUIDE 9.3.4.1 MACHEADER [FLD] DESC SIZE FORMAT MAC Destination Address 6 bytes MAC-ADDRESS MAC Source Address 6 bytes MAC-ADDRESS apgSetStream {1 1 0 1} HEADER MACHEADER DA 01:23:45:67:89:AB apgApplyStream {1 1 0 1} 9.3.4.2 ETHERNET_II [FLD] DESC SIZE...
Ethernet Packet Generator TCL API GUIDE 9.3.5 apgSetStream [STREAMID] HEADER [HDR] [FLD] [VAL] [MODE] [STEP][MIN][MAX] Sets the value of a VARIABLE header field, where: Variable Description [HDR] The full list of [HDR] headers is defined in the latest Header Definition document [3].
Ethernet Packet Generator TCL API GUIDE apgGetStream apgLoadStream LOCAL ‘STREAM’ DATABASE apgApplyStream apgSetStream apgApplyStream returns 1 if successful, otherwise the command will display an error message and exit the TCL environment. 9.4.1 apgApplyStream [STREAMID] Applies the STREAM CONFIG, HEADER and PAYLOAD configurations to the unit. APG-TCL-UG-V1-0 7 June 2017...
Ethernet Packet Generator TCL API GUIDE 10. T OOLS The following tools are provided to simplify access to the local data structures. 10.1 C OMMAND OOLS 10.1.1 apgGetVariables [COMMAND] {FUNCTION} Returns a space-separated string of valid variables for a command, where: COMMAND FUNCTION VERSION...
Page 63
Ethernet Packet Generator TCL API GUIDE apgSetStream [STREAMID] HEADER HEADER_LIST [HDRLIST] "MACHEADER ETHERNET-II" apgApplyStream [STREAMID] apgSetStream [STREAMID] HEADER [HDR] [FLD] [VAL] See Header Definition document [3] Eg for MACHEADER: MACHEADER DA 08:00:00:11:22:33 MACHEADER SA 08:00:00:11:22:34 apgApplyStream [STREAMID] apgSetStream [STREAMID] HEADER [HDR] [FLD] [VAL] See Header Definition document [3] [MODE] [STEP][MIN][MAX] Eg for MACHEADER DA:...
Page 64
PORTID {4 1} The full configuration file APG000010.apg is shown below: ###################################################################################### # FILENAME: APG000010.apg # Generated on Mon, 08 Aug 2016 at 14:27:05 # AXTRINET APG000010 CONFIGURATION FILE ###################################################################################### # UNIT CONSTRAINTS ################################################################### # API_VERSION 160629 Unit API Version and...
Page 66
Ethernet Packet Generator TCL API GUIDE Xentech Solutions Ltd Suite 6 Stanta Business Centre 3 Soothouse Spring St Albans AL3 6PF United Kingdom Tel: +44 (0)1727 867795 Email: support@axtrinet.com APG-TCL-UG-V1-0 7 June 2017...
Need help?
Do you have a question about the APG4 and is the answer not in the manual?
Questions and answers