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 03:39:47 -0600	[thread overview]
Message-ID: <20060531033947.A3065@openss7.org> (raw)
In-Reply-To: <20060531.020239.00305778.davem@davemloft.net>; from davem@davemloft.net on Wed, May 31, 2006 at 02:02:39AM -0700

David,

On Wed, 31 May 2006, David Miller wrote:
> 
> I don't know how practical this is.  The 4GB sequence space
> wraps very fast on 10 gigabit, so we'd be rehashing a bit
> and 100 gigabit would make things worse whenever that shows
> up.

It works better for SCTP, because the vtags are constant.  No
rehashing is required there.

But, also consider that rehashing is only required for senders
sending at a high data rate.  (http clients will likely never
have to be rehashed.)  These packets will typically be large and
per-packet overheads will be overwhelmed by per-byte overheads.

Also, the rehashing is orderly and simple, the entry is simply
bumped to the next sequential hash slot and the socket hash
structure can already be cached at the time the action is
performed.  Rehashing, although a bother, would take little
time, and could simply be added as part of TCP's existing window
calculations.

> 
> It is, however, definitely an interesting idea.
> 
> We also need the pure traditional hashes for net channels.  I don't
> see how we could use your scheme for net channels, because we are just
> hashing in the interrupt handler of the network device driver in order
> to get a queue to tack the packet onto, we're not interpreting the
> sequence numbers and thus would not able to maintain the sequence
> space based hashing state.

Under SCTP I still have the traditional established hash for
lookups of out of the blue packets and packets containing
invalid verification tags.  Really long lookups would invite DoS
attacks on these.

> 
> On a 3ghz cpu, the jenkins hash is essentially free.  Even on slower
> cpus, jhash_2words for example is just 20 cycles on a sparc64 chip.
> It's ~40 integer instructions and they all pair up perfectly to
> dual issue.  We'd probably use jhash_3words() for TCP ipv4 which
> would get us into the 30 cycle range.

But you could throw away all 30 cycles, plus the stacking and
unstacking of registers to get in and out of the algorithm.
Some architectures might benefit more.

Well, I thought you might find it interesting.  Perhaps somebody
reading this will experiment with it.  For SCTP it is one of a
number of techniques that allows OpenSS7 SCTP to drastically
outperform lksctp.

--brian

      reply	other threads:[~2006-05-31  9:39 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
2006-05-31  9:02           ` David Miller
2006-05-31  9:39             ` Brian F. G. Bidulock [this message]

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=20060531033947.A3065@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).