Skip to content

Implementation In­Band Network Telemetry with P4

License

Notifications You must be signed in to change notification settings

laofan13/P4-INT

Repository files navigation

P4-INT

Implementation In­Band Network Telemetry in P4

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

environment

  • win10
  • vm-ubuntu20.04

Installation

  1. install Mininet

      git clone https://github.com/mininet/mininet
      cd mininet
    
      sudo PYTHON=python3 mininet/util/install.sh -n
    
  2. install P4

    For Ubuntu 20.04 and Ubuntu 21.04 it can be installed as follows:

      . /etc/os-release
      echo "deb http://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/home:p4lang.list
      curl -L "http://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add -
      sudo apt-get update
      sudo apt install p4lang-p4c
    
  3. python3 Dependency package

    sudo pip3 install psutil networkx
    
  4. Influxdb

    sudo apt-get install influxdb
    sudo service influxdb start
    sudo pip3 install influxdb

Usage

  1. Clone the repo
    git clone github.com/laofan13/P4-INT.git
  2. run
    make run
  3. in mininet terminal
    xterm h1 h2
  4. open other desktop terminal,start collector
    sudo python3 ./receive_report.py
    
  5. in xterm h2
    python3 ./receive.py
  6. in xterm h1
    python3 ./send.py --ip 10.0.1.1 --l4 udp --port 8080 --m "hello world !" --c 1    

influxdb operation

INSERT flow_latency,src_ip="10.0.1.1",dst_ip="10.0.3.2",src_port=1234,dst_port=1234,protocol=17 value=0.64
INSERT switch_latency,switch_id=1 value=0.64
INSERT queue_occupancy,switch_id=1,queue_id=1 value=0.1
INSERT link_latency,ingress_switch_id=2,ingress_port_id=1,egress_switch_id=1,egress_port_id=2 value=

SELECT * FROM flow_latency
drop measurement flow_latency

About

Implementation In­Band Network Telemetry with P4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages