Giter VIP home page Giter VIP logo

p4tg's Introduction

P4TG: 1 Tb/s Traffic Generation for Ethernet/IP Networks

image image image image Controller Build

Overview

This repository contains the source code for a P4 based 1 Tb/s traffic generator based on the Intel Tofino(TM) ASIC, called P4TG (Paper). The paper version corresponds to v.1.0.0.

In generation mode, P4TG is capable of generating traffic up to 1 Tb/s split across 10x 100 Gb/s ports. Thereby it measures rates directly in the data plane. Generated traffic may be fed back from the output to the input ports, possibly through other equipment, to record packet loss, packet reordering, IATs and sampled RTTs. In analysis mode, P4TG measures rates on the input ports, measures IATs, and forwards traffic through its output ports.

P4TG (v2.0.0) supports VLAN (802.1Q) and QinQ (802.1ad) encapsulation. P4TG (v2.1.0) further supports MPLS.

P4TG consist of:

  • a P4 program for the Intel Tofino(TM)
  • Rust control plane
  • React configuration GUI

Installation & Start Instructions

Data plane

Go to P4-Implementation and compile p4tg via make compile. This compiles the program and copies the resulting configs to the target directory.

Afterwards, start p4tg via make start.

This requires a fully setup SDE with set $SDE and $SDE_INSTALL environment variables.

Tested on:

  • SDE 9.9.0 (up to v2.0.0)
  • SDE 9.13.0

Control plane

The controller is written in rust and can be started via docker-compose up. The initial build may take a few minutes.

The controller then starts a REST-API server at port P4TG_PORT and endpoint /api (see docker-compose.yml) that is used to communicate with the configuration GUI. It also serves the configuration gui at port P4TG_PORT and endpoint /.

Configuration

Set SAMPLE=1 in docker-compose.yml to activate IAT sampling mode instead of data plane measurement. Data plane measurement mode (SAMPLE=0) is more accurate and the default

Configuration GUI

The configuration GUI is based on react & nodejs. It is automatically served by the controller at http://ip-of-tofino-controller:P4TG_PORT.

If you want to adapt the configuration GUI, re-build the configuration GUI via npm run build within the Configuration GUI folder and copy the build folder to Controller/gui_build. Afterward, re-build the controller via docker-compose build within the Controller folder.

Docker

The configuration GUI can also be run independently of the controller. Adapt the API_URL in the config.ts if the controller and configuration GUI run on different machines.

To run the configuration GUI via docker-compose run docker-compose up. After the build has finished, the configuration GUI is reachable at http://127.0.0.1. To change the listening port adjust the port in docker-compose.yml.

Legacy NPM installation

Run npm install --legacy-peer-deps to install the nodejs dependencies. Adapt the API_URL in the config.ts if the controller and configuration GUI run on different machines. Afterward run npm run build to create a production build and serve the build/ directory with a webserver of your choice.

Connection to REST-API server

Connect to the REST-API server through the frontend of the configuration GUI: http://ip-of-tofino-controller:P4TG_PORT/api

Update Guide

If you update to a newer version, it might be necessary to delete your local storage in your browser for the configuration GUI.

Documentation

The documentation of the REST-API can be found at the /api/docs endpoint of the REST-API of the controller.

Preview of P4TG

image

image

image

p4tg's People

Contributors

ne4y avatar n1tr0-5urf3r avatar

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.