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

Optimising Traffic mirroring #53

Open
aka320 opened this issue May 16, 2023 · 0 comments
Open

Optimising Traffic mirroring #53

aka320 opened this issue May 16, 2023 · 0 comments
Assignees

Comments

@aka320
Copy link

aka320 commented May 16, 2023

  1. Avoiding ntohs() operation for every incoming packet
  • We read the source and destination port from the packet and change the byte order before doing look-up. We can do this operation while updating the port in the MAP, so that we can avoid it doing for every packet. ntohs() is done twice for every packet.
  1. Performing Bitwise operation instead of Modulo
  • Even or odd can be identified by doing bitwise & with 1, instead of modulo operation which involves division and getting the reminder i.e requires more operations. (((*ifany) >> (0)) % 2 == 1) is done thrice for every packet if the variable 'ifany' is configured.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant