From owner-freebsd-net@FreeBSD.ORG Fri Sep 10 05:36:25 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEB0816A4CE for ; Fri, 10 Sep 2004 05:36:25 +0000 (GMT) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id F209943D6D for ; Fri, 10 Sep 2004 05:36:24 +0000 (GMT) (envelope-from glebius@freebsd.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.11/8.12.8) with ESMTP id i8A5aKOB014587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Sep 2004 09:36:21 +0400 (MSD) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.sick.ru (8.12.11/8.12.11/Submit) id i8A5aJju014586; Fri, 10 Sep 2004 09:36:19 +0400 (MSD) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@freebsd.org using -f Date: Fri, 10 Sep 2004 09:36:19 +0400 From: Gleb Smirnoff To: Vlad GALU Message-ID: <20040910053619.GB14470@cell.sick.ru> Mail-Followup-To: Gleb Smirnoff , Vlad GALU , freebsd-net@freebsd.org References: <20040905121111.GA78276@cell.sick.ru> <4140834C.3000306@freebsd.org> <20040909171018.GA11540@cell.sick.ru> <414093DE.A6DC6E67@freebsd.org> <41409CB5.836DE816@freebsd.org> <20040909193507.GA12168@cell.sick.ru> <4140B603.8E979D72@freebsd.org> <20040909200052.GD12168@cell.sick.ru> <20040909234126.3f1c7cf3.dudu@diaspar.rdsnet.ro> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20040909234126.3f1c7cf3.dudu@diaspar.rdsnet.ro> User-Agent: Mutt/1.5.6i cc: freebsd-net@freebsd.org Subject: Re: [TEST/REVIEW] Netflow implementation X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2004 05:36:26 -0000 On Thu, Sep 09, 2004 at 11:41:26PM +0300, Vlad GALU wrote: V> This made me raise my eyebrow. I wrote a small tool that we use in V> production at RDS: http://freshmeat.net/projects/glflow. The way I V> designed it, it is supposed to clean up the flow tree once in a while V> and remove 'old' flows (that haven't had any packet matching them in the V> last X seconds). The problem is that I currently have about 400-500k V> active flows on a 700Mbps link. Every 10 seconds the software removes V> about 100-200k of them in no more than 0.2-0.3 seconds. Of course, I V> couldn't possibly send them over a socket somewhere else at that speed,, V> and chose to open a tempfile, mmap() it, write the expired flows to the V> buffer. When the buffer exceeds a programatically chosen number of V> packets, it is msync()-ed, munmap()-ed and a new file is open. If you remove 100-200k of flows every 10 seconds, this means you have 10 - 20 kpps of worm traffic or more! Impressive. 200k flows expired in 10 seconds is 666 export dgrams per second, 7 times more than I usually have in my testbed. Not sure, that ng_netflow + ng_ksocket can do this. Do you collect all this traffic on a single router? V> Do you accidentally have a better storage model ? I've been trying to V> dump these binary files to SQL but for a 42 meg binary log the necessary V> SQL storage went to about 150 megs, which is a bit over reasonable, V> considering the fact that the software dumps a binary file every 5 to 10 V> seconds. Dumping to SQL is a bad idea. I have tried it, too :) V> P.S. I haven't yet tried to aggregate the flows between reading them V> from the binary file and inserting the data into SQL. I thought it would V> take too much time to be able to keep up with the newly created dumps. This is how many people do. However I don't know details. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE