Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about examples/digest_messages #25

Closed
butuizd opened this issue May 18, 2021 · 3 comments
Closed

Questions about examples/digest_messages #25

butuizd opened this issue May 18, 2021 · 3 comments

Comments

@butuizd
Copy link

butuizd commented May 18, 2021

I have 3 questions.

  1. What's the exact struct about message received by the controller through digest? Where can I get the information?

I read the controller script get_digest.py, and find that there are many other fields besides the user-defined metadata in p4 code from here , such as topic, device_id, ctx_id, list_id, buffer_id, num from here.

  1. Will simple_switch add several messages to a digest message? If it will, how can I make the switch send one message at a time instead several messages?

I read the controller script get_digest.py, and find that the controller will use a loop to unpack the received messages from here.

  1. what does the function bm_learning_ack_buffer() do? And where can I get the information about it?

The function is also in the script get_digest.py from here.

@edgar-costa
Copy link
Contributor

Hi @butuizd

  1. There is no official documentation about digest. The only way to know how to use it, is by the little information you can find in mailing lists, issues, or here. Now I can not find more info, but basically:

device_id is the switch id, ctx_id, list_id and buffer_id somehow identify the digested packet. And it needs to be used to acknowledge it to the switch https://github.com/nsg-ethz/p4-learning/blob/master/examples/digest_messages/get_digest.py#L29

num is the number of aggregated digests.

  1. Digests are somehow buffered, if you call digest very fast it will in theory batch several packets together, I guess the time it buffers can be found in the simple_switch code. Also, if you digest the same thing multiple times it will only appear one time in the "buffer".

If you want a different behaviour, use copy to cpu.

  1. Again, there is no more info than the code itself (unless there is new documentation). The, function is used to acknowledge one digest message, something needed to continue digesting new packets.

@butuizd
Copy link
Author

butuizd commented May 24, 2021

Thanks a lot @edgar-costa . If I use the p4runtime API, whether I can process the digest message in controller more easily ,which means I don't have to care the fields such as topic, device_id, ctx_id, list_id, buffer_id, num .

@edgar-costa
Copy link
Contributor

Well, then, all good!

Our new version of p4-utils, will have a P4runtime based controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants