nsg-ethz/p4-learning

Priority queue cannot work

guduzhegudu opened this issue · 4 comments

Priority queue cannot work. h1 and h2 get the same bandwidth.
What should I do? BTW, what is the principle of priority queue?
My question is the same with what asked in the p4 maillist : http://lists.p4.org/pipermail/p4-dev_lists.p4.org/2018-March/003465.html

Thanks a lot.

Not sure what do you mean by it does not work.

You first need to enable it, use probably the optimized bmv2 build, and then use the right settings so you observe something. In any case, as you can read in that mailing list, the bmv2 priority queueing does not work very well.

The principle?

You have X queues. As long as there is traffic in a queue with higher priority, the scheduler will take traffic from there. In order to see its effect you will need to congest the thing.

Thank you for your reply.
Here is my experimental procedure.

I downloaded your Virtual Machine Image.
In it , I

  1. uncommented [ // #define SSWITCH_PRIORITY_QUEUEING_ON] .

  2. compiled and installed bmv2 with the following conmmands.

  1. ./autogen.sh
  2. ./configure
  3. make
  4. [sudo] make install # if you need to install bmv2.
  1. added the following metadata fields inside the standard_metadata struct in PATH_TO_P4C/p4include/v1model.p4.
    @alias("queueing_metadata.qid") bit<5> qid;
    @alias("intrinsic_metadata.priority") bit<3> priority;

Then I entered the directory .../p4-learning/examples/multiqueueing/ and sudo p4run

Through iperf, h1 sends packets to h3 through port 5000, and h2 sends packets to h3 through port 5001.

I found that whether I send UDP or TCP packets, the bandwidth on both sides is the same.

Did I miss some steps?

Thanks a lot.

It is been years I do not try the multiqueueing. One extra thing you could try is to build bmv2 without debugging, and make sure you disable pcap logging in the p4app.sjon.

cd ~/p4-tools/
git clone https://github.com/p4lang/behavioral-model.git bmv2-opt
cd bmv2-opt
git checkout b447ac4c0cfd83e5e72a3cc6120251c1e91128ab
./autogen.sh
./configure --without-nanomsg --disable-elogger --disable-logging-macros 'CFLAGS=-g -O2' 'CXXFLAGS=-g -O2'
make -j 2
sudo make install
sudo ldconfig

Also another thing you should do, which probably I do not do in the simple multiqueueing example is to rate limit the links and queues. There is a CLI command to reduce the queues rate.

Hello,
I have followed all the commands given above and also set the queue rate. But still I am unable to see any priority in queuing.
I cannot identify the reason.