[P4-dev] Any use case for resubmit and recirculation in P4?

David Hancock dhancock at cs.utah.edu
Fri Dec 2 12:10:23 EST 2016


I use it to support a live-programmable parser where most of the parsing 
logic is moved to the ingress pipeline.  The actual parser code is only 
extracting a generic header stack.  The number of elements it extracts 
depends on the value of a metadata field. This metadata field is set 
later, in the beginning of the ingress pipeline, via table match.  If 
this 'setup' portion of the ingress pipeline determines more bits must 
be extracted, it triggers a resubmit.

Resubmits do incur substantial throughput penalty and I believe I could 
avoid resubmits altogether if parser exceptions were supported (maybe 
they are by now, I haven't checked in a long time).  In any case, what 
I've essentially done is allowed the user to modify parsing through 
supplying/modifying table entries while the switch is in operation.

I also use resubmits another way.  My P4 program essentially hosts 
virtual programs within it and via resubmit I can network these virtual 
programs together.

--David


On 12/02/2016 05:29 AM, hemant at mnkcg.com wrote:
>
> The P4 specification is clear. See text from the P4 document shown 
> between squared brackets below.
>
> [Many standard networking functions, such as mirroring and recursive 
> packet processing, require more complicated primitives than setting or 
> testing fields. To support such operations, P4 provides primitive 
> actions that allow a packet to be recirculated (sent back to the start 
> of the processing pipeline) or cloned (a second instance of the packet 
> is created).]
>
> Have programmed a router/switch data plane before?  If you had, it’s 
> very common for the data plane to send a packet to the recycle queue, 
> say, for packet replication.   Replication is same as mirroring.  
> Another use case is, by default, the data plane matches 64-bits of an 
> IPv6 address but in some cases, the whole 128-bits of the IPv6 address 
> needs matching.  Then the data plane sends the packet to the recycle 
> queue.   An example of recursive packet processing is parsing options 
> in IPv6 packet.
>
> Hemant
>
> -----Original Message-----
> From: P4-dev [mailto:p4-dev-bounces at lists.p4.org] On Behalf Of HAOJU XIAO
> Sent: Friday, December 02, 2016 5:13 AM
> To: p4-dev at lists.p4.org
> Subject: [P4-dev] Any use case for resubmit and recirculation in P4?
>
> Dear all,
>
> I noticed that P4 provides primitive operations like resubmit and 
> recirculation. They can redirect packet back to the Parser to have 
> different parsing decisions.
>
> I'm wondering what kind of scenario when we need "different parsing 
> decisions"? Any hint is appreciated.
>
> Best Regards,
>
> Haoju Xiao
>
> Sent from my iPhone
>
> _______________________________________________
>
> 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
>
>
>
> _______________________________________________
> 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/20161202/7c76896e/attachment-0002.html>


More information about the P4-dev mailing list