[P4-dev] Match + Actions on a cloned packet

Ramana Reddy gtvrreddy at gmail.com
Wed Feb 3 12:25:58 EST 2016

Thanks David. I will write some test code and try it out.

In my second question, inject the packet means, assume that the packet is
cloned and received by an application which is
listing on a particular port (ex: receive.py in copy_to_cpu), and if the
receive.py modified the packet and inject the modified
packet back to switch, in that case, where exactly it injects into the
pipeline ( ingress or buffering mechanism or egress).

Thanks & Regards,

On Wed, Feb 3, 2016 at 10:03 PM, David Hancock <dhancock at cs.utah.edu> wrote:

> Ramana, if you have reason to doubt the spec, why don't you write some
> test code and try it out?  Then, if the results are not what you expected,
> tell us about the difference between what you expected and what you
> observed.  I have done this numerous times.  In some cases, I uncovered a
> bug in the behavioral model.  In other cases, I learned that a feature was
> not implemented in the behavioral model, or that it was implemented a
> little bit differently than what the spec said.  In yet other cases, I
> learned that I did not understand the spec correctly.  I think you will
> best serve yourself and the entire P4 community by taking this approach.
> That is my answer to your first question.  I don't understand your second
> question - what do you mean, exactly, by "inject the packet"?  Since this
> is under the topic of cloning packets, I assume you are talking about
> cloning somehow.  I will tell you now that you cannot do a
> clone_*_pkt_to_ingress - it has not been implemented in bmv2, and per my
> discussion with Antonin, it may never be and is likely to be removed from
> the spec.  If you are talking about a resubmit, no clone is produced but
> the packet is sent back to the parser.  If you are talking about
> clone_*_pkt_to_egress, this sounds like your first question.
> One additional hint - neither the cloning primitives nor the resubmit
> primitive, nor the recirculate primitive take effect immediately - the
> packet continues until the end of the appropriate pipeline, at which point
> cloning / resubmission / recirculation happens.  That fact caused me a bit
> of confusion since I did not read the spec as carefully as I should have
> when I started working with these primitives, so I hope this helps you
> avoid the same confusion.
> --David
> On 02/03/2016 06:22 AM, Ramana Reddy wrote:
> Hi All,
> I have few doubts on cloned packets:
> 1. When the packet is cloned using clone_ingress_to_egress primitive,
> is the match+actions which are mentioned in ingress pipeline only
> applicable to original packet or to the cloned packet as well?
> In the diagram given in the spec (section 14.1.2), the cloned
> packet is directly going to the buffering mechanism.
> 2. When we inject the packet through the application which
> is listing an a particular port, what is the control flow of that
> packet. Is it go again ingress pipeline match+actions tables.
> Thanks & Regards,
> Ramana
> _______________________________________________
> P4-dev mailing listP4-dev at lists.p4.orghttp://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/20160203/e107157b/attachment-0002.html>

More information about the P4-dev mailing list