# snappi Extension for IxLoad
[](https://en.wikipedia.org/wiki/MIT_License)
[](https://www.repostatus.org/#active)
[](https://github.com/open-traffic-generator/snappi-ixload/actions)
[](https://pypi.org/project/snappi_ixload)
[](https://pypi.python.org/pypi/snappi_ixload)
[](https://lgtm.com/projects/g/open-traffic-generator/snappi-ixload/alerts/)
[](https://lgtm.com/projects/g/open-traffic-generator/snappi-ixload/context:python)
[](https://pepy.tech/project/snappi-ixload)
This extension allows executing test scripts written using [snappi](https://github.com/open-traffic-generator/snappi) against
IxLoad, (one of) Keysight's implementation of [Open Traffic Generator](https://github.com/open-traffic-generator/models/releases).
> The repository is under active development.
To start contributing, please see [contributing.md](contributing.md).
## Install on a client
```sh
python -m pip install --upgrade "snappi[ixload]"
```
## Start scripting
```python
"""
Configure a raw TCP flow with,
- tx port as source to rx port as destination
- frame count 10000, each of size 128 bytes
- transmit rate of 1000 packets per second
Validate,
- frames transmitted and received for configured flow is as expected
"""
import snappi
# host is Ixload API Server
api = snappi.api(location='https://localhost:443', ext='ixload')
# new config
config = api.config()
# port location is chassis-ip;card-id;port-id
tx, rx = (
config.ports
.port(name='tx', location='192.168.0.1;2;1')
.port(name='rx', location='192.168.0.1;2;2')
)
# configure layer 1 properties
(d1, d2) = config.devices.device(name="d1").device(name="d2")
(e1,) = d1.ethernets.ethernet(name="d1.e1")
e1.connection.port_name = "p1"
e1.mac = "70:9C:91:69:00:00"
(e2,) = d2.ethernets.ethernet(name="d2.e2")
e2.connection.port_name = "p2"
e2.mac = "7C:5D:68:26:00:00"
(ip1,) = e1.ipv4_addresses.ipv4(name="e1.ipv4")
ip1.address = "173.173.173.10"
ip1.gateway = "0.0.0.0"
ip1.step = "0.0.0.1"
ip1.count = 1
(ip2,) = e2.ipv4_addresses.ipv4(name="e2.ipv4")
ip2.address = "173.173.173.30"
ip2.gateway = "0.0.0.0"
(t1,) = d1.tcps.tcp(name="Tcp1")
t1.ip_interface_name = ip1.name
t1.adjust_tcp_buffers = False
t1.keep_alive_time = 7000
(t2,) = d2.tcps.tcp(name="Tcp2")
t2.ip_interface_name = ip2.name
t2.time_wait_recycle = False
t2.time_wait_rfc1323_strict = True
t2.keep_alive_time = 600
(http_1,) = d1.https.http(name="HTTP1")
http_1.tcp_name = t1.name #UDP configs can be mapped http.transport = udp_1.name
http_1.enable_tos = False
http_1.priority_flow_control_class = "v10"
(http_client,) = http_1.clients.client()
http_client.cookie_jar_size = 100
http_client.version = "1"
(http_2,) = d2.https.http(name="HTTP2")
http_2.tcp_name = t2.name #UDP configs can be mapped http.transport = udp_2.name
http_2.enable_tos = False
http_2.priority_flow_control_class = "v10"
(http_server,) = http_2.servers.server()
http_server.rst_timeout = 100
http_server.enable_http2 = False
http_server.port = 80
(get_a,) = http_client.methods.method().method()
(get1,) = get_a.get.get()
get1.destination = "Traffic2_HTTPServer1:80"
get1.page = "./1b.html"
# push configuration
api.set_config(config)
# start traffic
cs = api.control_state()
cs.app.state = 'start' #cs.app.state.START
response1 = api.set_control_state(cs)
print(response1)
cs.app.state = 'stop' #cs.app.state.START
api.set_control_state(cs)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/open-traffic-generator/snappi-ixload",
"name": "snappi-ixload",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=2.7",
"maintainer_email": null,
"keywords": "snappi ixload testing open traffic generator automation",
"author": "waseembaig",
"author_email": "waseem.baig@keysight.com",
"download_url": "https://files.pythonhosted.org/packages/b6/f7/d057d269b30bab63124c0beec9c4ea7296c4e70c9dbf893192f876e3223e/snappi_ixload-0.0.6.tar.gz",
"platform": null,
"description": "# snappi Extension for IxLoad\n\n[](https://en.wikipedia.org/wiki/MIT_License)\n[](https://www.repostatus.org/#active)\n[](https://github.com/open-traffic-generator/snappi-ixload/actions)\n[](https://pypi.org/project/snappi_ixload)\n[](https://pypi.python.org/pypi/snappi_ixload)\n[](https://lgtm.com/projects/g/open-traffic-generator/snappi-ixload/alerts/)\n[](https://lgtm.com/projects/g/open-traffic-generator/snappi-ixload/context:python)\n[](https://pepy.tech/project/snappi-ixload)\n\nThis extension allows executing test scripts written using [snappi](https://github.com/open-traffic-generator/snappi) against \nIxLoad, (one of) Keysight's implementation of [Open Traffic Generator](https://github.com/open-traffic-generator/models/releases).\n\n> The repository is under active development.\n\nTo start contributing, please see [contributing.md](contributing.md).\n\n## Install on a client \n\n```sh\npython -m pip install --upgrade \"snappi[ixload]\"\n```\n\n## Start scripting\n\n```python\n\"\"\"\nConfigure a raw TCP flow with,\n- tx port as source to rx port as destination\n- frame count 10000, each of size 128 bytes\n- transmit rate of 1000 packets per second\nValidate,\n- frames transmitted and received for configured flow is as expected\n\"\"\"\n\nimport snappi\n# host is Ixload API Server\napi = snappi.api(location='https://localhost:443', ext='ixload')\n# new config\nconfig = api.config()\n# port location is chassis-ip;card-id;port-id\ntx, rx = (\n config.ports\n .port(name='tx', location='192.168.0.1;2;1')\n .port(name='rx', location='192.168.0.1;2;2')\n)\n# configure layer 1 properties\n(d1, d2) = config.devices.device(name=\"d1\").device(name=\"d2\")\n(e1,) = d1.ethernets.ethernet(name=\"d1.e1\")\ne1.connection.port_name = \"p1\"\ne1.mac = \"70:9C:91:69:00:00\"\n(e2,) = d2.ethernets.ethernet(name=\"d2.e2\")\ne2.connection.port_name = \"p2\"\ne2.mac = \"7C:5D:68:26:00:00\"\n(ip1,) = e1.ipv4_addresses.ipv4(name=\"e1.ipv4\")\nip1.address = \"173.173.173.10\"\nip1.gateway = \"0.0.0.0\"\nip1.step = \"0.0.0.1\"\nip1.count = 1\n\n(ip2,) = e2.ipv4_addresses.ipv4(name=\"e2.ipv4\")\nip2.address = \"173.173.173.30\"\nip2.gateway = \"0.0.0.0\"\n\n(t1,) = d1.tcps.tcp(name=\"Tcp1\")\nt1.ip_interface_name = ip1.name\nt1.adjust_tcp_buffers = False\nt1.keep_alive_time = 7000\n\n(t2,) = d2.tcps.tcp(name=\"Tcp2\")\nt2.ip_interface_name = ip2.name\nt2.time_wait_recycle = False\nt2.time_wait_rfc1323_strict = True\nt2.keep_alive_time = 600\n\n(http_1,) = d1.https.http(name=\"HTTP1\")\nhttp_1.tcp_name = t1.name #UDP configs can be mapped http.transport = udp_1.name\nhttp_1.enable_tos = False\nhttp_1.priority_flow_control_class = \"v10\"\n(http_client,) = http_1.clients.client()\nhttp_client.cookie_jar_size = 100\nhttp_client.version = \"1\"\n\n(http_2,) = d2.https.http(name=\"HTTP2\")\nhttp_2.tcp_name = t2.name\t\t#UDP configs can be mapped http.transport = udp_2.name\nhttp_2.enable_tos = False\nhttp_2.priority_flow_control_class = \"v10\"\n(http_server,) = http_2.servers.server()\nhttp_server.rst_timeout = 100\nhttp_server.enable_http2 = False\nhttp_server.port = 80\n\n(get_a,) = http_client.methods.method().method()\n(get1,) = get_a.get.get()\nget1.destination = \"Traffic2_HTTPServer1:80\" \nget1.page = \"./1b.html\"\n# push configuration\napi.set_config(config)\n# start traffic \n\ncs = api.control_state()\ncs.app.state = 'start' #cs.app.state.START \nresponse1 = api.set_control_state(cs) \nprint(response1)\ncs.app.state = 'stop' #cs.app.state.START \napi.set_control_state(cs) \n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The Snappi Ixload Open Traffic Generator Python Package",
"version": "0.0.6",
"project_urls": {
"Homepage": "https://github.com/open-traffic-generator/snappi-ixload"
},
"split_keywords": [
"snappi",
"ixload",
"testing",
"open",
"traffic",
"generator",
"automation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "cce0fbf6b1953cc10811bc30d46d300fb68d87025528310e133a7d4559bf56ff",
"md5": "95a12679e4b1917fa3931d31933b3d93",
"sha256": "ff78580affbe96699727229ec6b21b08b40e695e4e1dcff3514938a43a8e7cc5"
},
"downloads": -1,
"filename": "snappi_ixload-0.0.6-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "95a12679e4b1917fa3931d31933b3d93",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": "<4,>=2.7",
"size": 60993,
"upload_time": "2025-01-23T09:39:31",
"upload_time_iso_8601": "2025-01-23T09:39:31.143745Z",
"url": "https://files.pythonhosted.org/packages/cc/e0/fbf6b1953cc10811bc30d46d300fb68d87025528310e133a7d4559bf56ff/snappi_ixload-0.0.6-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b6f7d057d269b30bab63124c0beec9c4ea7296c4e70c9dbf893192f876e3223e",
"md5": "2589bba8c50fc1eade9f1ef5ea27ee48",
"sha256": "0e43e697aaae061ee1890e8a8499b460d5b36e77bbcfaced8cbdd27735294e84"
},
"downloads": -1,
"filename": "snappi_ixload-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "2589bba8c50fc1eade9f1ef5ea27ee48",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=2.7",
"size": 45518,
"upload_time": "2025-01-23T09:39:32",
"upload_time_iso_8601": "2025-01-23T09:39:32.950657Z",
"url": "https://files.pythonhosted.org/packages/b6/f7/d057d269b30bab63124c0beec9c4ea7296c4e70c9dbf893192f876e3223e/snappi_ixload-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-23 09:39:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "open-traffic-generator",
"github_project": "snappi-ixload",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "mock",
"specs": []
},
{
"name": "ipaddr",
"specs": [
[
"==",
"2.2.0"
]
]
},
{
"name": "netaddr",
"specs": [
[
"==",
"0.8.0"
]
]
},
{
"name": "ipaddress",
"specs": [
[
"==",
"1.0.23"
]
]
},
{
"name": "flake8",
"specs": []
},
{
"name": "dpkt",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "black",
"specs": []
},
{
"name": "PyYAML",
"specs": []
},
{
"name": "flask",
"specs": []
}
],
"lcname": "snappi-ixload"
}