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

Bad system of dropping packets #10

Open
xbrakl opened this issue Mar 7, 2022 · 0 comments
Open

Bad system of dropping packets #10

xbrakl opened this issue Mar 7, 2022 · 0 comments

Comments

@xbrakl
Copy link

xbrakl commented Mar 7, 2022

This code checks the checksum of the packet in both ingress as well as egress parser, but doesn't store result of the checksum verification into a value in user-defined metadata (out metadata meta parameter of both parsers). As a result of this mistake, both ingress and egress control have no idea, that they should change the value of drop_ctl parameter which indicates when packet should be dropped.

Possible solution:
structure (out metadata meta) should have parameter something like bool checksum_error which ingress and egress control can analyze and set the proper value of the ingress deparser metadata parameter drop_ctl so then deparser can drop the packet based on the value of this parameter drop_ctl.

Also code of both ingress and egress deparsers is not checking this parameter drop_ctl and is not droping packets when this parameter indicates, that packet should be dropped.

#ifdef TOFINO
ipv4_checksum.add(hdr.ipv4);
/*// Output of verify is 0 or 1*/
/*// If it is 1, there is checksum error*/
ipv4_checksum.verify();
#endif

ipv4_checksum.add(hdr.ipv4);
/*// Output of verify is 0 or 1*/
/*// If it is 1, there is checksum error*/
ipv4_checksum.verify();

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

1 participant