Giter Site home page Giter Site logo

ixia-c's Introduction


Ixia-C

Ixia-C - A powerful traffic generator based on Open Traffic Generator API

Release v1.5.1-12 Open Traffic Generator v1.5.1 snappi v1.5.1 news news Slack Status

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

What is Ixia-C ?

  • A modern, powerful and API-driven traffic generator designed to cater to the needs of hyper-scalers, network hardware vendors and hobbyists alike.

  • Free for basic use-cases and distributed / deployed as a multi-container application consisting primarily of a controller, a traffic-engine and a protocol-engine.

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

Ixia-C deployment for two-arm test with DUT

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

Quick Start

Please ensure that following prerequisites are met by the setup:

  • At least 2 x86_64 CPU cores and 7GB RAM, preferably running Ubuntu 22.04 LTS OS
  • Python 3.8+ (and pip) or Go 1.19+
  • Docker Engine (Community Edition)

1. Deploy Ixia-C

# clone this repository
git clone --recurse-submodules https://github.com/open-traffic-generator/ixia-c.git && cd ixia-c

# create a veth pair and deploy ixia-c containers where one traffic-engine is bound
# to each interface in the pair, and controller is configured to figure out how to
# talk to those traffic-engine containers
cd conformance && ./do.sh topo new dp

2. Setup and run standalone test using snappi or gosnappi

# change dir to conformance if you haven't already
cd conformance

# setup python virtual environment and install dependencies
./do.sh prepytest

# run standalone snappi test that configures and sends UDP traffic
# upon successful run, flow metrics shall be printed on console
./do.sh pytest examples/test_quickstart.py

# optionally, go equivalent of the test can be run like so
./do.sh gotest examples/quickstart_test.go

Checkout the contents of test_quickstart.py and equivalent quickstart_test.go for quick explanation on test steps

3. Optionally, run test using curl

We can also pass equivalent JSON configuration directly to controller, just by using curl. The description of each node in the configuration is detailed in self-updating online documentation.

# push traffic configuration
curl -skL https://localhost:8443/config -H "Content-Type: application/json" -d @conformance/examples/quickstart_config.json

# start transmitting configured flows
curl -skL https://localhost:8443/control/state -H "Content-Type: application/json" -d @conformance/examples/quickstart_control.json

# fetch flow metrics
curl -skL https://localhost:8443/monitor/metrics -H "Content-Type: application/json" -d @conformance/examples/quickstart_metrics.json

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

Copyright notice

© Copyright Keysight Technologies, Inc. 2021, 2022, 2023

ixia-c's People

Contributors

abhijit-dhar avatar anjan-keysight avatar ankur-sheth avatar apratimmukherjee avatar arkajyoti-cloud avatar ashutshkumr avatar azharkuntoji avatar biplamal avatar bortok avatar dandelwa avatar indranibh avatar rudranil-das avatar sahanaghosh avatar shramroy avatar vinjose avatar winstonliu1111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ixia-c's Issues

Quickstart needs more details

The Quickstart leaves much to the imagination concerning what should be connected to eth1 in order to get "good" test results. What kind of DUT setup make sense? Explain the test a little better (we send x frames of length Y...) and show representative output.

Use of eth1 should be stated as an assumption - many Linux PCs come up with different device names e.g. eno1, enp0s3, etc.). Inform the user to change as needed.

Add OTG/snappi config snippets for various deployment scenarios

The https://github.com/open-traffic-generator/ixia-c/blob/main/docs/deployments.md document shows docker run commands for various scenarios. It'd be nice to show, in the same place, some snippets of the corresponding port configurations both in JSON and snappi Python, so the user can easily get going. For example, here's a snappi snippet:

        # when using ixnetwork extension, port location is chassis-ip;card-id;port-id
        port1, port2 = (
            self.cfg.ports
            .port(name='port1', location='localhost:5555')
            .port(name='port2', location='localhost:5556')
        )

Unable to view traffic on vnet1 interface

I am running quickstart_snappi application. i am able to monitor packets on veth2 interface using tcpdump. but its not showing anything on vet1. I am also receiving wrong port_metric stats. i am transmitting 1000 packets of 128 byte size which i am receiving on tcpdump but getting stats bytes_tx = 384.

image

snappi-ixia-c.py is throwing exception.

I have created veth1 and veth2 ports and assigned it to traffic engines.

udo ip link add veth1 type veth peer name veth2
sudo ip link set veth1 up
sudo ip link set veth2 up

