The IxNetwork Open Traffic Generator Python Package
Project description
Keysight IxNetwork Open Traffic Generator
The Keysight IxNetwork implementation of the open-traffic-generator models.
To start contributing, please see contributing.md.
Getting Started
Install client package
python -m pip install --upgrade ixnetwork-open-traffic-generator
Start scripting
# for constructing traffic configuration
from abstract_open_traffic_generator import (
port, flow, config, control, result
)
# for making API calls
from ixnetwork_open_traffic_generator.ixnetworkapi import IxNetworkApi
# provide API server and port addresses
api = IxNetworkApi(address='127.0.0.1', port=11009)
tx = port.Port(name='Tx Port', location='127.0.0.1;2;1')
rx = port.Port(name='Rx Port', location='127.0.0.1;2;2')
# configure one TCP flow (with default protocol headers) to send 10000 packets,
# each of 128 bytes at 10% of max line rate
flw = flow.Flow(
name='Flow %s->%s' % (tx.name, rx.name),
tx_rx=flow.TxRx(
flow.PortTxRx(tx_port_name=tx.name, rx_port_name=rx.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(value=10, unit='line'),
duration=flow.Duration(flow.FixedPackets(packets=10000))
)
# push configuration and start transmitting flows
cfg = config.Config(ports=[tx, rx], flows=[flw])
api.set_state(control.State(control.ConfigState(config=cfg, state='set')))
api.set_state(control.State(control.FlowTransmitState(state='start')))
# fetch tx port stats and wait until total frames sent is correct
while 10000 != sum([
p['frames_tx'] for p in api.get_port_results(
result.PortRequest(port_names=[tx.name], column_names=['frames_tx'])
)
]):
continue
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
Built Distribution
Close
Hashes for ixnetwork_open_traffic_generator-0.0.67.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9c32a058b972289f8cd2b4deec0ddb4f14519eae8ed1b82a0f85b2125d3fcd2 |
|
MD5 | d42d77ba179e859d5a7c75cf0c4c8b66 |
|
BLAKE2b-256 | 5b772368c5e3fd30493662c7741e519378a3018efbab05afee610bcd5c3eb087 |
Close
Hashes for ixnetwork_open_traffic_generator-0.0.67-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17a6d76e7bdf3db020828276735a4f0385317351896dae9f69b6dd5041ca3d8c |
|
MD5 | 266d70190e726a7ad3c66178b884f356 |
|
BLAKE2b-256 | a13c97c1130baeaa6242bdb62a16b4a9a6a8e26cdad060d91e28c66074096d74 |