tbarbette / fastclick

FastClick - A faster version of the Click Modular Router featuring batching, advanced multi-processing and improved Netmap and DPDK support (ANCS'15). Check the metron branch for Metron specificities (NSDI'18). PacketMill modifications (ASPLOS'21) as well as MiddleClick(ToN, 2021) are merged in main.
Other
279 stars 81 forks source link

Created toexternalprocess.cc #350

Open regufo opened 2 years ago

regufo commented 2 years ago

The Element ToExternalProcess is a not batch element that push data in a shared memory initialized by another process who lives out of FastClick. The referiment to the shared memory must be passed as a parameter. This Element consider the memory as diveided in virtual pages, each times it fill a virtual page it sets a shared semaphore. This class could be used to implements cybersecurity tools as WAF, NAC, IPS, IDS, or tools who neesd to interact with external data and functions. When the memory is full, this element go back to the first memory byte and rewrites the old contens. The external process should works the content before overwriting occurs. The parameters are:

Configuration Example: tep :: ToExternalProcess(SHARED_MEMORY_ID 123, SEMAPHORE_ID 255, BUFFER_SIZE 1024, NUMBER_OF_PAGES 128, ENTEER_PACKET 1, PACKAGE_SIZE 1522);

tbarbette commented 2 years ago

Hi @regufo !

First could you send both files in one pull request? You can update this one by pushing to the same branch :)

Do you have an example of how a "client" of this element could be used? A library that allows to read the memory from any software?

Do you have some comparison to other techniques like passing packets to a socket? What would be the interest compared to To/FromDPDKRing?

Also the "userlevel" directory would be better suited, as this element will not work in Kernel.

Thanks, Tom