Skip to content

Optimising Traffic mirroring  #53

@aka320

Description

@aka320
  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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions