From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: David Miller <davem@davemloft.net>,
draghuram@rocketmail.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Cc: "Brian F. G. Bidulock" <bidulock@openss7.org>
Subject: Re: Question about tcp hash function tcp_hashfn()
Date: Thu, 1 Jun 2006 15:06:26 +0400 [thread overview]
Message-ID: <20060601110625.GA15069@2ka.mipt.ru> (raw)
In-Reply-To: <20060601042457.B25584@openss7.org>
On Thu, Jun 01, 2006 at 04:24:57AM -0600, Brian F. G. Bidulock (bidulock@openss7.org) wrote:
> For purely random numbers you could amplify thermal noise off an
> open transitor junction (the audiofile's white noise generator)
> and feed it into an analog to digital converter.
It is also possible to look into window and count how many times sun
hides and shines... It is quite cloudy in Moscow though.
As Acrypto asynchronous crypto layer author I can use different hardware
crypto accelerators, but it is a topic for another discussion.
> >
> > I've run it with following source ip/port selection algo:
> > if (++sport == 0) {
> > saddr++;
> > sport++;
> > }
> >
> > Starting IP was 1.1.1.1 and sport was 1.
> > Destination IP and port are the same 192.168.0.1:80
> >
> > Jenkins hash started to show different behaviour:
> > it does not have previous artefacts, but instead it's dispersion is
> > _much_ wider than in XOR case.
>
> Aha! But perhaps this is too easy a data set. HTTP clients typically
> dynamically allocate port numbers within a range and source address
> are typically not less than a certain value. That is why I suggested
> something like:
>
> sport = 10000;
> saddr = 0x0a000000; /* 10.0.0.0 */
>
> ...
>
> if (++sport == 16000) {
> sport = 10000;
> saddr++;
> }
>
> If this shows artifacts worse than XOR then more realistic gaps in the
> input values will cause artifacts.
Specially for you :)
It does not have artifacts, but it's dispersion is wider than XOR one.
_Much_ wider, which tends to creation of some specially crafted source
distribution which ends up in totally broken fairness.
As usual folded and not folded versions behave exactly the same.
> > With following ip/port selection algo:
> > if (++sport == 0) {
> > //saddr++;
> > sport += 123;
> > }
> >
> > I see yet another jenkins artefacts, but again different from previous
> > two.
>
> Adding primes. Again, the arithmetic series of primes might auto-correlate
> with the Jenkins function. Or it plain might not like gaps.
>
I want to confirm three things and one state:
1. Jenkins hash has some unacceptible artefacts in some source
address/port distributions, no matter if it has some law embedded or it
is (pseudo)-random set.
If there are bugs, bugs exist.
2. If it does not have artifacts it has unacceptible dispersion.
3. It is 3 times slower than XOR one (28 seconds for XOR for 2^29
iterations vs. 101 seconds jhash nonfolded and 109 jhash folded on my AMD64
3500+ 2.2 Ghz desktop).
4. I believe it can be tuned or has some gaps inside refactoring logic,
which can be fixed, but as is it can not be used for fair hash creation.
--
Evgeniy Polyakov
next prev parent reply other threads:[~2006-06-01 11:06 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060531042908.10463.qmail@web51410.mail.yahoo.com>
[not found] ` <20060530235525.A30563@openss7.org>
2006-05-31 7:10 ` Question about tcp hash function tcp_hashfn() David Miller
2006-05-31 7:45 ` Brian F. G. Bidulock
2006-05-31 7:49 ` David Miller
2006-05-31 8:00 ` Brian F. G. Bidulock
2006-05-31 9:03 ` Evgeniy Polyakov
2006-05-31 9:12 ` David Miller
2006-05-31 9:44 ` Evgeniy Polyakov
2006-05-31 9:51 ` Brian F. G. Bidulock
2006-05-31 10:58 ` Evgeniy Polyakov
2006-05-31 11:04 ` Evgeniy Polyakov
2006-05-31 13:06 ` Evgeniy Polyakov
2006-05-31 18:29 ` Brian F. G. Bidulock
2006-06-01 6:12 ` Evgeniy Polyakov
2006-06-01 6:18 ` David Miller
2006-06-01 6:22 ` Brian F. G. Bidulock
2006-06-01 6:24 ` David Miller
2006-05-31 18:41 ` David Miller
2006-06-01 6:04 ` Evgeniy Polyakov
2006-06-01 6:18 ` Brian F. G. Bidulock
2006-06-01 6:30 ` Evgeniy Polyakov
2006-06-01 6:46 ` Brian F. G. Bidulock
2006-06-01 7:01 ` Evgeniy Polyakov
2006-06-01 7:11 ` Brian F. G. Bidulock
2006-06-01 8:38 ` Evgeniy Polyakov
2006-06-01 10:24 ` Brian F. G. Bidulock
2006-06-01 11:06 ` Evgeniy Polyakov [this message]
2006-06-01 18:40 ` Brian F. G. Bidulock
2006-06-01 20:21 ` David Miller
2006-06-02 7:01 ` Evgeniy Polyakov
2006-06-02 5:40 ` Florian Weimer
2006-06-02 7:48 ` Evgeniy Polyakov
2006-06-02 15:10 ` Brian F. G. Bidulock
2006-06-02 17:26 ` Florian Weimer
2006-06-02 17:37 ` Brian F. G. Bidulock
2006-05-31 9:52 ` Brian F. G. Bidulock
2006-05-31 8:49 ` Brian F. G. Bidulock
2006-05-31 9:02 ` David Miller
2006-05-31 9:39 ` Brian F. G. Bidulock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060601110625.GA15069@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=bidulock@openss7.org \
--cc=davem@davemloft.net \
--cc=draghuram@rocketmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).