Slide 42
Slide 42 text
ソフトウェアフレームワークとの融合
Tester
#! /usr/bin/python3
import snappi
...
api = snappi.api(location = 'TEST CONTROLLER', ext = 'TESTER TYPE')
config = api.config()
tx, rx = (
config.ports
.port(name = 'tx', location = 'TRAFFIC ENGINE')
.port(name = 'rx', location = 'TRAFFIC ENGINE')
)
d1, d2 = config.devices.device(name = 'dev1').device(name = 'dev2')
eth1, eth2 = d1.ethernets.add(), d2.ethernets.add()
eth1.port_name, eth2.port_name = tx.name, rx.name
ip1, ip2 = eth1.ipv4_addresses.add(), eth2.ipv4_addresses.add()
eth1.name, eth2.name = 'eth1', 'eth2'
eth1.mac, eth2.mac = '00:00:11:00:00:01', '00:00:12:00:00:01'
ip1.name, ip2.name = 'ip1', 'ip2'
ip1.address, ip2.address = '192.168.1.1', '192.168.2.1'
ip1.prefix, ip2.prefix = 16, 16
ip1.gateway, ip2.gateway = '192.168.2.1', '192.168.1.1'
flw, = config.flows.flow(name = 'flw')
flw.size.fixed = 1024
flw.rate.pps = 100
flw.duration.fixed_packets.packets = 1000
flw.tx_rx.device.tx_names = [config.devices[0].ethernets[0].ipv4_addresses[0].name]
flw.tx_rx.device.rx_names = [config.devices[1].ethernets[0].ipv4_addresses[0].name]
flw.tx_rx.device.mode = flw.tx_rx.device.ONE_TO_ONE
eth, ip, udp = flw.packet.ethernet().ipv4().udp()
eth.src.value, eth.dst.value = '00:00:11:00:00:01', '00:00:00:00:00:00'
eth.src.choice, eth.dst.choice = 'value', 'auto'
ip.src.value, ip.dst.value = '172.16.1.11', '172.16.2.11'
udp.src_port.value, udp.dst_port.value = 9999, 10001
flw.metrics.enable = True
api.set_config(config)
ts = api.transmit_state()
ts.state = ts.START
api.set_transmit_state(ts)
...
Ixia-C
no extension
Keysight IxNetwork
ext = 'ixnetwork'
Cisco T-Rex
ext = 'trex'
テスターの指定
ポートの設定
トラフィックの設定
テストの制御