Code Monkey home page Code Monkey logo

otg-examples's Introduction

Open Traffic Generator examples

CI

Overview

OTG examples repository is a great way to get started with Open Traffic Generator API. It features a collection of software-only network labs ranging from very simple to more complex. To setup network labs in software we use containerized or virtualized NOS images.

OTG Tools

There are several implementations of OTG API. All the labs in this repository use Keysight Elastic Network Generator with different types of test ports:

  • Ixia-c: Ixia-c containerized software Traffic Engine (TE) and Protocol Engine (PE)
  • Ixia-c-one: a single-container package of Ixia-c for Containerlab
  • IxOS Hardware: Keysight Elastic Network Generator with Keysight/Ixia L23 Network Test Hardware

Device Under Test

Many network vendors provide versions of their Network Operating Systems as a CNF or VNF. To make OTG Examples available for a widest range of users, our labs use open-source or freely available NOSes like FRR. Replacing FRR with a container from a different vendor is a matter of modifying one of the lab examples.

Some examples don't have any DUT and use back-2-back connections between Test Ports. These are quite useful to make sure the Traffic Generator part works just fine by itself, before introducing a DUT.

OTG Client

A job of an OTG Client is to communicating with a Traffic Generator via the OTG API and request it to perform tasks such as applying a configuration, starting protocols, running traffic, collecting metrics. Each example uses one (or sometimes more) of the following OTG Clients:

  • curl - The most basic utility for any kind of REST API calls, including OTG
  • otgen - This command-line utility comes as part of OTG toolkit. It is capable of manipulating a wide range of OTG features while hiding a lot of complexity from a user
  • snappi - Test scripts written in snappi, an auto-generated Python module, can be executed against any traffic generator conforming to the Open Traffic Generator API.
  • gosnappi - Similar to snappi, test scripts written in gosnappi, an auto-generated Go module, can be executed against any traffic generator conforming to the Open Traffic Generator API.
  • ondatra – Ondatra is a framework for writing and running tests against both real and containerized network devices. When executing a test via the Open Traffic Generator API, it uses gosnappi client library internally.

Infrastructure

To manage deployment of the example labs, we use one of the following tools:

  • Docker Compose - general-purpose tool for defining and running multi-container Docker applications
  • Containerlab - simple yet powerful specialized tool for orchestrating and managing container-based networking labs
  • Ixia-c Operator – Ixia-c deployment orchestration engine compatible with K8s/KNE as well as Docker for Hybrid mode
  • OpenConfig KNE – Kubernetes Network Emulation, which is a Google initiative to develop tooling for quickly setting up topologies of containers running various device OSes.

CI with Github Actions

Most 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.

Reference

Lab OTG Tool DUT Client Infrastructure CI
B2B Ixia-c Traffic Ixia-c TE B2B otgen & snappi Compose yes
Static B2B LAG Ixia-c TE B2B otgen Containerlab yes
FRR Ixia-c Traffic Ixia-c TE FRR otgen Containerlab yes
3xB2B Ixia-c Traffic Ixia-c TE B2B otgen Compose yes
B2B Ixia-c BGP and traffic Ixia-c PE+TE B2B gosnappi Compose yes
FRR Ixia-c ARP, BGP and traffic Ixia-c PE+TE FRR curl & otgen Compose & Clab yes
Hello, snappi! Welcome to the Clab! Ixia-c-one B2B snappi Containerlab yes
Dear snappi, please meet Scapy! Ixia-c-one B2B scapy & snappi Containerlab yes
RTBH Ixia-c-one FRR gosnappi Containerlab yes
FeatureProfiles in Hybrid mode Ixia-c PE+TE B2B ondatra KENG Operator yes
B2B IxOS Hardware IxOS Hardware B2B snappi & ondatra Compose no
cEOS BGP and Traffic in KNE Ixia-c PE+TE cEOS otgen KNE no
AWS DPDK Ixia-c Traffic Ixia-c TE EC2 snappi Terraform & Compose no

Lab Descriptions

Ixia-c traffic engine back-to-back setup with Docker Compose. Fast and easy way to get started using otgen CLI tool.

Two Ixia-c Traffic Engines connected back-2-back in a Containerlab environment over two pairs of ports in a LAG. The goal is to demonstrate how to create a static Link Aggregation Group (LAG) consisting of two ports and run traffic over the LAG interface.

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.

