Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PSA] Selective dropping of cloned packets in PRE #372

Closed
samar-abdi opened this issue Aug 4, 2017 · 6 comments
Closed

[PSA] Selective dropping of cloned packets in PRE #372

samar-abdi opened this issue Aug 4, 2017 · 6 comments

Comments

@samar-abdi
Copy link

Apologies in advance for my limited understanding of PRE.

Is it possible to selectively drop only the cloned packet and not the original? In other words, replacing pre.drop() with pre.drop_all() and pre.drop_cloned()?

@samar-abdi
Copy link
Author

And by the same token, drop_original(), even though I am not aware of such a use-case.

@samar-abdi samar-abdi changed the title Selective dropping of cloned packets in PRE [PSA] Selective dropping of cloned packets in PRE Aug 4, 2017
@jafingerhut
Copy link
Collaborator

jafingerhut commented Aug 4, 2017

@hanw I don't have an answer to this question. Just calling this issue to the attention of Han Wang, who is thinking about PRE issues for PSA.

@hanw
Copy link
Contributor

hanw commented Aug 4, 2017

To remind everyone about the context, in the last meeting, we voted to use metadata to control the clone operation in PRE. The current thinking is to have a metadata bit that is an out parameter from ingress to PRE that represents if a clone operation needs to happen for the packet-in-process. If that bit is not set anywhere in the pipeline, then the packet is assumed to be (by default) not cloned. A packet is only cloned if the clone bit is set to true.

Further, the cloned copy of a packet has a metadata bit (to the parser) to identify it as a cloned copy. Therefore, the pipeline can drop the cloned packet by setting the drop bit when processing the cloned copy of the packet.

drop_original() can be implemented by setting both the drop bit and clone bit for the original packet. It might be useful to implement pipeline bypassing.

@hanw
Copy link
Contributor

hanw commented Aug 4, 2017

drop_all() is encoded as drop == 1 && clone == false
drop_clone() is encoded as drop == 0 && clone == false
drop_original() is encoded as drop == 1 && clone == true
normal clone is encoded as drop == 0 && clone == true

@samar-abdi
Copy link
Author

Thanks @hanw
Just to confirm, the clone is a copy of the packet as seen at ingress (or egress) and not the current state of the packet at the time of cloning. For example, would the TTL modification earlier in the pipeline be reflected in the clone? Perhaps this can be clarified in the PRE spec. Thanks!

@jafingerhut
Copy link
Collaborator

@samar-abdi @hanw With Han's recent changes where when cloning a packet, you also specify whether the packet is the original packet, or the modified packet, I think that should address Samar's question, although having a few more explicit sentences describing this in the PSA spec would be worthwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants