From: Glenn Griffin <ggriffin.kernel@gmail.com>
To: Florian Westphal <fw@strlen.de>
Cc: netdev@vger.kernel.org, Glenn Griffin <ggriffin.kernel@gmail.com>
Subject: Re: [PATCH] [Syncookies:] Add support for TCP-options via timestamps.
Date: Mon, 31 Mar 2008 11:19:46 -0700 [thread overview]
Message-ID: <47f12aa2.0d87460a.31a3.ffff8345@mx.google.com> (raw)
In-Reply-To: <1206922182-2214-1-git-send-email-fw@strlen.de>
> The downside is that the timestamp sent in the packet after the synack
> will increase by several seconds.
I didn't see any huge downsides quickly scanning over it. This could
cause a difference of upto ~500 jiffies from what we will send on the
first packet sent after receiving an ack. If you were connecting to
another linux peer I don't believe this would cause any huge issues, and
the rtt calculations would quickly recover once actual data
communications took place. The problem is the interpretation of our
timestamp is dependant on the remote systems logic and while smart peers
could quickly recover from the relatively small discrepancy during the
handshake it's hard to determine what effect it will have on other
hosts.
Considering this only matters when we are already in the midst of a DOS
attack, and tcp timestamps would otherwise be disabled it seems like an
okay tradeoff to me.
> +static u32 options_encode(u32 options)
> +{
> + u32 ts, ts_now = tcp_time_stamp;
> +
> + if (unlikely(options > ts_now)) { /* recent overflow */
> + options |= ~(TSMASK);
> + return options;
> + }
> + ts = ts_now & ~TSMASK;
> + ts |= options;
> + if (ts > ts_now) { /* try to fix up ... */
> + ts >>= TSBITS;
> + ts--;
> + ts <<= TSBITS;
> + ts |= options;
> + }
> + return ts;
> +}
I may be missing something obvious, but I'm failing to see where the
initial if(options > ts_now) does anything different from the more
generic logic below it. In order for ts_now to be smaller than options
it would need to have all bits above TSBITS off. If that's the case
then
ts >>= TSBITS;
ts--;
ts <<= TSBITS;
will flip all those bits on just as you do with
options |= ~(TSMASK)
Also the 'return ts' line is indented using spaces rather than tabs.
--Glenn Griffin
next prev parent reply other threads:[~2008-03-31 18:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-31 0:09 [PATCH] [Syncookies:] Add support for TCP-options via timestamps Florian Westphal
2008-03-31 18:19 ` Glenn Griffin [this message]
2008-03-31 21:00 ` Florian Westphal
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=47f12aa2.0d87460a.31a3.ffff8345@mx.google.com \
--to=ggriffin.kernel@gmail.com \
--cc=fw@strlen.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.