Ixia-c 3 back-to-back pairs setup with Docker Compose. This lab is an extension of Ixia-c back-2-back lab traffic engine setup with more port pairs that is allowed with free version of Ixia-c. Use this lab to validate Ixia-c commercial licensing for basic traffic operations.

Ixia-c back-to-back BGP and traffic setup with Docker Compose. This is an extended version of a basic Ixia-c back-2-back lab with Ixia-c Protocol Engine added to emulate L2-3 protocols like BGP.

Ixia-c 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.

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

Joint use of Scapy packet crafting Python module with snappi, to generate custom DNS flows via Ixia-c-one node.

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.

An introduction to OpenConfig FeatureProfiles test suites built with the Open Traffic Generator API.

Demonstration of how the OTG API can be used to control Keysight/Ixia L23 Network Test Hardware, including an example of running OpenConfig FeatureProfiles test suites.

Validation of Arista cEOSLab DUT for basic BGP peering, prefix announcements and passing of traffic between announced subnets. To run OTG protocols and flows, Keysight Elastic Network Generator Community Edition is used with Ixia-c Traffic and Protocol Engine ports. To run the lab, OpenConfig KNE is used on top of a KIND cluster – K8s environment running inside a single Docker container.

An AWS deployment where Ixia-c has two traffic ports connected within a single VPC subnet. Performance improvements are enabled through DPDK support.

otg-examples's People

Contributors

apratimmukherjee avatar armdupre avatar biplamal avatar bortok avatar dependabot[bot] avatar dosarudaniel avatar hashwini-keysight avatar indranibh avatar isgmano avatar renovate[bot] avatar vladlaslau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

otg-examples's Issues

FRR DUT: transmit rate is a limiting factor

With rate set as:

flows:
- duration:
    choice: fixed_packets
    fixed_packets:
      gap: 12
      packets: 1000000
  metrics:
    enable: true
    loss: false
    timestamps: false
  rate:
    choice: pps
    pps: "100000"
  size:
    choice: fixed
    fixed: 512

the limiting factor is TX rate. The DUT passes 100% of the packets

2022/05/15 21:45:42 Time passed: 11.080817133s out of 10s
2022/05/15 21:45:42 Stopping traffic...
2022/05/15 21:45:42 Metrics Response:
choice: flow_metrics
flow_metrics:
- bytes_rx: "211071488"
  bytes_tx: "0"
  frames_rx: "412249"
  frames_rx_rate: 33645
  frames_tx: "412249"
  frames_tx_rate: 32901
  name: p1.v4.p2
  transmit: stopped

--- PASS: Test_RTBH_IPv4_Ingress_Traffic (11.14s)

KNE Lab con BGP, error with p1 and p2

Hi, I am testing the KNE Lab with BGP and I am getting this error, this corresponds to not having access to the "ghcr.io/open-traffic-generator/licensed/ixia-c-protocol-engine" image?.

When executing this:

kubectl exec -it otgen -- /bin/bash
export OTG_API="https://service-https-keng-controller.keng-ceos.svc.cluster.local:8443"
otgen create device -n otg1 -p p1 -l eth1 --ip 192.0.2.1 --prefix 30 --gw 192.0.2.2 |
otgen add device -n otg2 -p p2 -l eth2 --ip 192.0.2.5 --prefix 30 --gw 192.0.2.6 |
otgen add bgp -d otg1 --asn 1111 --route 198.51.100.0/24 |
otgen add bgp -d otg2 --asn 2222 --route 203.0.113.0/24 |
otgen add flow -n f-1-2 --tx otg1 --rx otg2 --src 198.51.100.1 --dst 203.0.113.1 --count 1000 --rate 100 --size 128 |
otgen add flow -n f-2-1 --tx otg2 --rx otg1 --dst 198.51.100.1 --src 203.0.113.1 --count 2000 --rate 200 --size 256 |
otgen --log info run -k -m flow | otgen transform -m flow | otgen display -m table
exit

this is the error

INFO[0000] Applying OTG config...
ERRO[0000] OTG API error code: 500
ERRO[0000] OTG API error kind: internal
ERRO[0000] OTG API error messages:
ERRO[0000] Protocol service for port "p2" is not registered
ERRO[0000] Error occurred while setting Protocol config for user common:Protocol service for port "p1" is not registered
FATA[0000] Fatal OTG error, exiting...

Add proper `git clone` to each lab

For example, docker-compose/b2b relies on templates for otgen that come via a submodule. So the cloning should be done with --recursive

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.