[P4-dev] Experiment for Priority Queue

Lok In Anson Leong anson93827 at gmail.com
Wed Nov 2 14:12:53 EDT 2016


Hi 鼎原, Antonin:

Thank you very much!!!!!

On Thu, Nov 3, 2016, 12:41 AM Antonin Bas <antonin at barefootnetworks.com>
wrote:

> Lok is actually correct. bmv2 supports priority queueing and all you need
> to do in the P4 program is set the appropriate metadata field
> (intrinsic_metadata.priority) to the value of your choice.
> I will investigate the issue based on the P4 code and the runtime CLI
> commands provided.
>
> On Tue, Nov 1, 2016 at 11:41 PM, 胡鼎原 <hdy at bupt.edu.cn> wrote:
>
> Hi,
>
> As far as I know, queue priority is not defined in P4 specification.
>
> It depends on switch hardware.
>
> Bmv2 may not implement the queue algorithm.
>
> Your P4 program running in bmv2 just write queue priority in ingress
> process and do nothing.
>
> ---
>
> Best Regards,
>
> Dingyuan Hu
>
> Beijing University of Posts and Telecommunications
>
>
>
> *From: *P4-dev <p4-dev-bounces at lists.p4.org> on behalf of Lok In Anson
> Leong <anson93827 at gmail.com>
> *Date: *Wednesday, 2 November 2016 at 14:24
> *To: *"p4-dev at lists.p4.org" <p4-dev at lists.p4.org>
> *Subject: *[P4-dev] Experiment for Priority Queue
>
>
>
> Hi all,
>
>
>
> I am doing an experiment for priority queue in P4.
>
> I have enabled the priority queue by uncommenting the line 42 in
> simple_switch.h. Also, i have defined the intrinsic_metadata.priority field
> in my P4 program.
>
>
>
> The picture below is my experiment environment.
>
> [image: .jpg]
>
> There are four computers in this environment. Three of them are hosts and
> one P4 bmv2 switch. On port 3, i set the rate and depth to 5000. Other
> ports were default setting. The priority of UDP service in host 1 was set
> to 0 (lowest) and host 2 was set to 7 (highest). I was using iperf to send
> UDP datagram (100Mbps in 300 seconds) from host 1 & 2 to host 3 almost at
> the same time.
>
>
>
> I also find some instruction of priority queue: "If no maximum rate is
> set, queues with a high priority can starve lower-priority queues."(
> https://github.com/p4lang/behavioral-model/blob/deace1c9ba1b23ece3bf5f534db38c560c7ed6ff/include/bm/bm_sim/queueing.h#L397). Theoretically,
> host 1 will starve because host 2 get the higher priority. But, I can't get
> this theoretically result in my experiment.
>
>
>
> The pictures below are the testing result.
>
> [image: .jpg]
>
> [image: .jpg]
>
> [image: .jpg]
>
> The values of transfer and bandwidth in host 1 and host 2 were very
> approaching. There was no starvation.
>
>
>
> On the other hand, I try to use default setting for all ports (take away
> the set_queue_rate and set_queue_depth) and test it again.
>
> [image: .jpg]
>
> [image: .jpg]
>
> [image: .jpg]
>
> Also got the same result.
>
>
>
> Here is my part of P4 code.
>
> /*-------part of p4 code----------*/
>
> header_type intrinsic_metadata_t {
>
> fields {
>
> mcast_grp : 4;
>
> egress_rid : 4;
>
> mcast_hash : 16;
>
> lf_field_list: 32;
>
> ingress_global_timestamp : 48;
>
> priority : 8;
>
> }
>
> }
>
> action set_if_info1(out_port, priority) {
>
> modify_field(standard_metadata.egress_spec, out_port);
>
> modify_field(intrinsic_metadata.priority, priority);
>
> }
>
> table mac_if_info {
>
> reads {
>
> ethernet.dstAddr : exact;
>
> ipv4.srcAddr : exact;
>
> ipv4.dstAddr : exact;
>
> ipv4.protocol : exact;
>
> }
>
> actions {
>
> _drop;
>
> set_if_info1;
>
> }
>
> size: 128;
>
> }
>
> /*-------part of p4 code----------*/
>
>
>
> /*-------command.txt----------*/
>
> table_add mac_if_info set_if_info1 1c:1b:0d:10:85:7a 10.0.0.12 10.0.0.10
> 17 => 1 7
>
> table_add mac_if_info set_if_info1 1c:1b:0d:10:86:cd 10.0.0.10 10.0.0.12
> 17 => 3 7
>
> table_add mac_if_info set_if_info1 1c:1b:0d:10:85:97 10.0.0.12 10.0.0.11
> 17 => 2 0
>
> table_add mac_if_info set_if_info1 1c:1b:0d:10:86:cd 10.0.0.11 10.0.0.12
> 17 => 3 0
>
> set_queue_rate 5000 3
>
> set_queue_depth 5000 3
>
> /*-------command.txt----------*/
>
>
>
> Thank you very much!!
>
> --
>
> Best Regards,
> Anson Liang Lok In(梁樂賢)
> National Chung Cheng University
> Department of Communication Engineering
>
> _______________________________________________ P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>
>
>
>
> --
> Antonin
>
-- 

Best Regards,
Anson Liang Lok In(梁樂賢)
National Chung Cheng University
Department of Communication Engineering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/96020c0b/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 145126 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/96020c0b/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 197405 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/96020c0b/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 217991 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/96020c0b/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.jpg
Type: image/jpeg
Size: 147402 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/96020c0b/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.jpg
Type: image/jpeg
Size: 195378 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/96020c0b/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 217548 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/96020c0b/attachment-0005.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 201097 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/96020c0b/attachment-0006.jpg>


More information about the P4-dev mailing list