Python SDK for IxNetwork — chain-based, fluent API for traffic generation.
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.
| Audience | Typical Use |
|---|---|
| QA / Test Engineers | Automate regression test suites, CI/CD integration |
| Network R&D | Validate new switch/router ASIC features, protocol correctness |
| Toll Manufacturer | Production-line traffic validation, burn-in testing |
| Academic Researchers | TSN scheduling experiments, protocol behavior analysis |
| Hobbyists / Lab Users | Learn network protocols hands-on with real hardware |
- 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
pip install ixia-network-controlRequirements: Python 3.7+, IxNetwork API server,
ixnetwork-restpy
Verify:
python -c "from ixia_network_control import IxiaControl; print('OK')"from ixia_network_control import IxiaControl
ixia = 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 API
stream = (
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 statistics
ixia.ixnetwork.Statistics.refresh()
tx = ixia.get_statistics('Flow Statistics').get_stream_stat('My Test', 'Tx Frames')
print(f'Tx Frames: {tx}')
ixia.stop_traffic()| Method | Description |
|---|---|
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 |
| Method | Purpose |
|---|---|
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 |
.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.
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().
├── 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
Dual License. See LICENSE for full terms.
| Usage | Terms |
|---|---|
| Personal / Academic / Non-Commercial | Free |
| Enterprise / Commercial | Written authorization required → sutinghappy@qq.com |