Hello everyone,
This is a shorter version of: Queue depth of different priority queues - Getting Started with P4 - P4 Programming Language
My topology:
From h1 & h2, I send 10 packets from each host to h3, 1 second interval between packets. h1 has higher priority than h2.
I use iperf to send UDP flow from h5 to h4 to create congestion
iperf -c 10.0.2.5 -u -b 3M -t 10 -i 1
I implement 8 priority queues on MRI exercise and use multiple swtrace_X tables and add_swtrace_X actions for each qid. There’s no difference between tables and actions.
if (hdr.mri.isValid()) {
hdr.ipv4.tos = (bit<8>)standard_metadata.qid;
if (hdr.ipv4.tos == 0x7) {
swtrace_7.apply();
}
else if (hdr.ipv4.tos == 0x6) {
swtrace_6.apply();
}
else if (hdr.ipv4.tos == 0x5) {
swtrace_5.apply();
}
else if (hdr.ipv4.tos == 0x4) {
swtrace_4.apply();
}
...and so on
On switch 1, I configured:
set_queue_depth 20 4 7
set_queue_rate 1 4 7
set_queue_depth 20 4 6
set_queue_rate 1 4 6
set_queue_depth 20 4 5
set_queue_rate 1 4 5
set_queue_depth 20 4 4
set_queue_rate 1 4 4
set_queue_depth 20 4 3
set_queue_rate 1 4 3
set_queue_depth 20 4 2
set_queue_rate 1 4 2
set_queue_depth 20 4 1
set_queue_rate 1 4 1
set_queue_depth 20 4 0
set_queue_rate 1 4 0
Result from h3:
I received all 20 packets
Packet from h1
Packet from h2
The queue depth of h1 and h2 is always up to 20 which I think they should be smaller than that and also be different from each other, because when I checked the tos value they’re in different priority queues.
Is there anything wrong with my approach?