This is a simple lab where an Ixia-c-one node has two traffic ports connected back-2-back in a Containerlab environment. The goal is to demonstrate basics of creating a Python program to control Ixia-c via snappi
SDK.
- Linux host or VM with sudo permissions and Docker support. See some ready-to-use options below
git
- how to install depends on your Linux distro.- Docker
- Containerlab
-
Clone this repository to the Linux host where you want to run the lab. Do this only once.
git clone --recurse-submodules https://github.com/open-traffic-generator/otg-examples.git
-
Navigate to the lab folder
cd otg-examples/clab/ixia-c-b2b
Run the following only once, to build a container image where snappi
program will execute:
sudo docker build -t snappi:local .
sudo -E containerlab deploy -t topo.yml
sudo docker exec -it clab-ixcb2b-snappi bash -c "python otg.py"
sudo -E containerlab destroy -t topo.yml
-
If you're on Mac, an example below can be used to create an Ubuntu 20.04LTS VM
otg-demo
, using Multipass. Ubuntu 22.04 is not yet supported for this test.multipass launch 20.04 -n otg-demo -c4 -m8G -d32G multipass shell otg-demo sudo apt update && sudo apt install docker.io -y bash -c "$(curl -sL https://get.containerlab.dev)"
-
Delete the VM after testing is done
multipass stop otg-demo multipass delete otg-demo
-
Create a VM in a default VPC
gcloud compute instances create otg-demo \ --subnet=default \ --machine-type=e2-standard-8 \ --image-family=ubuntu-2004-lts \ --image-project=ubuntu-os-cloud \ --boot-disk-size=30GB \ --boot-disk-device-name=otg-demo \ --tags=otg-demo gcloud compute ssh otg-demo sudo apt update && sudo apt install docker.io -y bash -c "$(curl -sL https://get.containerlab.dev)"
-
Delete all resources and the VM after testing is done
gcloud compute instances delete otg-demo
# ixia-c
sudo docker exec -it clab-ixcb2b-ixia-c sh
sudo docker exec -it clab-ixcb2b-snappi bash
This work os based on: