Code Monkey home page Code Monkey logo

approximated-fair-queuing's Introduction

Approximated Fair Queuing implemented on Bmv2

This is simple implementation of "Approximated Fair Queuing (NSDI' 18)" on P4 v1model.

Paper link: https://www.usenix.org/system/files/conference/nsdi18/nsdi18-sharma.pdf

Dependencies

To run the code, basic dependencies such as Bmv2 and p4c should be installed. In addition, this code uses strict priority queue on v1model, which requires several modiifications and recompilation of the Bmv2 and p4c backends. I post links for detailed information below.

Bmv2: https://github.com/p4lang/behavioral-model

p4c: https://github.com/p4lang/p4c

Instructions for priority queuing: https://github.com/nsg-ethz/p4-learning/tree/master/examples/multiqueueing

Instructions

This repository aims to implement basic concepts of AFQ using count-min sketch and recirculation. It keeps tacking departure rounds for each flows using count-min sketch with 5 tuple information. Due to the seperated structure of ingress and egress pipeline, we use periodic recirculation to synchronize registers between ingress & egress. Priority of the packet is decided by current flow departure rounds, which increase/decrease as a packet passes ingress/egress pipeline.

These are instructions you can follow to run.

  1. Clone the repository to local
git clone https://github.com/keemeew/Approximated-Fair-Queuing
  1. Compile approx_fair_queuing.p4 (Optional)
p4c --target bmv2 --arch v1model approx_fair_queuing.p4
  1. Set up virtual nic interfaces
sudo bash veth_setup.sh
  1. Run Bmv2 switch
sudo simple_switch -i 0@veth0 -i 1@veth2 -i 2@veth4 --log-console --thrift-port 9090 approx_fair_queuing.json
  • 'veth0-2' is used for input port, and 'veth4' is output port.
  1. Insert switch rule
sudo simple_switch_CLI --thrift-port 9090 < rule.txt
  1. Send long flow and burst flow simultaneously
sudo python3 send.py --dst "10.10.0.1"
sudo python3 send.py --dst "10.10.0.2"

I recommend you to use terminal applications (e.g., terminator) which supports command broadcasting to run two different send.py commands simultaneously. Timing to send long flow and burst flow is carefully adjusted in python script. By the way, please sniff 'veth4 using packet sniffing applications such as wireshark by yourself.

approximated-fair-queuing's People

Contributors

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