nsg-ethz/p4-learning

Question about exercise RSVP

yly97 opened this issue · 2 comments

yly97 commented

I want to know how to compute CIR and PIR by using bw, what does the number 0.125 (appers in function get_meter_rates_from_bw in rsvp_controller.py) mean? And does the size of burst_size affect bandwidth?

Hi @Yelingyun97 !

That is a fair question.

I will first answer the simple one. Burst size is the size of the CIR and PIR buckets, you can check the readme, or some resources online to understand that better. Basically, its the max amount of bytes that can be "instantaneously" be sent. That means, if the buckets are full, you can generate a burst of that size even if CIR and PIR filling rates are low. This can have a huge effect on the max bandwidth you can achieve, but it should not impact the "average" bandwidth. We set it quite high since this meters are running in software and the filling rate is not very precise.

Now, why do we use 0.125 times bw to set the CIR and PIR rates? You can see details here

This is because the meter implementation of the bmv2 switch fills the bucket with CIR or PIR every microsecond. That means a CIR of 1 equals to 1000000 Bytes/sec or 8mbps . If you want a bandwidth of 10mbps your CIR has to be: 10/8 * 10.

yly97 commented

Thanks for your reply!
I think i have got it. That is the CIR and PIR determine the bandwidth, the CBS and PBS theoretically only need to be larger than them respectively.