quick question: is the bro-myricon plugin (by Seth) still necessary when using myricom nics with Zeek? I know with pf_ring this is not the case anymore since bro can be directly linked to a modified pf_ring libpcap and I was wondering if this is the case for myricom too.
There are some advantages to using the Myricom plugin directly. Generally in my opinion I've been trying to avoid libpcap wrappers for quite a few years now because of various quality issues associated with several of them that I've experienced. There tends to be API functionality that you don't have an opportunity to take advantage of with a pcap wrapper too.
To some degree this is personal preference though.
Looking at the myricom software API, I see that they have both a libpcap wrapper and more advanced functionalities in snf.h. Not all source code is open, however, and I am not sure which functionalities are implemented in the libpcap wrappers. In your plugin you are using snf_open to open the NIC device. I would like to open a Myricom NIC with both aggregation and load_balancing, i.e.
int flags = SNF_F_PSHARED;
flags |= SNF_F_AGGREGATE_PORTMASK;
A few years ago I found a bug in the snfv3 shipped libpcap where pcap_next would return the previous packet when no packets were available instead of returning NULL. As far as I know it’s still not fixed.
Libpcap also makes (with some capture technologies) two calls per packet - one to get the packet and another to get the time stamp. That kills the performance.
When I was developing the early version of the myricom Zeek plugin, I didn’t really notice much, of any, performance improvement.
Btw you can use upstream libpcap and build it yourself against SNF. But why. Get the plugin. It’s easier.
If there are some missing pieces in the plugin I ought be able to help. We not longer have myricoms in production but I keep them in stage servers, for the community
I wasn't referring to bugs in libpcap. It's the libpcap wrappers (which typically aren't libpcap, but rather reimplementations of some or all of the libpcap api).
Ahh, it's a little hard to track these bugs because they tend to come and go without much documentation because vendors will just fix them in their SDKs and not make a big deal about it.