The traffic manager of the BMv2 - Implementation of different scheduling policies

Hi everyone,
I am working in implementing some scheduling policies using the P4 language and the BMv2 simple_switch to identify the limitations of the P4 language and the existing architectures. From the BMv2 documentation, I understand that the BMv2 switches have a traffic manager (or a queueing system) based on strict priority queues, between the ingress and the egress pipelines.

I have two questions;

  1. these queues are all parallel (with different queue IDs and with no hierarchy), aren’t they?!
  2. is there a place other than the ingress pipeline where we can express the priority calculations of a packet ?!

Thanks in advance.
Mostafa

Hello Mostafa,

Welcome to the community!

Before you embark on your research, I suggest that you carefully read P4_16 Language Specification.

If you spend minimal amount of time doing that you would realize that the subject of your proposed “investigation” is pretty much equivalent to “identify limitations of the modern cars when it comes to flying”. P4 is simply not designed to implement schedulers in it and all P4-programmable targets available today use a fixed-function scheduler that is not P4-programmable (and not implemented in P4). The only thing a P4 program can to is to interact with such fixed-function component by means of intrinsic metadata (pre)defined in the architecture.

Subsequently, all scheduling policies that can be implemented, are already implemented in the give target’s scheduler. P4 programs can only manipulate its parameters, such as packet priority. As long as it is represented as intrinsic metadata, it can be manipulated by any component of the P4 programmable pipeline that has access to this metadata and is executed before the packet is passed to the Traffic Manager (or, at least, the scheduler).

As for the queue organization, it all depends on the target. BMv2 does not support hierarchical scheduling, but other targets do.

Happy hacking,
Vladimir

1 Like

Hello Vladimir,

Thanks for your detailed answer. I am aware of the issue of the programmability of the programmable schedulers. I believe that investigating what is needed to reach that goal, would never hurt.

I have another question regarding the same topic; Can I pause a packet (or a flow of packets) in the buffer using the BMv2 traffic manager ?! if not, are the externs allowed to do so ?! (pause the processing of a packet), or should I change the traffic manager block code in the BMv2 C++ source code to perform such a task?!

Thanks in advance.
Mostafa.

I am fairly certain that the existing BMv2 code does not already contain features that enable pausing of queues.

That said, the C++ open source code of BMv2 is all there, so that feature could be implemented by anyone with the skill, interest, and time. Doing so would only enable this feature in the BMv2 software switch, of course, and not somehow automatically enable the feature on other P4-programmable devices.

In case you were unaware, there has been research and some prototype development of P4-programmable packet schedulers by Steve Ibanez and others. I am not aware whether devices with these features are offered for sale. [PDF] Programmable Packet Scheduling at Line Rate | Semantic Scholar

1 Like