netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Brian F. G. Bidulock" <bidulock@openss7.org>
To: David Miller <davem@davemloft.net>
Cc: draghuram@rocketmail.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: Question about tcp hash function tcp_hashfn()
Date: Wed, 31 May 2006 02:49:54 -0600	[thread overview]
Message-ID: <20060531024954.A2458@openss7.org> (raw)
In-Reply-To: <20060531.004953.91760903.davem@davemloft.net>; from davem@davemloft.net on Wed, May 31, 2006 at 12:49:53AM -0700

David,

On Wed, 31 May 2006, David Miller wrote:
> 
> For sure and there are plans afoot to move over to
> dynamic table sizing and the Jenkins hash function.

Just a suggestion, but I have an approach that stands to be
faster than Jenkins deriving from the verification tag approach
that I took for SCTP (OpenSS7 SCTP not lksctp).

TCP uses a cryptographic hash function to select its initial
sequence number (SCTP does the same for vtag).  Last I checked
it was taken from an MD4 swirled entropy pool and further
combined with the local and remote IP addresses and port
numbers.

Each received segment contains a sequence number that is offset
from the initial sequence number but is expected to appear
within the current window.  Most of the high order bits of an
in-window sequence number are predicatable at any point in time
and, due to cryptographic strength, are more efficient than
Jenkins, ... and they are right there in the received packet.

The approach would take the high order bits of the received
sequence number and use them to index a separate sequence number
keyed established hash (which could be dynamic). As the window
changes, the socket would have to be removed and reinserted into
this hash, but the repositioning would be infrequent.  Out of
window segments would fail to find a socket, but could fall back
to the current established hash, or even the bind hash.  A layer
of caching could increase the hash lookup speed further for
noisy senders.

This would be faster than a Jenkins hash approach because it
would not be necessary to calculate the hash function at all for
in-window segments.  Per packet overheads would decrease and
better small packet performance would be experienced (i.e. your
http server).  It has better hash coverage because MD4 and other
cryptographic algorithms used for initial sequence number
selection have far better properties than Jenkins.

What do you think?


  parent reply	other threads:[~2006-05-31  8:49 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
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 [this message]
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=20060531024954.A2458@openss7.org \
    --to=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).