tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

some issues about INT,please help me

Open nosugerhcc opened this issue 6 years ago • 6 comments

I am doing the MRI example.The code mri.p4 shows the switch's ID and queue length ,which the code is "standard_metadata.deq_qdepth".I want to know if I need other INT datas like the forwarding latency or queue occupacy or egress link utilization, can I find these datas in "standard_metadata",and how to get them?

nosugerhcc avatar Dec 19 '19 11:12 nosugerhcc

You can find more documentation about the v1model standard_metadata fields available in two places:

https://github.com/p4lang/behavioral-model/blob/master/docs/simple_switch.md https://github.com/p4lang/p4c/blob/master/p4include/v1model.p4

jafingerhut avatar Dec 19 '19 18:12 jafingerhut

Thank you ! It helped me a lot

nosugerhcc avatar Dec 20 '19 03:12 nosugerhcc

Hello. I tried to add "timedelta" in mri.p4 ,send.py and receive.py,but it shows that cannot receive the data pack .I could get the data packet if there is only "qdepth" or "timedelta" ,but it is not work for both of them. Is there some configuration file that limits this?

nosugerhcc avatar Feb 21 '20 18:02 nosugerhcc

If you can publish the complete code that you tried to use, e.g. in your own public Github repository with a link here, showing in detail what you tried, perhaps someone could take a look. It would also be good to run this script on your system and publish the output, because that will show what versions of p4c, simple_switch, and several other software tools installed on your system: https://github.com/jafingerhut/p4-guide/blob/master/bin/p4-environment-info.sh

Without such details, it is not easy to determine what might be going wrong.

jafingerhut avatar Feb 21 '20 22:02 jafingerhut

https://github.com/nosugerhcc/mriplus I just add "timedelta" in mri.p4 like "qdepth" and add IntField("timedelta",0) in send/receive.py like IntField("qdepth", 0). I dont know if I am doing right...

nosugerhcc avatar Feb 22 '20 08:02 nosugerhcc

That link does not seem to exist (or perhaps it exists, but it is not a public repo?).

In general, a reasonable debugging technique is to examine the raw sequence of bytes of the packet coming out, and see if the IHL field in the IPv4 header is truly less than 5, which is an error. Do that not by believing Wireshark's decoding, but by decoding the packet bytes manually, by yourself, at least up to the beginning of the IPv4 header. If the IHL field is less than 5, then check the input packet similarly, and also you can look at the simple_switch_grpc process logs created while it processes packets to see every assignment statement performed, every table looked up, etc. to see if you can determine when that IHL field was assigned a value you did not want.

jfingerh avatar Oct 01 '20 14:10 jfingerh