Skip to content

Commit 4e21c8e

Browse files
authored
Merge pull request #27 from open-traffic-generator/otgdev-fixes
More fixes for otg.dev
2 parents 98d4d11 + 09cd5de commit 4e21c8e

File tree

8 files changed

+467
-469
lines changed

8 files changed

+467
-469
lines changed

README.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Open Traffic Generator examples
2-
[![CI](https://github.com/open-traffic-generator/otg-examples/actions/workflows/ci.yml/badge.svg)](https://github.com/open-traffic-generator/otg-examples/actions/workflows/ci.yml)
32

43
## Overview
54

@@ -38,50 +37,48 @@ To manage deployment of the example labs, we use one of the following declarativ
3837

3938
## CI with Github Actions
4039

40+
[![CI](https://github.com/open-traffic-generator/otg-examples/actions/workflows/ci.yml/badge.svg)](https://github.com/open-traffic-generator/otg-examples/actions/workflows/ci.yml)
4141
Some of the lab examples include Github Action workflow for executing OTG tests on any changes to the lab code. This could serve as a template for your CI workflow.
4242

4343
## Reference
4444

45-
| Lab | OTG Tool | DUT | Client | Infrastructure | CI |
46-
| ------------------------------------------------------------------------------------------------------------------------- | ----------- | ---- | ---------- | -------------- | --- |
47-
| [Ixia-c traffic engine](https://github.com/open-traffic-generator/otg-examples/blob/main/docker-compose/b2b) | Ixia-c TE | B2B | `otgen` | Compose | yes |
48-
| [KENG 3 pairs](https://github.com/open-traffic-generator/otg-examples/blob/main/docker-compose/b2b-3pair) | KENG TE | B2B | `otgen` | Compose | yes |
49-
| [KENG BGP and traffic](https://github.com/open-traffic-generator/otg-examples/blob/main/docker-compose/cpdp-b2b) | KENG PE+TE | B2B | `gosnappi` | Compose | yes |
50-
| [FRR+KENG ARP, BGP and traffic](https://github.com/open-traffic-generator/otg-examples/blob/main/docker-compose/cpdp-frr) | KENG PE+TE | FRR | `curl` | Compose | yes |
51-
| [Hello, snappi! Welcome to the Clab!](https://github.com/open-traffic-generator/otg-examples/blob/main/clab/ixia-c-b2b) | Ixia-c-one | B2B | `snappi` | Containerlab | no |
52-
| [Ixia-c-one and FRR](https://github.com/open-traffic-generator/otg-examples/blob/main/clab/ixia-c-te-frr) | Ixia-c TE | FRR | `otgen` | Containerlab | no |
53-
| [Remote Triggered Black Hole](https://github.com/open-traffic-generator/otg-examples/blob/main/clab/rtbh) | Ixia-c-one | FRR | `gosnappi` | Containerlab | yes |
45+
| Lab | OTG Tool | DUT | Client | Infrastructure | CI |
46+
| ------------------------------------------------------------------------------------------------------------------------- | ----------- | ---- | ---------------- | -------------- | --- |
47+
| [B2B Ixia-c Traffic](https://github.com/open-traffic-generator/otg-examples/blob/main/docker-compose/b2b) | Ixia-c TE | B2B | `otgen` | Compose | yes |
48+
| [FRR Ixia-c Traffic](https://github.com/open-traffic-generator/otg-examples/blob/main/clab/ixia-c-te-frr) | Ixia-c TE | FRR | `otgen` | Containerlab | no |
49+
| [3xB2B KENG Traffic](https://github.com/open-traffic-generator/otg-examples/blob/main/docker-compose/b2b-3pair) | KENG TE | B2B | `otgen` | Compose | yes |
50+
| [B2B KENG BGP and traffic](https://github.com/open-traffic-generator/otg-examples/blob/main/docker-compose/cpdp-b2b) | KENG PE+TE | B2B | `gosnappi` | Compose | yes |
51+
| [FRR KENG ARP, BGP and traffic](https://github.com/open-traffic-generator/otg-examples/blob/main/docker-compose/cpdp-frr) | KENG PE+TE | FRR | `curl` & `otgen` | Compose & Clab | yes |
52+
| [Hello, snappi! Welcome to the Clab!](https://github.com/open-traffic-generator/otg-examples/blob/main/clab/ixia-c-b2b) | Ixia-c-one | B2B | `snappi` | Containerlab | no |
53+
| [RTBH](https://github.com/open-traffic-generator/otg-examples/blob/main/clab/rtbh) | Ixia-c-one | FRR | `gosnappi` | Containerlab | yes |
54+
5455

56+
## Lab Descriptions
5557

56-
## Quick Lab Descriptions
58+
### [B2B Ixia-c Traffic](docker-compose/b2b)
5759

58-
### [Ixia-c traffic engine back-to-back setup with Docker Compose](docker-compose/b2b)
60+
Ixia-c traffic engine back-to-back setup with Docker Compose. Fast and easy way to get started using [`otgen`](https://github.com/open-traffic-generator/otgen) CLI tool.
5961

60-
Fast and easy way to get started using [`otgen`](https://github.com/open-traffic-generator/otgen) CLI tool.
62+
### [FRR Ixia-c Traffic](clab/ixia-c-te-frr)
6163

62-
### [KENG 3 back-to-back pairs setup with Docker Compose](docker-compose/b2b-3pair)
63-
This lab is an extension of [Ixia-c back-2-back lab](docker-compose/b2b/README.md) traffic engine setup with more port pairs that is allowed with free version of Ixia-c. Use this lab to validate Ixia-c commercial version – KENG for basic traffic operations.
64+
Ixia-c Traffic Engine and FRR. Demonstrates how to deploy Ixia-c Traffic Engine nodes in Containerlab. This setup has an FRR container as a Device Under Test.
6465

65-
### [KENG back-to-back BGP and traffic setup with Docker Compose](docker-compose/cpdp-b2b)
66+
### [3xB2B KENG Traffic](docker-compose/b2b-3pair)
6667

67-
This is an extended version of a basic [Ixia-c back-2-back lab](docker-compose/b2b/README.md) with [Keysight Elastic Network Generator](https://www.keysight.com/us/en/products/network-test/protocol-load-test/keysight-elastic-network-generator.html) components added to emulate L2-3 protocols like BGP.
68+
KENG 3 back-to-back pairs setup with Docker Compose. This lab is an extension of [Ixia-c back-2-back lab](docker-compose/b2b/README.md) traffic engine setup with more port pairs that is allowed with free version of Ixia-c. Use this lab to validate Ixia-c commercial version – KENG for basic traffic operations.
6869

69-
### [KENG ARP, BGP and traffic with FRR as a DUT](docker-compose/cpdp-frr)
70+
### [B2B KENG BGP and traffic](docker-compose/cpdp-b2b)
7071

71-
This lab demonstrates validation of an FRR DUT for basic BGP peering, prefix announcements and passing of traffic between announced subnets.
72+
KENG back-to-back BGP and traffic setup with Docker Compose. This is an extended version of a basic [Ixia-c back-2-back lab](docker-compose/b2b/README.md) with [Keysight Elastic Network Generator](https://www.keysight.com/us/en/products/network-test/protocol-load-test/keysight-elastic-network-generator.html) components added to emulate L2-3 protocols like BGP.
7273

73-
### [Ixia-c Traffic Engine and FRR](clab/ixia-c-te-frr)
74+
### [FRR KENG ARP, BGP and traffic](docker-compose/cpdp-frr)
7475

75-
Demonstrates how to deploy Ixia-c Traffic Engine nodes in Containerlab. This setup has an FRR container as a Device Under Test.
76+
KENG ARP, BGP and traffic with FRR as a DUT. This lab demonstrates validation of an FRR DUT for basic BGP peering, prefix announcements and passing of traffic between announced subnets. The lab has two alternative deployment methods: Compose as well as Containerlab.
7677

7778
### [Hello, snappi! Welcome to the Clab!](clab/ixia-c-b2b)
7879

7980
Basics of creating a Python program to control Ixia-c-one node, all packaged in a Containerlab topology.
8081

81-
### [KENG ARP, BGP and traffic with FRR as a DUT](docker-compose/cpdp-frr)
82-
83-
This lab demonstrates validation of an FRR DUT for basic BGP peering, prefix announcements and passing of traffic between announced subnets. Same lab as in basic examples section, but with Containerlab.
84-
85-
### [Remote Triggered Black Hole Lab](clab/rtbh) (RTBH)
82+
### [RTBH](clab/rtbh)
8683

87-
RTBH is a common DDoS mitigation technique which uses BGP announcements to request an ISP to drop all traffic to an IP address under a DDoS attack.
84+
Remote Triggered Black Hole (RTBH) is a common DDoS mitigation technique which uses BGP announcements to request an ISP to drop all traffic to an IP address under a DDoS attack.

clab/ixia-c-b2b/README.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ This is a simple lab where an Ixia-c-one node has two traffic ports connected ba
1414

1515
1. Clone this repository to the Linux host where you want to run the lab. Do this only once.
1616

17-
```Shell
18-
git clone --recurse-submodules https://github.com/open-traffic-generator/otg-examples.git
19-
```
17+
```Shell
18+
git clone --recurse-submodules https://github.com/open-traffic-generator/otg-examples.git
19+
```
2020

2121
2. Navigate to the lab folder
2222

23-
```Shell
24-
cd otg-examples/clab/ixia-c-b2b
25-
```
23+
```Shell
24+
cd otg-examples/clab/ixia-c-b2b
25+
```
2626

2727
## Prepare a `snappi` container image
2828

@@ -56,54 +56,54 @@ sudo -E containerlab destroy -t topo.yml
5656

5757
1. If you're on Mac, an example below can be used to create an Ubuntu 20.04LTS VM `otg-demo`, using [Multipass](https://multipass.run/). Ubuntu 22.04 is not yet supported for this test.
5858
59-
```Shell
60-
multipass launch 20.04 -n otg-demo -c4 -m8G -d32G
61-
multipass shell otg-demo
62-
sudo apt update && sudo apt install docker.io -y
63-
bash -c "$(curl -sL https://get.containerlab.dev)"
64-
```
59+
```Shell
60+
multipass launch 20.04 -n otg-demo -c4 -m8G -d32G
61+
multipass shell otg-demo
62+
sudo apt update && sudo apt install docker.io -y
63+
bash -c "$(curl -sL https://get.containerlab.dev)"
64+
```
6565
6666
2. Delete the VM after testing is done
6767
68-
```Shell
69-
multipass stop otg-demo
70-
multipass delete otg-demo
71-
```
68+
```Shell
69+
multipass stop otg-demo
70+
multipass delete otg-demo
71+
```
7272
7373
### Containerlab VM deployment in Google Cloud
7474
7575
1. Create a VM in a default VPC
7676
77-
```Shell
78-
gcloud compute instances create otg-demo \
79-
--subnet=default \
80-
--machine-type=e2-standard-8 \
81-
--image-family=ubuntu-2004-lts \
82-
--image-project=ubuntu-os-cloud \
83-
--boot-disk-size=30GB \
84-
--boot-disk-device-name=otg-demo \
85-
--tags=otg-demo
86-
87-
gcloud compute ssh otg-demo
88-
sudo apt update && sudo apt install docker.io -y
89-
bash -c "$(curl -sL https://get.containerlab.dev)"
90-
```
77+
```Shell
78+
gcloud compute instances create otg-demo \
79+
--subnet=default \
80+
--machine-type=e2-standard-8 \
81+
--image-family=ubuntu-2004-lts \
82+
--image-project=ubuntu-os-cloud \
83+
--boot-disk-size=30GB \
84+
--boot-disk-device-name=otg-demo \
85+
--tags=otg-demo
86+
87+
gcloud compute ssh otg-demo
88+
sudo apt update && sudo apt install docker.io -y
89+
bash -c "$(curl -sL https://get.containerlab.dev)"
90+
```
9191
9292
2. Delete all resources and the VM after testing is done
9393
94-
```Shell
95-
gcloud compute instances delete otg-demo
96-
```
94+
```Shell
95+
gcloud compute instances delete otg-demo
96+
```
9797
9898
## Misc
9999
100100
### CLI access to nodes
101101
102-
```Shell
103-
# ixia-c
104-
sudo docker exec -it clab-ixcb2b-ixia-c sh
105-
sudo docker exec -it clab-ixcb2b-snappi bash
106-
```
102+
```Shell
103+
# ixia-c
104+
sudo docker exec -it clab-ixcb2b-ixia-c sh
105+
sudo docker exec -it clab-ixcb2b-snappi bash
106+
```
107107
108108
## Credits
109109

clab/ixia-c-te-frr/README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ In this setup, we demonstrate how to deploy Ixia-c Traffic Engine nodes in Conta
4141

4242
1. Clone this repository to the Linux host where you want to run the lab. Do this only once.
4343

44-
```Shell
45-
git clone https://github.com/open-traffic-generator/otg-examples.git
46-
```
44+
```Shell
45+
git clone https://github.com/open-traffic-generator/otg-examples.git
46+
```
4747

4848
2. Navigate to the lab folder
4949

50-
```Shell
51-
cd otg-examples/clab/ixia-c-te-frr
52-
```
50+
```Shell
51+
cd otg-examples/clab/ixia-c-te-frr
52+
```
5353

5454
## Deploy a lab
5555

@@ -61,23 +61,23 @@ sudo containerlab deploy
6161

6262
1. Read MAC addresses assigned to the nodes
6363

64-
```Shell
65-
TE1SMAC=`cat clab-ixctedut/topology-data.json | jq -r '.links[0]["a"].mac'`
66-
TE1DMAC=`cat clab-ixctedut/topology-data.json | jq -r '.links[0]["z"].mac'`
67-
TE2SMAC=`cat clab-ixctedut/topology-data.json | jq -r '.links[1]["a"].mac'`
68-
TE2DMAC=`cat clab-ixctedut/topology-data.json | jq -r '.links[1]["z"].mac'`
69-
```
64+
```Shell
65+
TE1SMAC=`cat clab-ixctedut/topology-data.json | jq -r '.links[0]["a"].mac'`
66+
TE1DMAC=`cat clab-ixctedut/topology-data.json | jq -r '.links[0]["z"].mac'`
67+
TE2SMAC=`cat clab-ixctedut/topology-data.json | jq -r '.links[1]["a"].mac'`
68+
TE2DMAC=`cat clab-ixctedut/topology-data.json | jq -r '.links[1]["z"].mac'`
69+
```
7070

7171
2. Run traffic defined in [otg.yml](otg.yml) with `otgen` tool, taking care to replace stub MAC addresses with current values
7272

73-
```Shell
74-
cat otg.yml | \
75-
sed "s/00:00:00:00:11:aa/$TE1SMAC/g" | sed "s/00:00:00:00:11:bb/$TE1DMAC/g" | \
76-
sed "s/00:00:00:00:22:aa/$TE2SMAC/g" | sed "s/00:00:00:00:22:bb/$TE2DMAC/g" | \
77-
otgen run -k 2>/dev/null| \
78-
otgen transform -m port | \
79-
otgen display -m table
80-
```
73+
```Shell
74+
cat otg.yml | \
75+
sed "s/00:00:00:00:11:aa/$TE1SMAC/g" | sed "s/00:00:00:00:11:bb/$TE1DMAC/g" | \
76+
sed "s/00:00:00:00:22:aa/$TE2SMAC/g" | sed "s/00:00:00:00:22:bb/$TE2DMAC/g" | \
77+
otgen run -k 2>/dev/null| \
78+
otgen transform -m port | \
79+
otgen display -m table
80+
```
8181

8282
## Destroy the lab
8383

clab/rtbh/README.md

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Read a [blog post](https://blogs.keysight.com/blogs/tech/traf-gen.entry.html/202
2020

2121
1. Clone this repository to the Linux host where you want to run the lab. Do this only once.
2222

23-
```Shell
24-
git clone --single-branch https://github.com/open-traffic-generator/otg-examples.git
25-
```
23+
```Shell
24+
git clone --single-branch https://github.com/open-traffic-generator/otg-examples.git
25+
```
2626

2727
2. Navigate to the lab folder
2828

29-
```Shell
30-
cd otg-examples/clab/rtbh
31-
```
29+
```Shell
30+
cd otg-examples/clab/rtbh
31+
```
3232

3333
## Prepare a `gosnappi` container image
3434

@@ -73,51 +73,51 @@ sudo -E containerlab destroy -t topo.yml
7373

7474
1. If you're on Mac, an example below can be used to create an Ubuntu 20.04LTS VM `otg-demo`, using [Multipass](https://multipass.run/). Ubuntu 22.04 is not yet supported for this test.
7575
76-
```Shell
77-
multipass launch 20.04 -n otg-demo -c4 -m8G -d32G
78-
multipass shell otg-demo
79-
sudo apt update && sudo apt install docker.io -y
80-
bash -c "$(curl -sL https://get.containerlab.dev)"
81-
```
76+
```Shell
77+
multipass launch 20.04 -n otg-demo -c4 -m8G -d32G
78+
multipass shell otg-demo
79+
sudo apt update && sudo apt install docker.io -y
80+
bash -c "$(curl -sL https://get.containerlab.dev)"
81+
```
8282
8383
2. Delete the VM after testing is done
8484
85-
```Shell
86-
multipass stop otg-demo
87-
multipass delete otg-demo
88-
```
85+
```Shell
86+
multipass stop otg-demo
87+
multipass delete otg-demo
88+
```
8989
9090
### Containerlab VM deployment in Google Cloud
9191
9292
1. Create a VM in a default VPC, with needed firewall rules and all the nessesary components
9393
94-
```Shell
95-
MYIP=`curl ifconfig.me`
96-
97-
gcloud compute firewall-rules create otg-demo-allow-8008 --description="Allow tcp 8008 ingress to any instance tagged as otg-demo" --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:8008 --source-ranges="$MYIP/32" --target-tags=otg-demo
98-
gcloud compute firewall-rules create otg-demo-allow-8080 --description="Allow tcp 8080 ingress to any instance tagged as otg-demo" --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:8080 --source-ranges="$MYIP/32" --target-tags=otg-demo
99-
100-
gcloud compute instances create otg-demo \
101-
--subnet=default \
102-
--machine-type=e2-standard-8 \
103-
--image-family=ubuntu-2004-lts \
104-
--image-project=ubuntu-os-cloud \
105-
--boot-disk-size=30GB \
106-
--boot-disk-device-name=otg-demo \
107-
--tags=otg-demo
108-
109-
gcloud compute ssh otg-demo
110-
sudo apt update && sudo apt install docker.io -y
111-
bash -c "$(curl -sL https://get.containerlab.dev)"
112-
```
94+
```Shell
95+
MYIP=`curl ifconfig.me`
96+
97+
gcloud compute firewall-rules create otg-demo-allow-8008 --description="Allow tcp 8008 ingress to any instance tagged as otg-demo" --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:8008 --source-ranges="$MYIP/32" --target-tags=otg-demo
98+
gcloud compute firewall-rules create otg-demo-allow-8080 --description="Allow tcp 8080 ingress to any instance tagged as otg-demo" --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:8080 --source-ranges="$MYIP/32" --target-tags=otg-demo
99+
100+
gcloud compute instances create otg-demo \
101+
--subnet=default \
102+
--machine-type=e2-standard-8 \
103+
--image-family=ubuntu-2004-lts \
104+
--image-project=ubuntu-os-cloud \
105+
--boot-disk-size=30GB \
106+
--boot-disk-device-name=otg-demo \
107+
--tags=otg-demo
108+
109+
gcloud compute ssh otg-demo
110+
sudo apt update && sudo apt install docker.io -y
111+
bash -c "$(curl -sL https://get.containerlab.dev)"
112+
```
113113
114114
2. Delete all resources and the VM after testing is done (run them one by one, as you'll need to confirm it is OK to delete)
115115

116-
```Shell
117-
gcloud compute instances delete otg-demo
118-
gcloud compute firewall-rules delete otg-demo-allow-8008
119-
gcloud compute firewall-rules delete otg-demo-allow-8080
120-
```
116+
```Shell
117+
gcloud compute instances delete otg-demo
118+
gcloud compute firewall-rules delete otg-demo-allow-8008
119+
gcloud compute firewall-rules delete otg-demo-allow-8080
120+
```
121121

122122
## Misc
123123

@@ -131,21 +131,22 @@ Open the link in the browser to see a graphical representation of the topology.
131131

132132
### CLI access to nodes
133133

134-
```Shell
135-
# pe-router
136-
sudo docker exec -it clab-rtbh-pe-router vtysh
137-
# ce-router
138-
sudo docker exec -it clab-rtbh-ce-router vtysh
139-
# ixia
140-
sudo docker exec -it clab-rtbh-ixia sh
141-
# controller
142-
sudo docker exec -it clab-rtbh-controller sh
143-
```
134+
```Shell
135+
# pe-router
136+
sudo docker exec -it clab-rtbh-pe-router vtysh
137+
# ce-router
138+
sudo docker exec -it clab-rtbh-ce-router vtysh
139+
# ixia
140+
sudo docker exec -it clab-rtbh-ixia sh
141+
# controller
142+
sudo docker exec -it clab-rtbh-controller sh
143+
```
144144

145145

146146

147147
## Credits
148148

149149
Original lab design:
150-
* [BGP Remotely Triggered Black Hole (RTBH)](https://blog.sflow.com/2022/04/bgp-remotely-triggered-blackhole-rtbh.html)
151-
* [sflow-rt github repository](https://github.com/sflow-rt/containerlab)
150+
151+
* [BGP Remotely Triggered Black Hole (RTBH)](https://blog.sflow.com/2022/04/bgp-remotely-triggered-blackhole-rtbh.html)
152+
* [sflow-rt github repository](https://github.com/sflow-rt/containerlab)

0 commit comments

Comments
 (0)