Re: [tcpm] Faster application handshakes with SYN/ACK payloads (RESEND)

Matt Mathis <> Fri, 01 August 2008 19:04 UTC

Return-Path: <>
Received: from [] (localhost []) by (Postfix) with ESMTP id 2E0CD3A68B2; Fri, 1 Aug 2008 12:04:25 -0700 (PDT)
Received: from localhost (localhost []) by (Postfix) with ESMTP id 8342A3A68B2 for <>; Fri, 1 Aug 2008 12:04:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.444
X-Spam-Status: No, score=-1.444 tagged_above=-999 required=5 tests=[AWL=-0.385, BAYES_00=-2.599, SARE_LWHUGE=1.54]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id SGNPm0sq4aPL for <>; Fri, 1 Aug 2008 12:04:23 -0700 (PDT)
Received: from ( [IPv6:2001:5e8:2:42::6a]) by (Postfix) with ESMTP id CE2453A67B6 for <>; Fri, 1 Aug 2008 12:04:22 -0700 (PDT)
Received: from ( []) by (8.14.2/8.13.3) with ESMTP id m71J4fee024850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Aug 2008 15:04:41 -0400 (EDT)
Received: from ( []) by (8.13.1/8.13.1) with ESMTP id m71J4fcO028208; Fri, 1 Aug 2008 15:04:41 -0400
Date: Fri, 01 Aug 2008 15:04:41 -0400
From: Matt Mathis <>
To: Adam Langley <>
In-Reply-To: <>
Message-ID: <>
References: <>
MIME-Version: 1.0
Subject: Re: [tcpm] Faster application handshakes with SYN/ACK payloads (RESEND)
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"

Opps I posted to the wrong thread.   Sorry folks..

Doesn't this create a huge opportunity for a DoS attack, since an attacker can 
send requests with forged from addresses, and the server has to
burn cycles and/or commit memory, when it is never going to see the next 

I believe that this problem is fundamental to anything that is piggybacked on 
the SYN and has killed every attempt at using the handshake to
eliminate later transactions.  The server wants to know for sure that the 
client is alive and responding before committing more than incidental
resources (e.g. SYN queue, constructing a SYN-cookie, etc) to the connection.

Matt Mathis
Work:412.268.3319    Home/Cell:412.654.7529
Evil is defined by mortals who think they know
"The Truth" and use force to apply it to others.

On Thu, 31 Jul 2008, Adam Langley wrote:

> I posted this a while back and it gathered a little discussion:
> (implementation in [1])
> I would like to have this published as Experimental and to get an
> option number assigned.
> The spec itself includes a somewhat rambling justification because I
> wanted to decouple the spec, which is more general, from the exact
> reason that I wish to start testing this over the Internet at large.
> However, in order to provoke discussion I think I should explain my
> motivation:
> This spec allows for opportunistic encryption of TCP connections with
> no additional round trips. Details of the project can be found at [2],
> however a quick summary follows:
> Although SYN/ACK payloads could be used to accelerate many protocols,
> I'm proposing that, for HTTP, the SYN/ACK payload contains an 8-byte
> random nonce and a 32-byte eliptic-curve public value. The client can
> then perform key agreement and send it's own public value, nonce and
> any encrypted payload in the final ACK. (Or in a following packet,
> that works fine too). Data is then encrypted using Salsa20/8 where the
> key is SHA256(diffie-hellman output + server nonce + client nonce) and
> the IVs are 0 and 2**63 for client->server and server->client, resp.
> Obviously, this open to both a downgrade and man-in-the-middle attack.
> For a specific user, it offers little real security. However,
> amortised over a large set of users, any ISPs performing these attacks
> on a large scale will be detected. (I plan on building a network of
> hosts probing for large scale attacks.) Thus, eavesdroppers are
> removed from the equation and, against the rest, it can protect most
> of the people, most of the time.
> I also plan to sign the resulting packets with TCP-AO at some point,
> if possible. However, given that that is still under development I'm
> going to make that part of the negotiation, above, so that it can be
> deployed without it for now.
> Obviously, this system can only prove itself in time. However, it
> can't prove itself with an option number assigned. And thus, I'm
> looking for a consensus that this is an interesting experiment.
> Thanks
> Having spoken to quite a few people about this, I now have an FAQ on
> the design which is included below:
> * Why Elliptic-curves?
> The payload must be short otherwise SYN-floods could use this as an
> amplification
> to backscatter DDoS another host.
> Also, the reduced computation cost (as compared to Diffie-Hellman over a
> multiplicative finite field) is very nice.
> * Why 25519?
> It's very fast (2000 ops/sec with my C code. 4000 ops/sec with asm). Also, the
> server's public value must be constant, otherwise an attacker could eat CPU
> time with a SYN flood and curve25519 is designed for that.
> Since this is constant for all connections, there is no perfect forward
> secrecy.
> * Can't you fit the client's public value in the SYN?
> A SYN generally has 20 bytes of free option space these days. (We can't use the
> payload space in a SYN). Since this can't be the last option ever, we need to
> leave 4 bytes spare. 2 bytes for the option header means 14 bytes for the
> public value. The closest prime is 2**112-75.
> I'm a bear of little brain and picking my own curve is already a hell of a
> task, but assuming that I can:
> The best, general algorithm currently known for breaking the DH problem on
> elliptic curves is Pollard's Rho. The work involved in this attack is sqrt(n),
> which is 2**56 in this case. Critically, once you have solved a single instance
> you can precompute tables to speed up breaking more instances. With a petabyte
> of storage, you could break 112-bit curves in 2**12 operations, which is very
> fast.
> * Can't you use a smaller field anyway?
> Some speedup could be gained by using an EC with a field size around 200 bits.
> However the effort of defining such a curve is pretty huge. The standard NIST
> curves around that size are slower:
> (table 6)
> * Why Salsa20/8?
> It encrypts at two cycles per byte on modern CPUs[1]. The best attack on this,
> reduced round, variant is 2**251. It's very unlikely that an attack would ever
> break it to the point that it's easier than performing a downgrade attack.
> [1]
> [2]
> -- 
> Adam Langley
> _______________________________________________
> tcpm mailing list
tcpm mailing list