netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: fw@strlen.de
Cc: netdev@vger.kernel.org, jbohac@suse.cz
Subject: Re: [PATCH 1/2] tcp: syncookies: reduce cookie lifetime to 128 seconds
Date: Wed, 28 Aug 2013 18:20:48 -0400 (EDT)	[thread overview]
Message-ID: <20130828.182048.371311612380335945.davem@davemloft.net> (raw)
In-Reply-To: <1377453242-4773-1-git-send-email-fw@strlen.de>

From: Florian Westphal <fw@strlen.de>
Date: Sun, 25 Aug 2013 19:54:01 +0200

> We currently accept cookies that were created less than 4 minutes ago
> (ie, cookies with counter delta 0-3).  Combined with the 8 mss table
> values, this yields 32 possible values (out of 2**32) that will be valid.
> 
> Reducing the lifetime to < 2 minutes halves the guessing chance while
> still providing a large enough period (possible cookies are
> only validated if last synqueue overflow was less than 3 seconds ago).
> 
> While at it, get rid of jiffies value -- they overflow too quickly on
> 32 bit platforms.
> 
> getnstimeofday is used to create a counter that increments every 64s.
> 
> Reported-by: Jakob Lell <jakob@jakoblell.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>

Moving from jiffies as a time seed to getnstimeofday() obviously will
have some performance impact, can you talk a little bit about that?


> +#define MAX_SYNCOOKIE_AGE 2 /* 128 seconds */

I'm sure you understand how 2 translates into 128 seconds in this syncookie
code, but I sure don't and the next person who reads this patch or this
code after I apply it may not either.

Could you in some way expose the calculation?  Thanks.

      parent reply	other threads:[~2013-08-28 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-25 17:54 [PATCH 1/2] tcp: syncookies: reduce cookie lifetime to 128 seconds Florian Westphal
2013-08-25 17:54 ` [PATCH 2/2] tcp: syncookies: reduce mss table to four values Florian Westphal
2013-08-28 22:22   ` David Miller
2013-08-28 22:20 ` David Miller [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=20130828.182048.371311612380335945.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=jbohac@suse.cz \
    --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).