P4 Language Based Metering Monitoring Error

58 views Asked by At

I have a P4 switch where it's connected to 2 hosts over mininet.

I have created the basic.p4 controller was within the ingress processing created a meter function, along with the topology file in python.

Everything within the SDN environment runs well, however, I am facing issues with the best practice on applying the metering function, mine is currently:

0.0001 > allow 100packets/sec, if each packet size is equal to 1000 bytes, then the obtained throughput can be 100 packets/sec * 1000 (bytes) *8 = 800 kbps.

I am setting the meter for the traffic that is destined to H2 (00:00:00:00:00:02).

Any advice on the approach?

1

There are 1 answers

0
Ahmed O. Basil Al-Mashhadani On

Interesting, I will assume that your P4 SDN runs without any issues, so its a display of setting the meter, make sure you have defined your tables and set the meters after, here is an example:

table_add phy_forward forward 1 => 2

table_add phy_forward forward 2 => 1

table_add m_table m_action 00:00:00:00:00:02 => 2

(the line bellow, if you have it within your meter function)

table_set_default m_filter drop

table_add m_filter NoAction 0 => Finally have this: meter_set_rates meter_functionName 2 0.0001:1 0.0005:1

You can have all of this in a text file and call it in your python run file.