{"id":22383,"library":"snappi","title":"Snappi Open Traffic Generator","description":"Snappi is an open-source Python library for generating and testing network traffic. The current version is 1.53.0, with regular releases approximately every 2-3 weeks. It supports Python >=3.8,<4 and integrates with various traffic generator backends (e.g., IxNetwork, Traffic Server). Snappi provides a unified API to configure traffic flows, endpoints, and capture settings.","status":"active","version":"1.53.0","language":"python","source_language":"en","source_url":"https://github.com/open-traffic-generator/snappi","tags":["network-tests","traffic-generator","open-traffic-generator","testing","automation"],"install":[{"cmd":"pip install snappi","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The library is a package; the main API class is accessed via snappi.Api(), not a submodule.","wrong":"from snappi import snappi","symbol":"Api","correct":"import snappi"}],"quickstart":{"code":"import snappi\n\napi = snappi.Api(address='https://localhost:11009')\nconfig = api.config()\nconfig.flows.flow(name='test_flow').packet().ethernet().eth_ipv4().v4().src.value = '10.0.0.1'\n# No auth needed for local; for remote, set via os.environ.get('SNAPPI_AUTH_TOKEN', '')","lang":"python","description":"Instantiate the API, create a config, and add a simple IPv4 flow."},"warnings":[{"fix":"Always specify full URL: api = snappi.Api(address='https://10.10.10.10:8443')","message":"The API address must include the protocol (http/https) and port. Local default is https://localhost:11009.","severity":"gotcha","affected_versions":"all"},{"fix":"Use config = api.config() then api.set_config(config)","message":"Method set_config() and resulting 'elapsed_time' attribute are deprecated in v1.50+. Use set_config() -> config object directly.","severity":"deprecated","affected_versions":">=1.50.0"},{"fix":"Update API address to https:// or set ssl=False explicitly.","message":"In v1.40.0, the default protocol changed from HTTP to HTTPS. Older code using http:// may fail.","severity":"breaking","affected_versions":">=1.40.0"},{"fix":"Use .packet().ethernet().ipv4() for separate layers or .eth_ipv4() for convenience.","message":"Flow packet layers are built using chained methods (e.g., .packet().ethernet().eth_ipv4()). Order matters; .eth_ipv4() is a shorthand for stacking ethernet and IPv4.","severity":"gotcha","affected_versions":"all"},{"fix":"Use config.port instead of config.ports.","message":"The 'config.ports' property was renamed to 'config.port' in v1.20.0.","severity":"breaking","affected_versions":">=1.20.0"},{"fix":"Check docstring: e.g., ipv4.src.increment.start = '10.0.0.1'; ipv4.src.value = '10.0.0.1'","message":"When setting packet headers, some fields require .value assignment, others use .increment or .decrement. Not all fields support all modes.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-3':30 '1.53.0':23 '2':29 '3.8':35 '4':36 'api':52 'approxim':27 'autom':72 'backend':43 'captur':59 'configur':54 'current':20 'e.g':44 'endpoint':57 'everi':28 'flow':56 'generat':4,14,42,66,70 'integr':38 'ixnetwork':45 'librari':12 'network':17,62 'network-test':61 'open':2,9,68 'open-sourc':8 'open-traffic-gener':67 'provid':49 'python':11,34 'regular':25 'releas':26 'server':47 'set':60 'snappi':1,5,48 'sourc':10 'support':33 'test':16,63,71 'traffic':3,18,41,46,55,65,69 'traffic-gener':64 'unifi':51 'various':40 'version':21 'week':31","created_at":"2026-04-27T17:04:52.942722+00:00","updated_at":"2026-04-27T17:04:52.942722+00:00","problems":[{"fix":"Run 'pip install snappi' in the correct environment.","cause":"snappi not installed or running in a different Python environment.","error":"ModuleNotFoundError: No module named 'snappi'"},{"fix":"Use 'import snappi' then 'snappi.Api(...)'.","cause":"Import was not done correctly (e.g., from snappi import snappi).","error":"AttributeError: module 'snappi' has no attribute 'Api'"},{"fix":"Verify the API address (e.g., 'https://localhost:11009') and ensure the snappi server is running.","cause":"The controller address is incorrect or the server is not running.","error":"ConnectionError: HTTPConnectionPool ... Max retries exceeded"},{"fix":"Upgrade both client and server to the latest version, or pin to compatible versions.","cause":"Client version incompatible with server version (server may be older).","error":"ValueError: Unsupported protocol version"},{"fix":"Ensure you have added flows to config, e.g., config.flows.flow(name='test')...","cause":"Attempting to iterate over a flow before it is properly configured or added.","error":"TypeError: 'NoneType' object is not iterable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.57.0","cli_name":"snappi","cli_version":"sh: 1: snappi: not found","type":"library","homepage":null,"github":"https://github.com/open-traffic-generator/snappi","docs":null,"changelog":null,"pypi":"https://pypi.org/project/snappi/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-29","install_tag":null}}