Can I find a way to calculate packet growth rate for a specific dstIP?

Hi,

I want to know packet growth rate for a specific dstIP in data plane. But P4 do not support division.

Do you have any ways that can calculate this? Approximate result also works. I don’t need it to be that exact.

Thank you!

I do not know if this article will give you any ideas or not, but it does have some ideas for certain kinds of calculations using the kinds of arithmetic operations available in P4. The recommended book “Hacker’s Delight” is much longer, but browsing through its table of contents might lead you to something relevant. p4-guide/floating-point-operations.md at master · jafingerhut/p4-guide · GitHub

Thank you! that helps a lot :slight_smile: