
mike.cox52 at gmail
May 3, 2012, 9:26 AM
Post #3 of 5
(582 views)
Permalink
|
|
Re: PF_RING 75-88% packet loss (using Suricata)
[In reply to]
|
|
Thanks Chris. The reason I didn't post this to an OISF list is because it appears to be related to PF_RING (I know Suricata is pegging the processors and maybe that is causing PF_RING to drop so much but if not, I was going to address that after I got PF_RING working). I've profiled the Suricata rules and I don't have any "hogs" (just running the ET set) and the stats.log file from Suricata show some drops but drop.log is empty: ------------------------------------------------------------------- Counter | TM Name | Value ------------------------------------------------------------------- decoder.pkts | RxPFR1 | 833798615 decoder.bytes | RxPFR1 | 502533217963 decoder.ipv4 | RxPFR1 | 833225481 decoder.ipv6 | RxPFR1 | 0 decoder.ethernet | RxPFR1 | 833798615 decoder.raw | RxPFR1 | 0 decoder.sll | RxPFR1 | 0 decoder.tcp | RxPFR1 | 737496688 decoder.udp | RxPFR1 | 80191916 decoder.sctp | RxPFR1 | 0 decoder.icmpv4 | RxPFR1 | 220048 decoder.icmpv6 | RxPFR1 | 0 decoder.ppp | RxPFR1 | 0 decoder.pppoe | RxPFR1 | 0 decoder.gre | RxPFR1 | 0 decoder.vlan | RxPFR1 | 0 decoder.avg_pkt_size | RxPFR1 | 603 decoder.max_pkt_size | RxPFR1 | 1514 defrag.ipv4.fragments | RxPFR1 | 406 defrag.ipv4.reassembled | RxPFR1 | 4 defrag.ipv4.timeouts | RxPFR1 | 0 defrag.ipv6.fragments | RxPFR1 | 0 defrag.ipv6.reassembled | RxPFR1 | 0 defrag.ipv6.timeouts | RxPFR1 | 0 flow_mgr.closed_pruned | FlowManagerThread | 23484250 flow_mgr.new_pruned | FlowManagerThread | 2602702 flow_mgr.est_pruned | FlowManagerThread | 3074493 flow.memuse | FlowManagerThread | 41752256 flow.spare | FlowManagerThread | 101334 flow.emerg_mode_entered | FlowManagerThread | 0 flow.emerg_mode_over | FlowManagerThread | 0 tcp.sessions | Detect | 9464226 *tcp.ssn_memcap_drop | Detect | 0* tcp.pseudo | Detect | 2961971 tcp.invalid_checksum | Detect | 0 tcp.no_flow | Detect | 0 tcp.reused_ssn | Detect | 637 tcp.memuse | Detect | 415236096 tcp.syn | Detect | 12401324 tcp.synack | Detect | 12055841 tcp.rst | Detect | 12859628 *tcp.segment_memcap_drop | Detect | 120855441* tcp.stream_depth_reached | Detect | 207 tcp.reassembly_memuse | Detect | 6442450836 *tcp.reassembly_gap | Detect | 2469925* detect.alert | Detect | 7408 For Suricata, I have 'threads: 1' under 'pfring:' and the default 'detect-thread-ratio: 1.5' under 'threading:'. NIC info (I don't think this supports 'transparent_mode=2"): # dmesg | grep 'Ethernet' bnx2: Broadcom NetXtreme II Gigabit Ethernet Driver bnx2 v2.1.11 (July 20, 2011) # ls /proc/net/pf_ring/ 1509-eth2.23 dev info plugins_info # ls /proc/net/pf_ring/dev/ eth0 eth1 eth2 eth3 ls /proc/net/pf_ring/dev/eth2 info # cat /proc/net/pf_ring/dev/eth2/info Name: eth2 Index: 4 Address: 00:1B:78:31:D1:D4 Polling Mode: NAPI/TNAPI Type: Ethernet Family: Standard NIC # Bound Sockets: 1 # Used RX Queues: 1 Am I missing something here? I'm pretty new to PF_RING so any help is appreciated. Thanks. -Mike Cox On Thu, May 3, 2012 at 10:41 AM, Chris Wakelin <c.d.wakelin [at] reading> wrote: > On 03/05/12 16:28, Mike Cox wrote: >> This is my first time posting so I apologize if this is a simple >> question or has been asked before. >> >> I am seeing 75-88% packet loss on PF_RING, running Suricata Suricata >> 1.3dev (rev e6dea5c) and PF_RING 5.3.0 on CentOS. Suricata is pegging >> all four 1.6 GHz processor cores but the reason I'm posting here is >> because it looks like PF_RING is responsible for all the drops. >> >> The suricata.drop log is not showing drops and I'm running Suricata >> with the pf_ring options '--pfring-int=eth2 --pfring-cluster-id=99 >> --pfring-cluster-type=cluster_flow ' and '--runmode=autofp' (I have >> also increased pre-allocation, reassembly, and session memory sizes in >> Suricata's config). > > Do you have any tcp.reassembly_gap in Suricata's stats.log? Another one > to look at is "tcp.ssn_memcap_drop" in case you've not made the buffers > big enough. I'd also recommend "runmode=workers". How many threads do > have configured? This sort of discussion is better on the oisf-users > list, though. > > More to the point in PF_RING, what network card and driver are you using? > >> >> ifconfig doesn't show the drops (except for some packets that wanted >> to be forwarded and 1 checksum error): >> >> # /sbin/ifconfig eth2 >> eth2 Link encap:Ethernet HWaddr 00:1B:78:31:D1:D4 >> UP BROADCAST RUNNING NOARP PROMISC MULTICAST MTU:1500 Metric:1 >> RX packets:2340853835 errors:1 dropped:130 overruns:0 frame:1 >> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 >> collisions:0 txqueuelen:1000 >> RX bytes:2910286855 (2.7 GiB) TX bytes:0 (0.0 b) >> Interrupt:185 Memory:f4000000-f4012800 >> >> # cat /proc/net/pf_ring/1509-eth2.23 >> Bound Device(s) : eth2 >> Slot Version : 13 [5.3.0] >> Active : 1 >> Breed : Non-DNA >> Sampling Rate : 1 >> Capture Direction : RX+TX >> Socket Mode : RX+TX >> Appl. Name : Suricata >> IP Defragment : No >> BPF Filtering : Disabled >> # Sw Filt. Rules : 0 >> # Hw Filt. Rules : 0 >> Poll Pkt Watermark : 128 >> Num Poll Calls : 4711762 >> Channel Id : -1 >> Cluster Id : 0 > > That doesn't match what you said on the command line > > ... > > >> # cat /proc/net/pf_ring/info >> PF_RING Version : 5.3.0 ($Revision: exported$) >> Ring slots : 4096 >> Slot version : 13 >> Capture TX : Yes [RX+TX] > > >> IP Defragment : No >> Socket Mode : Standard >> Transparent mode : Yes (mode 0) > > I'd recommend "transparent_mode=2" on the PF_RING options; you probably > don't need TX. > >> RAM usage on the box is less than half of the 3+ GB and eth2 basically >> sits off a span port on the switch and sees 40-60 MiB of traffic. > > I'm monitoring more than 10x that with Suricata + PF_RING on a quite old > box. > > Best Wishes, > Chris > > -- > --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- > Christopher Wakelin, c.d.wakelin [at] reading > IT Services Centre, The University of Reading, Tel: +44 (0)118 378 2908 > Whiteknights, Reading, RG6 6AF, UK Fax: +44 (0)118 975 3094 > _______________________________________________ > Ntop-misc mailing list > Ntop-misc [at] listgateway > http://listgateway.unipi.it/mailman/listinfo/ntop-misc
|