[P4-dev] graph search in P4

Roshan sedar at oasis.uclouvain.be
Sat Oct 21 10:23:16 EDT 2017


I see that. Thanks for the explanation!


Cheers,

R-


On 2017-10-20 17:29, Mihai Budiu wrote:
>
> Each packet is processed independently of the previous and next ones.
>
> A register (more precisely, a bank of registers) can be written by one 
> packet and read by the next one.
>
> Mihai
>
> *From:*Roshan [mailto:sedar at oasis.uclouvain.be]
> *Sent:* Friday, October 20, 2017 6:09 AM
> *To:* Mihai Budiu <mbudiu at vmware.com>; p4-dev <p4-dev at lists.p4.org>
> *Subject:* Re: [P4-dev] graph search in P4
>
> thanks a lot for the insights to you Andy and Mihai. I am new to P4. 
> Regarding the state, I just tried keeping the state in the switch in a 
> register. But that does not work. First packet works then the next 
> does not. Takes another path. If it keeps in the header,  would it 
> work? Would every packet follow the same procedure?
>
> Thanks!
>
> Cheers,
>
> R-
>
> On 2017-10-17 23:45, Mihai Budiu wrote:
>
>     Leaving performance aside, there really is no support for keeping
>     state from one packet the next, so you have to package all the
>     state between iterations in the packet that you recirculate. Plus
>     there is no locking or synchronization between multiple packets.
>
>     Mihai
>
>     *From: *Andy Fingerhut <mailto:andy.fingerhut at gmail.com>
>     *Sent: *Tuesday, October 17, 2017 14:38
>     *To: *Mihai Budiu <mailto:mbudiu at vmware.com>
>     *Cc: *Roshan <mailto:sedar at oasis.uclouvain.be>; p4-dev
>     <mailto:p4-dev at lists.p4.org>
>     *Subject: *Re: [P4-dev] graph search in P4
>
>     To quantify Mihai's "every iteration will be very expensive" just
>     a bit:
>
>     Call a packet that does ingress+egress processing, then leaves, "1
>     pass".
>
>     If it does ingress+egress, then recirculates and does
>     ingress+egress once more, then leaves, "2 pass".  Generalize that
>     to an "N pass" packet.
>
>     There are hardware implementations of P4 that, among other finite
>     limits, have a maximum packet rate they support.  To give a
>     generic example that doesn't necessarily match any particular
>     implementation, but lets you figure out how to calculate it
>     yourself, if an ASIC implementation was limited to at most 1
>     billion (10^9) packets per second for 1-pass packets, and it had 8
>     100 Gigabit Ethernet ports, then it can handle line-rate traffic
>     on all 8 of those ports only if the average packet size is (8
>     ports * (100 * 10^9 bits/sec) / port) / ((8 bits/byte) * (10^9
>     packets/sec)) = 100 bytes, or more.  If the average packet size is
>     smaller than that, it is possible to send such an ASIC more than
>     10^9 packets/sec, and it will have to start dropping traffic
>     without processing it at all.  That is usually a situation you
>     want to avoid.
>
>     If you wrote a P4 program that made every packet take an average
>     of 2 passes, then the maximum packet rate is cut in 1/2.  If every
>     packet takes an average of N passes, the maximum packet rate is
>     divided by N.  That either multiplies the average packet size you
>     can handle at line rate by N, or it means you have to leave a
>     fraction of those 16 ports not connected to anything so the input
>     packet rate goes down.
>
>     Andy
>
>     On Tue, Oct 17, 2017 at 9:41 AM, Mihai Budiu <mbudiu at vmware.com
>     <mailto:mbudiu at vmware.com>> wrote:
>
>         Yes can use recirculate to create a loop, but every iteration
>         will be very expensive.
>
>         Mihai
>
>
>         -----Original Message-----
>         From: Roshan [mailto:sedar at oasis.uclouvain.be
>         <mailto:sedar at oasis.uclouvain.be>]
>         Sent: Tuesday, October 17, 2017 9:32 AM
>         To: Mihai Budiu <mbudiu at vmware.com
>         <mailto:mbudiu at vmware.com>>; p4-dev <p4-dev at lists.p4.org
>         <mailto:p4-dev at lists.p4.org>>
>         Subject: Re: [P4-dev] graph search in P4
>
>         I see that. Could recirculate primitive behave/use for looping
>         mechanism?
>
>
>         Thanks!
>
>
>         Cheers,
>
>         R-
>
>
>         On 2017-10-17 18:02, Mihai Budiu wrote:
>         > P4 does not really support data structures or loops, so you
>         cannot really do anything useful with graphs in P4.
>         >
>         > Mihai
>         >
>         > -----Original Message-----
>         > From: P4-dev [mailto:p4-dev-bounces at lists.p4.org
>         <mailto:p4-dev-bounces at lists.p4.org>] On Behalf Of Roshan
>         > Sent: Tuesday, October 17, 2017 8:54 AM
>         > To: p4-dev <p4-dev at lists.p4.org <mailto:p4-dev at lists.p4.org>>
>         > Subject: [P4-dev] graph search in P4
>         >
>         > Hi,
>         >
>         >
>         > Is there any reference or example material for an
>         implementation of graph search/traversal in P4 to have a look at?
>         >
>         > Is this type of implementation is doable in P4?
>         >
>         >
>         > Any advices would be great!
>         >
>         >
>         > Thanks!
>         >
>         >
>         > Cheers,
>         >
>         > R-
>         >
>         >
>         > _______________________________________________
>         > P4-dev mailing list
>         > P4-dev at lists.p4.org <mailto:P4-dev at lists.p4.org>
>         >
>         https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=OnrkGWQxzKA_7Gi4GzAXqDNHlJ0XuhifOTDhGrQPND4&s=7Zd7D805wh5blEOPAX5mLwquUzcvy1WVwrPccrpqBGM&e=
>         >
>         > _______________________________________________
>         > P4-dev mailing list
>         > P4-dev at lists.p4.org <mailto:P4-dev at lists.p4.org>
>
>         > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwICaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=2FHzx-q10Mq-utErUIq4z9qLNvMLglNQD6taUDjtAKM&s=6rbMVcGsxrDqyRhEwhkyuWxer1-hweQu6D1czcIsl7o&e=
>
>
>         _______________________________________________
>         P4-dev mailing list
>         P4-dev at lists.p4.org <mailto:P4-dev at lists.p4.org>
>         http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>         <https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=AFYLa-G-_RT6xJGGB67eBPWTGPB52dJyKLeHx5o6hGA&s=lGEpKp5QpS8i3a32KJyWJFd70PZoTttUZKRzMcVbd-E&e=>
>
>
>
>
>     _______________________________________________
>
>     P4-dev mailing list
>
>     P4-dev at lists.p4.org <mailto:P4-dev at lists.p4.org>
>
>     http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>     <https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwMD-g&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=Uu9PTxIQ-NmygmzXRwr8J2Dywx42nGFaF1WAUS_sFh0&s=4u-RpdbqxO9-GCGPhR-wB3uQGjrpB5x9511xS1JsPgw&e=>
>
>
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20171021/ac6abed3/attachment-0002.html>


More information about the P4-dev mailing list