docker run -d --network=host ixiacom/ixia-c-controller --accept-eula --http-port 80 --disable-app-usage-reporter
docker run --net=host -d ixiacom/ixia-c-app-usage-reporter

docker run --net=host --privileged -d
-e OPT_LISTEN_PORT="5555"
-e ARG_IFACE_LIST="virtual@af_packet,veth1"
-e OPT_NO_HUGEPAGES="Yes"
ixiacom/ixia-c-traffic-engine

docker run --net=host --privileged -d
-e OPT_LISTEN_PORT="5556"
-e ARG_IFACE_LIST="virtual@af_packet,veth2"
-e OPT_NO_HUGEPAGES="Yes"
ixiacom/ixia-c-traffic-engine

Now running running snappi-ixia-c.py (with http://localhost:80) throws following exception:

root@user1:/opt/ixia-c/snappi-tests/scripts# python snappi-ixia-c.py

2022-01-09 23:10:08 [snappi.snappi] [WARNING] Certificate verification is disabled
2022-01-09 18:10:08.092889 Starting connection to controller ...
2022-01-09 18:10:08.096778 Starting configuration apply ...
Traceback (most recent call last):
File "snappi-ixia-c.py", line 155, in
Traffic_Test()
File "snappi-ixia-c.py", line 86, in Traffic_Test
api.set_config(configuration)
File "/home/vadalia/.local/lib/python2.7/site-packages/snappi/snappi.py", line 58806, in set_config
return_object=self.response_warning(),
File "/home/vadalia/.local/lib/python2.7/site-packages/snappi/snappi.py", line 107, in send_recv
headers=headers,
File "/home/vadalia/.local/lib/python2.7/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/home/vadalia/.local/lib/python2.7/site-packages/requests/sessions.py", line 697, in send
r.content
File "/home/vadalia/.local/lib/python2.7/site-packages/requests/models.py", line 836, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "/home/vadalia/.local/lib/python2.7/site-packages/requests/models.py", line 761, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: error(104, 'Connection reset by peer')", error(104, 'Connection reset by peer'))

Ixia-c only transmitting with 10 Gbs on 100 GBs NIC card

I have tested IXIA-C on connectx6-dx card 100 Gbs. following were the results

L1 speed 100 Gbs and packets were transmitting with speed of 10 Gbs
L1 speed 10 Gbs and packets were transmitting with speed of 6 Gbs

Can you explain the reason for this behavior ?
Can we increase TX queue and core?
what speed IXIA-c free version supports?

ixia-c-one deployment on ubuntu 22.04 fails

When deploying ixia-c-one on ubuntu 22.04 using containerlab, test port containers are not assigned any interface.
The culprit is pipework script, which doesn't seem to work correctly when cgroupv2 is enabled.

2022/05/09 21:43:35 Found IP address: 172.17.0.4
2022/05/09 21:43:35 Endpoint address: 172.17.0.4:5555
2022/05/09 21:43:35 Controller Config: &{LocationMap:[{Location:eth3 Endpoint:172.17.0.3:5555} {Location:eth4 Endpoint:172.17.0.4:5555}]}
2022/05/09 21:43:35 Interface 'eth1' does not exist, adding it ...
2022/05/09 21:43:35 Creating traffic-engine ...
2022/05/09 21:43:35 Creating container ixia-c-traffic-engine:1.4.1.26 ...
2022/05/09 21:43:35 Pushing interface to traffic-engine container ...
2022/05/09 21:43:35 Could not create traffic-engine for interface eth1 : could not push interface: exit status 1

Login to Ixia container

I created Ixia container and accessing it with the command

#docker exec -it bash

Is there any other way of logging in to the ixia container?

Update ixia-c docs for release 0.0.1-2020

  • Update all tests snappi-tests and identify which tests are not run as part of CI (so we don't forget to update it)
  • Update hello-snappi
  • Update deployment steps
  • Update reference to particular commit of snappi-tests
  • Update version matrix
  • Add docs for working with iterators

Update documentation with WSL (Windows Subsystem for Linux) support info

If someone tries to run ixia-c on WSL (Windows Subsystem for Linux) it won't be successful, with symptoms like these on set_config. Let's update our documentation with a statement about WSL support.

2022-08-01 19:54:36 [snappi.snappi] [WARNING] Certificate verification is disabled
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn
    conn = connection.create_connection(
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 171, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7feb4c1c5ee0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=443): Max retries exceeded with url: /config (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7feb4c1c5ee0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "ixia-c/snappi-tests/scripts/quickstart_snappi.py", line 22, in <module>
    api.set_config(config)
  File "/home/koehlerd/.local/lib/python3.8/site-packages/snappi/snappi.py", line 69263, in set_config
    return self._transport.send_recv(
  File "/home/koehlerd/.local/lib/python3.8/site-packages/snappi/snappi.py", line 151, in send_recv
    response = self._session.request(
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='localhost', port=443): Max retries exceeded with url: /config (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7feb4c1c5ee0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Also show options for installing snappi as root or global usage

The default instructions show generic pip install commands:

python -m pip install --upgrade "snappi"

When doing PTF tests the scripts must be called from root, and packages installed per the above are not found because they're installed under the user's HOME directory. Instead I used sudo to install under /usr.

I thought there was another pip option to do this for global access but I can't find it. I'm not an expert in best practices here so if there's a better way to handle this, all the better.

In any case, I suggest a side-bar comment in the User Guide on this topic. virtualenv might warrant another sidebar, another area where I'm inexperienced.

Reported by @chrispsommers

demo1-snappi-ixia-c program issue , need help to resolve

Hello community @
Thank you for providing details steps to try it out snappy with ixia-c.
This is regarding demo1-snappi-ixia-c as mentioned in https://github.com/chrispsommers/p4-guide/blob/snappi-tests2/demo1-snappi-ixia-c/README.md

I see below issue while executing the demo1 program.. Details mentioned below . Could some one suggust the right solution for this program.

p4@p4:~/p4-guide/demo1-snappi-ixia-c$ sudo ./runptf.sh demo1-snappi.SnappiFwdTestBidirLpmRange
P is: /home/p4/p4-guide/testlib
Starting IXia-c traffic engines and controller...
f1ffe962307bb7e1e750522cf9a7d60dccabcd2df27883422fb4ae2ebff71bd9
7e17f71d6fb6e2f5ea48dbb393951e2ff46eadda186c8927d94eef3479efa22c
bdb938552793c6fc6058cd5d9b8a8c3cc40a83c4b0c2fb08648c8a820b441db3
54bd59ada3bd82becb3c39b849c78fe7d8239091fa6695b1e85b903893e726a5
f3805b2d3456ef18c68ab23f2a7c5c22b7aef7288962cbb2e0295ff66c1713cb
/usr/local/lib/python3.8/dist-packages/ptf-0.9.3-py3.8.egg/EGG-INFO/scripts/ptf:19: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
Using packet manipulation module: ptf.packet_scapy
File=/home/p4/p4-guide/settings.json

2022-06-14 17:32:45,586 - root - INFO - Importing platform: eth
2022-06-14 17:32:45,587 - root - DEBUG - Configuration: {'list': False, 'list_test_names': False, 'allow_user': False, 'test_spec': '', 'test_file': None, 'test_dir': 'ptf', 'test_order': 'default', 'test_order_seed': 2746, 'num_shards': 1, 'shard_id': 0, 'platform': 'eth', 'platform_args': None, 'platform_dir': '/usr/local/lib/python3.8/dist-packages/ptf-0.9.3-py3.8.egg/ptf/platforms', 'interfaces': [(0, 0, 'veth1'), (0, 1, 'veth3'), (0, 2, 'veth5'), (0, 3, 'veth7'), (0, 4, 'veth9'), (0, 5, 'veth11'), (0, 6, 'veth13'), (0, 7, 'veth15')], 'port_info': {}, 'device_sockets': [], 'log_file': 'ptf.log', 'log_dir': None, 'debug': 'verbose', 'profile': False, 'profile_file': 'profile.out', 'xunit': False, 'xunit_dir': 'xunit', 'relax': False, 'test_params': "grpcaddr='localhost:9559';p4info='demo1.p4_16.p4rt.txt';config='demo1.p4_16.json'", 'failfast': False, 'fail_skipped': False, 'default_timeout': 2.0, 'default_negative_timeout': 0.1, 'minsize': 0, 'random_seed': None, 'disable_ipv6': False, 'disable_vxlan': False, 'disable_erspan': False, 'disable_geneve': False, 'disable_mpls': False, 'disable_nvgre': False, 'disable_igmp': False, 'disable_rocev2': False, 'qlen': 100, 'test_case_timeout': None, 'socket_recv_size': 4096, 'packet_manipulation_module': 'ptf.packet_scapy', 'port_map': {(0, 0): 'veth1', (0, 1): 'veth3', (0, 2): 'veth5', (0, 3): 'veth7', (0, 4): 'veth9', (0, 5): 'veth11', (0, 6): 'veth13', (0, 7): 'veth15'}}
2022-06-14 17:32:45,587 - root - INFO - port map: {(0, 0): 'veth1', (0, 1): 'veth3', (0, 2): 'veth5', (0, 3): 'veth7', (0, 4): 'veth9', (0, 5): 'veth11', (0, 6): 'veth13', (0, 7): 'veth15'}
2022-06-14 17:32:45,587 - root - INFO - Autogen random seed: 95877887
2022-06-14 17:32:45,588 - root - INFO - *** TEST RUN START: Tue Jun 14 17:32:45 2022
demo1-snappi.SnappiFwdTestBidirLpmRange ...


Loading P4 Program...


ERROR**

======================================================================
ERROR: demo1-snappi.SnappiFwdTestBidirLpmRange

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn
conn = connection.create_connection(
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 314, in connect
conn = self._new_conn()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 171, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f8ed2ff7250>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /config (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f8ed2ff7250>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/p4/p4-guide/testlib/base_test.py", line 1008, in handle
return f(*args, **kwargs)
File "ptf/demo1-snappi.py", line 837, in runTest
res = self.api.set_config(self.cfg)
File "/usr/local/lib/python3.8/dist-packages/snappi/snappi.py", line 40522, in set_config
return self._transport.send_recv(
File "/usr/local/lib/python3.8/dist-packages/snappi/snappicommon.py", line 28, in send_recv
response = self._session.request(
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /config (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f8ed2ff7250>: Failed to establish a new connection: [Errno 111] Connection refused'))


Ran 1 test in 0.030s

FAILED (errors=1)


ATTENTION: SOME TESTS DID NOT PASS!!!

The following tests errored:
SnappiFwdTestBidirLpmRange


Killing Ixia-C traffic engines and controller...
54bd59ada3bd
bdb938552793
7e17f71d6fb6
f1ffe962307b

Transmit state on subset of flows not supported

Hi,

i configured two flows on one trasmitting port. When i try to start only the first flow, the response is:

{ "errors": [ "Setting transmit state "start" on subset of flows is currently not supported" ] }. Of course the same happens if i try to start the second flow.

Is this beahviour correct? If not, is this scenario's implementation foreseen?

Thank you

Explain shared controller core better

Under https://github.com/open-traffic-generator/athena/blob/dev-mon-ist/docs/deployments.md#deployment-parameters:

In the second table, last column

List of three CPU cores. First core in list is used for configuration, control and statistics. Second core is used for Tx and third (& last) core is used for Rx.

I would write something like this:

List of three CPU cores. First core in list is used for configuration, control and statistics. Only one core is needed for the controller; it can be reused for every traffic engine instance, so you should specify the same core for each container you launch. Second core is used for Tx and third (& last) core is used for Rx.

I'd also restate this briefly before the two- and three-arm examples (e.g. "Note the shared controller core.") You need to assume peolple won't read these from top to bottom, but jump around to sections.

This brings up a question: if you can spawn traffic-engine containers on multiple hosts for horizontal scale out, does each host require a controller core for [a group of] engines? I'll open another issue about this: https://github.com/open-traffic-generator/athena/issues/13

Reported by @chrispsommers

ether_type value in ethernet header configuration is set to default instead of the value provided in configuration

The ether_type value set by the user is 2048(0x0800), but the value is defaulting to 65535(0xFFFF) on the wire

Test:



def test_plvision_issue(api):
    api = snappi.api(location="https://127.0.0.1:443", ext="ixnetwork")
    config = api.config()

    tx, rx = config.ports.port(
        name="tx", location="otg-novus100g.lbj.is.keysight.com;1;5"
    ).port(name="rx", location="otg-novus100g.lbj.is.keysight.com;1;6")

    flow = config.flows.flow(name="f1")[-1]
    flow.tx_rx.port.tx_name = tx.name
    flow.tx_rx.port.rx_name = rx.name

    f = config.flows[0]
    f.packet.ethernet().custom()
    eth, payload = f.packet[0], f.packet[1]
    eth.src.value = "00:CD:DC:CD:DC:CD"
    eth.dst.value = "00:AB:BC:AB:BC:AB"
    eth.ether_type.value = 2048

    payload.bytes = "45000056006600004006af92c0a800010a00000104d20050000000000000000050022000c3d50000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d"

    print(config)
    api.set_config(config)```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.