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

Ramana Reddy gtvrreddy at gmail.com
Wed Feb 3 13:27:03 EST 2016


Thanks David. Now I understood.
On 3 Feb 2016 11:40 pm, "David Hancock" <dhancock at cs.utah.edu> wrote:

> Ramana, I haven't looked at copy_to_cpu, but I'm pretty sure receive.py is
> simply using SCAPY to receive, and in your case, send, packets.  There is
> nothing special about the packets from the point of view of the switch.  So
> I'm a little surprised by your question.  It sounds like you are wondering
> whether packets ever skip certain components.
>
> Perhaps you are confused about data plane traffic vs. control plane
> traffic?  I'm not sure what the underlying confusion is but think things
> through and describe what *you* think should happen.
>
> --David
>
>
> On 02/03/2016 10:25 AM, Ramana Reddy wrote:
>
> 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,
> Ramana
>
> 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/a76ba5af/attachment-0002.html>


More information about the P4-dev mailing list