lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 18 Apr 2014 13:21:35 -0700
From:	Alexei Starovoitov <ast@...mgrid.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Chema Gonzalez <chema@...gle.com>,
	David Miller <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Daniel Borkmann <dborkman@...hat.com>,
	Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH] filter: added BPF random opcode

On Wed, Apr 16, 2014 at 6:38 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> On Tue, 2014-04-15 at 23:24 -0700, Alexei Starovoitov wrote:
>
>> In particular I don't find the reason of moving random
>> packet sampling into kernel to be that great.
>> pcap cannot receive them quickly enough anyway,
>> so there are drops already.
>> Just randomly pick packets that reached the user space.
>> Why add this to the kernel? I don't see how it can improve accuracy.
>
> It has nothing to do with speed or accuracy.
>
> Being able to intercept 0.001 % of the packets (and not 0.001 % of the
> flows...) can be useful to network operators.
>
> _Then_ if its super super super fast, thats better, of course.
>
> Suggesting to intercept all packets, then filtering 99.999 % of them in
> user space is not going to work. Its going to be super super super slow.

correct.
I was suggesting user space approach, because example does:
+  ld rand
+  mod #4
+  jneq #1, drop

If 4 is replaced with rate of packets per second and which can be
roughly estimated before creating the filter, then this example would
make sense.
On a loaded server the rate will be in tens of millions, but when it idles
this fixed rand()%1000000==1 won't be sending anything to
userspace for hours.

I suspect adding 'ld rand' just 'felt' useful and no real
filters were created with it.
For true packet sampling 'ld getnstime' would be needed too.
As I said I like the approach, I just want to see a real use case for it.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists