Skip to main content

The IxNetwork Open Traffic Generator Python Package

Project description

Keysight IxNetwork Open Traffic Generator

Build pypi python license

The Keysight IxNetwork implementation of the open-traffic-generator models.

Getting Started

Install the client

pip install --upgrade ixnetwork-open-traffic-generator

Start scripting

"""A simple test that demonstrates the following:
- A port that transmits an ethernet/vlan/ipv4/tcp flow 
for a specified duration and a port that receives the packets.
- While the flow is transmitting the script prints out tx and rx statistics.
- Once all the packets have been transmitted the script will end. 
"""
import abstract_open_traffic_generator.port as port
import abstract_open_traffic_generator.flow as flow
import abstract_open_traffic_generator.config as config
import abstract_open_traffic_generator.control as control
import abstract_open_traffic_generator.result as result
from ixnetwork_open_traffic_generator.ixnetworkapi import IxNetworkApi
import pandas

tx_port = port.Port(name='Tx Port', location='10.36.74.26;02;13')
rx_port = port.Port(name='Rx Port', location='10.36.74.26;02;14')
flow = flow.Flow(name='Tx Port to Rx Port Flow',
                 tx_rx=flow.TxRx(
                     flow.PortTxRx(tx_port_name=tx_port.name,
                                   rx_port_name=rx_port.name)),
                 packet=[
                     flow.Header(flow.Ethernet()),
                     flow.Header(flow.Vlan()),
                     flow.Header(flow.Ipv4()),
                     flow.Header(flow.Tcp())
                 ],
                 size=flow.Size(128),
                 rate=flow.Rate(unit='pps', value=1000),
                 duration=flow.Duration(flow.FixedPackets(10000)))
config = config.Config(ports=[tx_port, rx_port],
                       flows=[flow],
                       options=config.Options(port_options=port.Options(
                           location_preemption=True)))

api = IxNetworkApi(address='10.36.66.49', port=11009)
api.set_state(control.State(control.ConfigState(config=config, state='set')))
state = control.State(control.FlowTransmitState(state='start'))
api.set_state(state)

request = result.PortRequest(
    column_names=['name', 'location', 'frames_tx', 'frames_rx'])
while True:
    results = api.get_port_results(request)
    df = pandas.DataFrame.from_dict(results)
    print(df)
    if df.frames_tx.sum() >= config.flows[0].duration.packets.packets:
        break

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ixnetwork_open_traffic_generator-0.0.51.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ixnetwork_open_traffic_generator-0.0.51-py2.py3-none-any.whl (39.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ixnetwork_open_traffic_generator-0.0.51.tar.gz.

File metadata

  • Download URL: ixnetwork_open_traffic_generator-0.0.51.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for ixnetwork_open_traffic_generator-0.0.51.tar.gz
Algorithm Hash digest
SHA256 c505a306e59be5668aeae0826b115e53e48d79589df61eaeebd62992e61bbaab
MD5 253b6b3a07574cecc8ea080d617f1014
BLAKE2b-256 ec5fc45f7cf53dbafbe9f56009471d8baa53c3e4cd767dc6fab08a83e92f69d0

See more details on using hashes here.

File details

Details for the file ixnetwork_open_traffic_generator-0.0.51-py2.py3-none-any.whl.

File metadata

  • Download URL: ixnetwork_open_traffic_generator-0.0.51-py2.py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for ixnetwork_open_traffic_generator-0.0.51-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 17f7f3adca6596a2c8f06b6f8e8452c48f3a85b0796b08a0c0a366aff70c4887
MD5 74e429aca27fa4b8ce5a484098c4700f
BLAKE2b-256 0f308b973c02c741ead2a0b40e4da373f6495dfc45a89e82fa72c1ae476e8239

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page