p4lang / tutorials

P4 language tutorials
Apache License 2.0
1.33k stars 878 forks source link

Packet aggregation #626

Open amir-raoofy opened 1 month ago

amir-raoofy commented 1 month ago

Hi p4 community,

I am looking for an example p4 program that is kind of similar to calc tutorial, but instead of getting the operands from a single packets, I intend to get the operands from multiple packets. It is kind of an example to do aggregation of payloads of multiple packets which probably requires packet buffering.

Can this be done via P4? Do you have examples that might resemble this?

These are the closest pointer I found: https://github.com/LittleD3092/reliable-in-network-aggregation/tree/master and https://www.sciencedirect.com/science/article/pii/S1084804519301687

I appreciate your input. Thanks!

jafingerhut commented 1 month ago

The first example that comes to my mind is this one, which is intended to do vector integer addition of data across different packet payloads, as a way to assist some kinds of collective operations like AllReduce being done by the hosts, but with the switches accelerating the operation.

https://github.com/p4lang/p4app-switchML

amir-raoofy commented 1 month ago

Dear Andy,

Many thanks for sharing this pointer. That is exactly what I am looking for. I will have a deeper look into it.

BTW. this is the context of our research: https://www.ce.cit.tum.de/caps/laufende-projekte/scalnext/

Further pointers around this are highly appreciated (collectives was already a direct hit ;-) ).

Regards, Amir