Git Product home page Git Product logo

sp-pifo's Introduction

SP-PIFO

This repository provides the code of SP-PIFO and my implementation of SP-PIFO on BMv2.

Original work

Authors' github: https://github.com/nsg-ethz/SP-PIFO/tree/master
Official document of SP-PIFO: https://www.usenix.org/conference/nsdi20/presentation/alcoz

My implementation

About the simulation environment, I use the latest Development VM which has necessary P4 developement tools provided here: https://github.com/jafingerhut/p4-guide/blob/master/bin/README-install-troubleshooting.md
I clone p4-learning repository (https://github.com/nsg-ethz/p4-learning/tree/master) to the VM and using that repo to run exercises.

The sp-pifo folder in this repository includes:

  • sp-pifo.p4: p4_16 code of SP-PIFO
  • network.py: Used to create network topology
  • send.py: Python code using Scapy library used to create and send packets
  • receive.py: Python code using Scapy library used to receive packets
  • sw_commands folder: Contain .txt files used to configure forwarding rules for switches


  • Topology

    To run the code, go to the terminal and enter the command: sudo python3 network.py
    This will compile the p4 code and also generate the topology in Mininet:


    SP-PIFO uses ranking mechanism to select a priority queue for each packet. According to the authors, the rank can be computed in the switch or in the end-host and read it from the switch. The current code in the authors' github is for the case in which you compute the rank at the end host, tag it into the ToS field of IP packets, and read it for the switch.

    In my case, I write a function in send.py to randomly set the packet size for each packet before sending it and use the packet size for ranking mechanism where smaller sizes have higher priority. In addition, I tag the standard_metatata.qid to ToS fields of IP packets to distinguish different priority queues.
    Sending packets between two hosts using xterm commands in Mininet.

    For example, I send 10 packets from h1 to h3:

    The result of the ranking mechanism can be checked by using CLI of simple_switch to read the register used to capture queue bound values:

    Or using .log files in the log folder generated after compiling the code


    If you want to delete log and pcap folder, hit Ctrl+D to exit Mininet and enter the command:
    sudo make clean

    sp-pifo's People

    Contributors

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