Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ixnetwork-open-traffic-generator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ixnetwork-open-traffic-generator

The IxNetwork Open Traffic Generator Python Package

  • 0.0.85
  • PyPI
  • Socket score

Maintainers
1

Keysight IxNetwork Open Traffic Generator

Build pypi python license Total alerts Language grade: Python

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 or retry
# retry count is 0
retry = 5
request = result.PortRequest(port_names=[tx.name], column_names=['frames_tx'])

while sum([p['frames_tx'] for p in api.get_port_results(request)]) != 10000:
    assert retry > 0
    retry -= 1

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc