Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ixia c one refactor #1795

Merged
merged 20 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 60 additions & 44 deletions docs/lab-examples/ixiacone-srl.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,89 @@
| | |
| ----------------------------- | -------------------------------------------------------------------------------------- |
| **Description** | A Keysight ixia-c-one node connected with Nokia SR Linux |
| **Components** | [Keysight ixia-c-one][ixia-c], [Nokia SR Linux][srl] |
| **Description** | Keysight Ixia-c-one node connected with Nokia SR Linux |
| **Components** | [Keysight Ixia-c-one][ixia-c-one], [Nokia SR Linux][srl] |
| **Resource requirements**[^1] | :fontawesome-solid-microchip: 2 <br/>:fontawesome-solid-memory: 2 GB |
| **Topology file** | [ixiacone-srl.clab.yaml][topofile] |
| **Name** | ixiac01 |
| **Version information**[^2] | `containerlab:0.26.0`, `ixia-c-one:0.0.1-2738`, `srlinux:21.11.2`, `docker-ce:20.10.2` |
| **Version information**[^2] | `containerlab:0.46.2`, `ixia-c-one:0.1.0-84`, `srlinux:23.10.1`, `docker-ce:20.10.2` |

## Description

This lab consists of a [Keysight ixia-c-one](../manual/kinds/keysight_ixia-c-one.md) node with 2 ports connected to 2 ports on a Nokia SR Linux node via two point-to-point ethernet links. Both nodes are also connected with their management interfaces to the `containerlab` docker network.
This lab consists of a [Keysight Ixia-c-one](../manual/kinds/keysight_ixia-c-one.md) node with 2 ports connected to 2 ports on a Nokia SR Linux node via two point-to-point ethernet links. Both nodes are also connected with their management interfaces to the `containerlab` docker network.

Keysight ixia-c-one is a single-container distribution of [ixia-c][ixia-c], which in turn is Keysight's reference implementation of [Open Traffic Generator API][otg]. This example will demonstrate how test case designers can leverage Go SDK client [gosnappi][gosnappi] to configure ixia-c traffic generator and execute a test verifying IPv4 forwarding.
Keysight Ixia-c-one is a single-container distribution of [Ixia-c][ixia-c], a software traffic generator and protocol emulator with [Open Traffic Generator (OTG) API][otg]. This example will demonstrate how test case designers can leverage Go SDK client [gosnappi][gosnappi] to create an OTG configuration and execute a test verifying IPv4 forwarding.

<div class="mxgraph" style="max-width:100%;border:1px solid transparent;margin:0 auto; display:block;" data-mxgraph="{&quot;page&quot;:0,&quot;zoom&quot;:1.5,&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;nav&quot;:true,&quot;check-visible-state&quot;:true,&quot;resize&quot;:true,&quot;url&quot;:&quot;https://raw.githubusercontent.com/srl-labs/containerlab/diagrams/ixiac&quot;}"></div>

## Deployment

Change into the lab directory:

```Shell
cd /etc/containerlab/lab-examples/ixiac01
```

Deploy the lab:

```Shell
sudo containerlab deploy
```

## Use cases

This lab allows users to validate an IPv4 traffic forwarding scenario between Keysight ixia-c-one and Nokia SR Linux.
This lab allows users to validate an IPv4 traffic forwarding scenario between Keysight Ixia-c-one and Nokia SR Linux.

### IPv4 Traffic forwarding

<div class="mxgraph" style="max-width:100%;border:1px solid transparent;margin:0 auto; display:block;" data-mxgraph="{&quot;page&quot;:1,&quot;zoom&quot;:1.5,&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;nav&quot;:true,&quot;check-visible-state&quot;:true,&quot;resize&quot;:true,&quot;url&quot;:&quot;https://raw.githubusercontent.com/srl-labs/containerlab/diagrams/ixiac&quot;}"></div>
<div class='mxgraph' style='max-width:100%;border:1px solid transparent;margin:0 auto; display:block;' data-mxgraph='{"page":1,"zoom":2,"highlight":"#0000ff","nav":true,"resize":true,"edit":"_blank","url":"https://raw.githubusercontent.com/srl-labs/containerlab/diagrams/ixiac"}'></div>

This lab demonstrates a simple IPv4 traffic forwarding scenario where

- One Keysight ixia-c-one port acts as a transmit port (IP `1.1.1.1`) and the other as receive port (IP `2.2.2.2`)
- Nokia SR Linux is configured to forward the traffic destined for `20.20.20.0/24` to `2.2.2.2` using static route configuration in the default network instance

#### Configuration
- Keysight Ixia-c-one with two test ports `eth1` and `eth2` connected to Nokia SR Linux with ports `e1-1` and `e1-2` respectively.
- An OTG configuration applied to Ixia-c-one that emulates a router behind each test port: `r1` with IP `1.1.1.1/24` behind `eth1`, and `r2` with IP `2.2.2.1/24` behind `eth2`.
- The test is configured to send 100 IPv4 packets with a rate 10pps from `10.10.10.1` behind `r1` to `10.20.20.x`, where `x` is changed from 1 to 5.
- SR Linux interfaces are configured with `1.1.1.2/24` and `2.2.2.2/24` IPv4 addresses.
- SR Linux is configured to forward the traffic destined for `20.20.20.0/24` to `2.2.2.1` using a static route in the default network instance.

Once the lab is deployed with containerlab, users need to configure the lab nodes to forward and receive traffic.
Logical IP topology of the lab is shown below:

=== "SR Linux"
SR Linux node comes up pre-configured with the commands listed in [srl.cfg][srlcfg] file which configure IPv4 addresses on both interfaces and install a static route to route the traffic coming from ixia-c.
=== "Keysight ixia-c-one"
IPv4 addresses for data ports eth1/2 of ixia-c node are configured with `./ifcfg` scripts executed by containerlab on successful deployment[^3]. These commands are listed in the topology file under `exec` node property.
<div class='mxgraph' style='max-width:100%;border:1px solid transparent;margin:0 auto; display:block;' data-mxgraph='{"page":2,"zoom":2,"highlight":"#0000ff","nav":true,"resize":true,"edit":"_blank","url":"https://raw.githubusercontent.com/srl-labs/containerlab/diagrams/ixiac"}'></div>

When a lab boots up, containerlab will also execute a command on SR Linux node to fetch MAC address of its `e1-1` interface which is connected to tx port of ixia-c-one. Write down this MAC address[^4] as it will serve as an argument in the test script we will run afterwards.
#### Configuration

```bash
# partial output of `containerlab deploy` cmd that lists fetched MAC address
INFO[0019] Executed command 'bash -c "ip l show e1-1 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | head -1"' on clab-ixiac01-srl. stdout:
1a:b0:01:ff:00:01
```
During the lab deployment and test execution the following configuration is applied to the lab nodes to forward and receive traffic.

#### Execution
- **SR Linux**
SR Linux node comes up pre-configured with the commands listed in [srl.cfg][srlcfg] file which configure IPv4 addresses on both interfaces and install a static route to forward the traffic coming from ixia-c.

The test case is written in Go language hence [Go >= 1.17](https://go.dev/doc/install) needs to be installed first.
- **Keysight ixia-c-one**
IPv4 addresses for `ixia-c-one` node interfaces are configured via the OTG API as part of the [`ipv4_forwarding.go`][ipv4_forwarding] script.

Once installed, change into the lab directory:
#### Execution

```
cd /etc/containerlab/lab-examples/ixiac01
```
The test case is written in Go language. To run it, [Go >= 1.21](https://go.dev/doc/install) needs to be installed first.

Run the test with MAC address obtained in previous step:
Once installed, run the test:

```
go run ipv4_forwarding.go -dstMac="<MAC address>"
```Shell
go run ipv4_forwarding.go
```

The test is configured to send 100 IPv4 packets with a rate 10pps from `10.10.10.1` to `10.20.20.x`, where `x` is changed from 1 to 5. Once 100 packets are sent, the test script checks that we received all the sent packets.
Once 100 packets are sent, the test script checks that we received all the sent packets.

During the test run you will see flow metrics reported each second with the current flow data such as:

```
2022/04/12 16:28:10 Metrics Response:
```yaml
2023/12/18 11:14:12 Metrics Response:
choice: flow_metrics
flow_metrics:
- bytes_rx: "44032"
bytes_tx: "0"
bytes_tx: "44032"
frames_rx: "86"
frames_rx_rate: 10
frames_rx_rate: 9
frames_tx: "86"
frames_tx_rate: 9
name: p1.v4.p2
name: r1.v4.r2
transmit: started
```

Expand All @@ -87,29 +95,37 @@ If the condition is not met in 10 seconds, the test will timeout, hence indicati
Upon success, last flow metrics output will indicate the latest status with `transmit` set to `stopped`.

```yaml
2022/04/12 16:28:11 Metrics Response:
2023/12/18 11:14:13 Metrics Response:
choice: flow_metrics
flow_metrics:
- bytes_rx: "51200"
bytes_tx: "0"
bytes_tx: "51200"
frames_rx: "100"
frames_rx_rate: 9
frames_tx: "100"
frames_tx_rate: 10
name: p1.v4.p2
name: r1.v4.r2
transmit: stopped
```

[ixia-c]: https://github.com/open-traffic-generator/ixia-c
[otg]: https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/open-traffic-generator/models/master/artifacts/openapi.yaml
## Cleanup

To stop the lab, use:

```Shell
sudo containerlab destroy --cleanup
```

[ixia-c]: https://ixia-c.dev/
[ixia-c-one]: https://ixia-c.dev/deployments-containerlab/
[otg]: https://otg.dev/
[gosnappi]: https://github.com/open-traffic-generator/snappi/tree/main/gosnappi
[srl]: https://www.nokia.com/networks/products/service-router-linux-NOS/
[topofile]: https://github.com/srl-labs/containerlab/blob/main/lab-examples/ixiac01/ixiac01.clab.yml
[srlcfg]: https://github.com/srl-labs/containerlab/blob/main/lab-examples/ixiac01/srl.cfg
[ipv4_forwarding]: https://github.com/srl-labs/containerlab/blob/main/lab-examples/ixiac01/ipv4_forwarding.go

[^1]: Resource requirements are provisional. Consult with the installation guides for additional information.
[^2]: The lab has been validated using these versions of the required tools/components. Using versions other than stated might lead to a non-operational setup process.
[^3]: Replace `add` with `del` to undo.
[^4]: The docker commands above shall not be required for upcoming releases of ixia-c-one with added ARP/ND capability.

<script type="text/javascript" src="https://viewer.diagrams.net/js/viewer-static.min.js" async></script>
Loading
Loading