Skip to content

stayyule/ixia-c

 
 

Repository files navigation


Ixia-c

A powerful traffic generator based on Open Traffic Generator API

Release v0.0.1-2969 Open Traffic Generator v0.7.15 snappi v0.7.41 news news Slack Status

Quick Demo  •  Quick Start  •  Key Features  •  Documentation  •  Use Cases  •  Roadmap  •  FAQ

What is Ixia-c ?

Ixia-c is a modern, powerful and API-driven traffic generator designed to cater to the needs of hyperscalers, network hardware vendors and hobbyists alike.

It is available for free and distributed / deployed as a multi-container application consisting of a controller, a traffic-engine and an app-usage-reporter.

As a reference implementation of Open Traffic Generator API, Ixia-c supports client SDKs in various languages, most prevalent being snappi (Python SDK).

Ixia-c Deployment for Bidirectional Traffic

Keysight also offers a well supported commercial version, Keysight Elastic Network Generator, with no restrictions on performance and scalability. Scripts written for the free version are compatible with this version.

Quick Demo

Quick Demo

Quick Start

Before proceeding, please ensure system prerequisites are met.

  • Deploy Ixia-c

    # start ixia-c controller
    docker run -d --network=host ixiacom/ixia-c-controller --accept-eula
    docker run --net=host -d ixiacom/ixia-c-app-usage-reporter
    
    # start ixia-c traffic engine on eth1 interface
    docker run -d --network=host --privileged     \
      -e ARG_IFACE_LIST="virtual@af_packet,eth1"  \
      -e OPT_NO_HUGEPAGES="Yes"                   \
      ixiacom/ixia-c-traffic-engine

    Once the containers are up, accessing https://controller-ip/docs/ will open up an interactive REST API documentation. Check out deployment guide for more details.

  • Generate Traffic using snappi

    # clone repo for test suites, useful helper scripts, deployment files, etc.
    git clone --recurse-submodules https://github.com/open-traffic-generator/ixia-c && cd ixia-c
    
    # install snappi
    python -m pip install --upgrade snappi==0.7.41
    # run a standalone script to generate TCP traffic and fetch metrics
    python snappi-tests/scripts/quickstart_snappi.py

    Upon successful run, you should see port metrics printed on console.

    Expand this section for overview of the script we just ran. For more details on snappi, checkout hello-snappi.
    import snappi
    # create a new API instance where location points to controller
    api = snappi.api(location="https://localhost", verify=False)
    
    # create a config object to be pushed to controller
    config = api.config()
    # add a port with location pointing to traffic engine
    prt = config.ports.port(name='prt', location='localhost:5555')[-1]
    # add a flow and assign endpoints
    flw = config.flows.flow(name='flw')[-1]
    flw.tx_rx.port.tx_name = prt.name
    
    # configure 100 packets to be sent, each having a size of 128 bytes
    flw.size.fixed = 128
    flw.duration.fixed_packets.packets = 100
    
    # add Ethernet, IP and TCP protocol headers with defaults
    flw.packet.ethernet().ipv4().tcp()
    
    # push configuration
    api.set_config(config)
    
    # start transmitting configured flows
    ts = api.transmit_state()
    ts.state = ts.START
    api.set_transmit_state(ts)
    
    # fetch & print port metrics
    req = api.metrics_request()
    req.port.port_names = [prt.name]
    print(api.get_metrics(req))
  • Optionally, Generate Traffic Using curl

    We can also pass equivalent JSON configuration directly to ixia-c controller, without installing snappi, using curl.
    The detailed description of each node (and their attributes) in JSON configuration are well documented here.

    # push the contents of config file snappi-tests/configs/quickstart_snappi.json
    curl -k https://localhost/config -H "Content-Type: application/json" -d @snappi-tests/configs/quickstart_snappi.json
    # start transmitting configured flows
    curl -k https://localhost/control/transmit -H  "Content-Type: application/json" -d '{"state": "start"}'
    # fetch all port metrics
    curl -k https://localhost/results/metrics -H  "Content-Type: application/json" -d '{"choice": "port"}}'

Key Features

  • High Performance
    • Run on servers or Keysight hardware (commercial version only)
    • Generate kbps to Tbps of traffic using same script
    • 10Gbps @ 64 byte frame size using one Xeon class core (commercial version only)
    • Built using DPDK
  • Fast REST API for automation
    • Easily integrate with test frameworks like pytest
    • Easily integrate into CI/CD pipelines with Jenkins, GitHub, GitLab
  • Up to 256 flows per port. Each Flow supports:
    • Packet Templates for Ethernet, VLAN, VXLAN, GTPv1, GTPv2, IPv4, IPv6, ICMP, ICMPv6, GRE, UDP, & TCP. More protocols are on the way.
    • Ability to use tools like Scapy to add headers for unsupported protocols.
    • Manipulation of any field in the packet headers
    • Patterns to modify common packet header fields to generate millions of unique packets
    • Ability to track flows based on common packet header fields
    • Configurable frame size
    • Rate specification in pps (packets per second) or % line-rate
    • Ability to send bursts
  • Statistics
    • Per port and per flow
    • One way latency measurements (min, max, average) on a per flow basis
  • Capture
    • Packets with filters
    • Write to PCAP or redirect to tcpdump

About

Ixia-c Traffic Generator

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%