Skip to content

Repository files navigation


Ixia Network Control

Python SDK for IxNetwork — chain-based, fluent API for traffic generation.

PythonLicensePlatform

中文文档



What is IxNetwork?

IxNetwork is a high-performance network test platform by Keysight Technologies (formerly Ixia). It is widely used in the networking industry for:

  • L2/L3 protocol conformance testing — validate switch, router, and NIC implementations at wire speed
  • TSN / AVB testing — IEEE 802.1Qbv, 802.1Qbu, 802.1AS (gPTP), frame preemption for automotive and industrial Ethernet
  • Traffic generation & analysis — simulate real-world traffic patterns at line rate up to 400GE
  • Data center & service provider — VXLAN, EVPN, MPLS, Segment Routing, BGP/OSPF testing
  • Automotive Ethernet — 100BASE-T1, 1000BASE-T1, TSN compliance validation
  • Network security testing — DDoS simulation, fuzzing, protocol anomaly injection

This SDK provides a Python-native, chain-based API on top of the IxNetwork REST API (via ixnetwork-restpy), replacing repetitive low-level REST calls with an intuitive, composable programming interface.

Who Is This For?

AudienceTypical Use
QA / Test EngineersAutomate regression test suites, CI/CD integration
Network R&DValidate new switch/router ASIC features, protocol correctness
Toll ManufacturerProduction-line traffic validation, burn-in testing
Academic ResearchersTSN scheduling experiments, protocol behavior analysis
Hobbyists / Lab UsersLearn network protocols hands-on with real hardware

Highlights

  • Fluent Chain API — Build complex traffic items with method chaining, no boilerplate
  • Full Protocol Stack — Ethernet, VLAN/QinQ, IPv4, IPv6, TCP, UDP, ARP, ICMP, IGMPv1–v3, MLDv1–v2
  • TSN Suite — IEEE 802.1Qbv gate scheduling, gPTP (802.1AS) config, frame preemption
  • Quick Flow Groups — Batch-create hundreds of streams in a single call
  • Hardware Capture — Wire-rate packet capture with MAC/pattern/VLAN filtering
  • Live Statistics — Real-time per-port & per-stream counters

Installation

pip install ixia-network-control

Requirements: Python 3.7+, IxNetwork API server, ixnetwork-restpy

Verify:

python -c "from ixia_network_control import IxiaControl; print('OK')"

Quick Start

fromixia_network_controlimportIxiaControlixia=IxiaControl(
api_server_ip='127.0.0.1',
chassis_ip='192.168.1.100',
username='admin',
password='admin',
port_list= [['port1', 1, 1, 2], ['port2', 1, 1, 12]],
)
# Build a traffic stream with chain APIstream= (
ixia.create_traffic(name='My Test', tx=['port1'], rx=['port2'])
.ethernet
.set_smac('00:00:00:00:00:08')
.set_dmac('00:00:00:00:00:11')
.set_vlan(protocol_id='8100', vlan_vid='1')
.apply()
.ipv4
.set_src_ip('192.168.1.1')
.set_dst_ip('192.168.1.2')
.apply()
.stream
.set_frame_rate(rate_type='percentLineRate', rate='50')
.set_frame_control(control_type='fixedFrameCount', frame_count=100)
.apply()
)
ixia.commit().start_traffic()
# Read statisticsixia.ixnetwork.Statistics.refresh()
tx=ixia.get_statistics('Flow Statistics').get_stream_stat('My Test', 'Tx Frames')
print(f'Tx Frames: {tx}')
ixia.stop_traffic()

API at a Glance

IxiaControl — Entry Point

MethodDescription
create_traffic(...)Create a traffic item for protocol configuration
create_flow_group(...)Create a Quick Flow Group for batch streams
commit()Generate & apply config to hardware
start_traffic() / stop_traffic()Start / stop stateless traffic
pause_traffic(name)Suspend a named traffic item
remove_traffic(name)Stop and delete a traffic item
get_statistics(type)Access Statistics view by caption
get_capture(port)Access PacketCapture for a port
get_l1_config(port)Access L1 (physical) port config
set_iterations(n)Run traffic for N iterations globally
set_continuous()Run traffic continuously

Stream Methods (.stream.*)

MethodPurpose
set_crc(type)CRC type: goodCrc / badCrc
set_frame_size(...)Fixed, increment, random, IMIX, weighted
set_frame_rate(...)Rate by %, fps, bps, or inter-packet gap
set_frame_payload(...)Payload pattern: increment, random, custom hex
set_frame_control(...)Burst, duration, iteration, delay control

Protocol Chaining

.ethernet.set_smac(...).set_vlan(...).apply()
.ipv4.set_src_ip(...).set_dst_ip(...).apply()
.tcp.apply()
.udp.apply()
.arp.apply()
.icmp.apply()
.igmp_v1.apply()
.igmp_v2.apply()
.igmp_v3_query.apply()
.igmp_v3_report.apply()
.mld_v1.apply()
.mld_v2_query.apply()
.mld_v2_report.apply()
.stream.set_frame_rate(...).apply()

Each protocol: set fields → .apply() returns to parent chain.


TSN Example

stream= (
ixia.create_traffic(tx=['port1'], rx=['port2'])
.ethernet.apply()
.tsn
.set_qbv(base_time_offset=0, unit_of_time='MicroSecond')
.set_gptp_header(message_type=0, version_ptp=2)
.set_gptp_message_types()
.set_gptp_tlvs()
.set_preamble_frame()
.apply()
)
ixia.commit().start_traffic()

Project Layout

.
├── src/ixia_network_control/
│ ├── core.py IxiaControl + Traffic
│ ├── stream/ Stream, PortMap
│ ├── protocol/ 13 protocol headers
│ ├── tsn/ Qbv, gPTP, preemption
│ ├── capture/ Hardware capture + filters
│ ├── flow_group/ Quick Flow Groups
│ ├── statistics/ Stats views & queries
│ ├── port_config/ L1 speed, loopback, media
│ ├── interface/ ABC base classes
│ └── utils/ Field update, config, logging
├── examples/ 4 runnable examples
├── tests/ Unit tests
├── setup.py
├── pyproject.toml
├── LICENSE
└── README.md

License

Dual License. See LICENSE for full terms.

UsageTerms
Personal / Academic / Non-CommercialFree
Enterprise / CommercialWritten authorization required → sutinghappy@qq.com

About

python sdk for IxNetwork,chain-based,fluent API for traffic generation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages