Giter Club home page Giter Club logo

pifina's Introduction

Build status GitHub GitHub release

Performance Introspector for in-network applications (PIFINA)

This is a performance framework to introspect in-network applications written in P4 programming language running on Intel Tofino powered switches. The framework has been developed and tested for the Intel Tofino architecture version 2, but it is backwards compatible to Tofino 1.

Using the PIFINA cli tool a given P416 application can be enriched with performance counters like byte & packet counter in various places of the pipeline. Only interesting packets can be introspected using traffic selector rules, which can be matched on any parsed header fields. In addition, the values of selected user defined registers can be probed and visualized. In that way, low/high watermark metrics specific to the running application can be implemented by the user itself, which will be probed by PIFINA. Furthermore, metrics from the traffic manager are visualized as well.

One of the benefits of PIFINA is that it allows users to adjust the traffic selector rules and to add user-defined registers for probing at runtime without the need to recompile the whole P416 application.

PIFINA offers following features:

  • Introspect only interesting packets using traffic selector rules. Define on which header fields to match on and install the rules over a web ui.
  • Monitor how any value of a register change over time
  • Monitor performance counters from the traffic manager?
  • Monitor performance counters from end systems with NVIDIA Connect-X NICs

See for more information and screenshots on pifina.app

Installation

  1. Download compiled PIFINA binaries from Github
  2. Untar the archive
cd /tmp
tar -xzf pifina_Linux_x86_64.tar.gz
mv pifina /usr/local/bin
mv pifina-tofino-probe /usr/local/bin

Install from source

  1. Install prequisites
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
  1. Compile using makefile
cd pifina-sdk/
make build

Now you can find two binaries in the build folder.

See for more information on pifina.app

Usage

  1. Instrumentize your P4 application with PIFINA
# Match on P4 header fields hdr.ipv4.protocol, hdr.ipv4.dstAddr & hdr.ipv4.srcAddr
# Write the generated P4 libraries in src/myP4app/include
user@myworkstation$ pifina generate -k hdr.ipv4.protocol:exact -k hdr.ipv4.dstAddr:ternary -k hdr.ipv4.srcAddr:ternary -o src/myP4app/include
# Use command help to see the options
user@myworkstation$ pifina generate -h
  1. Run your P4 app enriched with PIFINA on your Tofino switch
  2. Start the PIFINA collector on a remote server
# Quick and dirty way
# Create self signed certificate
admin@collector$ mkdir assets
admin@collector$ openssl req -x509 -newkey  ec -pkeyopt ec_paramgen_curve:prime256v1 \
	-keyout assets/key.pem -out assets/cert.pem -sha256 -days 3650 -nodes \
	-subj "/C=CH/O=Pifina/CN=PifinaServer"
admin@collector$ pifina serve
# Start collector with a signed TLS certificate
admin@collector$ pifina serve --key privatekey.pem --cert letsencrypt_cert.pem
# Use command help to see the options
admin@collector$ pifina serve -h
  1. Start the tofino probe on the Tofino switch
# Start the tofino probe. The P4 app name must be given with the flag p4name
sde@tofino$ pifina-tofino-probe -p4name myP4app -server pifina-collector.local:8654
# Use command help to see the options like bfrt server address or pifina
sde@tofino$ pifina-tofino-probe -h
  1. Optional: Start the NIC collector on your sender and receiver
  • This component depends on NVIDIA NEO-Host SDK and it must be already installed!
# List all available Mellanox ConnectX NICs
admin@server1$ pifina nic list
# Collect metrics from mlx5_1 NIC and send metrics to PIFINA collector
admin@server1$ pifina nic collect -d mlx5_1 -s pifina-collector.local:8654
# Use command help to see the options
admin@server1$ pifina nic -h

Check the user manual on pifina.app

Authors and acknowledgment

Acknowledgments

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

pifina's People

Contributors

thushjandan avatar

Stargazers

chen hongyang avatar

Watchers

 avatar

Forkers

bbill

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.