Thanks
Scott, you could try having a look here:
https://github.com/ntop/PF_RING/blob/dev/doc/UsersGuide.pdf
http://luca.ntop.org/IM2009_Tutorial.pdf
The default number of PF_RING slots is set at 4096, however for a high traffic network, you may want to increase the number of slots up to 65534 (or less, by increments of 4096) (min_num_slots in /etc/modprobe.d/pf_ring.conf), then reboot. I'm not sure exactly how large a single slot may be but, the documentation (above) suggests it could hold several packets/flows. I also have not been able to find much documentation in the way of a formula. I would try adjusting it by however much you think may be required, based on the amount of packets you may be dropping. You may want to leave it at the default, and if you do not begin dropping a lot of packets, I would not think you would need to change it (unless the amount of traffic would change, of course).
Thanks,
Wes
I spent some time today digging through the internet to pf_ring try and uncover what min_num_slots means in terms of the ring size, no luck. I found one article that said "Set it to a reasonable size..." but provided no further information :(
I will likely just find it experimentally at this point, thanks for your help.
Scott,
You should be able to see this from the "pf_ring stats" and "Netsniff-NG" section of the sostat output for the sensor in question.
Thanks,
Wes
| inline int pfring_there_is_pkt_available(pfring *ring) { | |
| #if 1 | |
| return(ring->slots_info->tot_insert != ring->slots_info->tot_read); | |
| #else | |
| /* stronger check: */ | |
| return ((ring->slots_info->remove_off != ring->slots_info->insert_off && | |
| (ring->slots_info->tot_insert != ring->slots_info->tot_read)) || | |
| ((ring->slots_info->remove_off == ring->slots_info->insert_off) && | |
| ((ring->slots_info->tot_insert - ring->slots_info->tot_read) >= ring->slots_info->min_num_slots))); | |
| #endif | |
| } |
--
You received this message because you are subscribed to a topic in the Google Groups "security-onion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/security-onion/zu7U7U9pBT8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to security-onio...@googlegroups.com.
Replies inline.
On Wed, Dec 23, 2015 at 4:27 PM, Scott Ellis <scor...@gmail.com> wrote:
>
> Doug - my understanding was that Netsniff-NG performed packet capture, but as I dug into the PF_Ring source, it became clear that PF_Ring is a packet capture tool. Is snort using PF_Ring, and Bro using Netsniff-NG?Snort, Suricata, and Bro use PF_RING. Netsniff-ng is totally separate and does not use PF_RING at all.
> Also, regarding the number of slots - Is SO setting the min_num_slots value for pf_ring?
Depending on what options you choose in Setup, it may ask if you want to change the default value of 4096.
> I was looking at the code, and I am sure I must be missing something, but it looks like this value is not even being used. SO I circle back again (no pun intended) to my original question, how big is a pf_ring and what impact does the slots count have on its size?
The default is 4096. If the amount of traffic you're monitoring fills all available slots, then you drop packets.
I'll take a stab at answering and maybe filling in some gaps, hopefully I don't mis-speak, if I do please correct.
The answer to your T/F is True.
"How big is the buffer in bytes is my final question."
See the description in pf_ring tuning below.
Tool: Bro IDS
Purpose: Protocol Detection, Logging, Alerting, etc
Packet Source: pf_ring
LB conf: /opt/bro/etc/node.cfg
Potential loss from source to tool:
- at the tap/span
- at the aggregation point
- at the sensor interface
- at pf_ring
- at bro
Note: Bro has a capture_loss.log which will show you a measurement of desyncs, this is a good indicator of loss upstream of Bro itself.
Tool: Snort/Suricata
Purpose: Alert IDS
Packet Source: pf_ring
LB conf: /etc/nsm/<sensorname>/sensor.conf
Potential loss from source to tool:
- at the tap/span
- at the aggregation point
- at the sensor interface
- at pf_ring
- at snort/Suricata
Tool: Netsniff_ng
Purpose: Full packet capture
Packet Source: no pf_ring
LB conf: n/a
Potential loss from source to tool:
- at the tap/span
- at the aggregation point
- at the sensor interface
- at Netsniff ng
PF_Ring Tuning:
Config: min_num_slots
Default: 4096
Recommended: 65534
Location: /etc/modprobe.d/pf_ring.conf
Description: a slot is used to store a packet, the size of a slot is defined by the caplen. The total potential size of the ring is caplen*min_num_slots, actual ring size is caplen*used slots. Lastly your total pf_ring memory footprint is the sum of each ring's cap*used. With a standard MTU and default min_num_slots that is a max memory footprint of 1518*4096=6,217,728 bytes per ring instance. Note if you're doing jumbo frames in any feed and you want actual FPC, be sure to adjust the MTU on the nic and each capture/reading tool and realize your ring size can change significantly (ex. 9000*4096=36,864,000 bytes or 9000*65543=589MB). Lastly, a slot should really only be used when your tool is overwhelmed as it is a buffer mechanism.
--
To unsubscribe from this group and all its topics, send an email to securit...@googlegroups.com.