Re: Explicit measurability in the QUIC wire image (was Re: Packet number encryption)

Kazuho Oku <kazuhooku@gmail.com> Wed, 07 February 2018 11:10 UTC

Return-Path: <kazuhooku@gmail.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6E19C126C0F for <quic@ietfa.amsl.com>; Wed, 7 Feb 2018 03:10:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1
X-Spam-Level:
X-Spam-Status: No, score=-1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QNsld3hAKc7Q for <quic@ietfa.amsl.com>; Wed, 7 Feb 2018 03:10:06 -0800 (PST)
Received: from mail-pg0-x22a.google.com (mail-pg0-x22a.google.com [IPv6:2607:f8b0:400e:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6F936124D6C for <quic@ietf.org>; Wed, 7 Feb 2018 03:10:06 -0800 (PST)
Received: by mail-pg0-x22a.google.com with SMTP id x25so159032pge.3 for <quic@ietf.org>; Wed, 07 Feb 2018 03:10:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=QwiLzwDM6q6ikmZUHzXpfKhi+NaiNKM9rN2pGd7w3Ek=; b=QHCmKdbOtb7OZBi0RHadV+oW/Gs3YQZkMn2C9yeA+FZKZmt97J/zMpL9W0HdudoLHp tyhE+skr7beHI1L2KrGCwiCckmKmUqPR8viriXAVBQYgRzOCN2ks0R+MVl0FMl4gj590 e+Sz/BbOafJxwvNXGpMrJwcxbIPLvZtZlnTcUWiWJqgY30LYTMDaVJJ67a0k27S2ZWjF IH2YQHM8tkPWhSOyUF8VyQgcsiPUHcIzlDAvKZr3QQE++SMqFmZ6gjaHWI5bbnfPuUi1 cdQBkU7SVcxxycrN7tymyAlMjc4DLV8X3Xe7LHQ6JSOThW2j1Z2lx2b3JUg/ed9iuzQy mCkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QwiLzwDM6q6ikmZUHzXpfKhi+NaiNKM9rN2pGd7w3Ek=; b=JPwS/KZG6K/9eFCOB8YyCtTLtqCSyafEwV2k5HIhNQAVXX/l9r5nS4ZIe0Toq6X+sk y5F9kLwPN2SDxqbTKeyYJdMqTJZZKFYsJe/hyrZRtroAeLPMYhTZnE8PWgDmo037Rcd9 bEO0LQ/wnACxagiY6ehqXrTY+6CdkB7oq9qqiSsMaF+AKx2+j6MlPsxBw9VkTleWM248 WViBQwlkmAmI64ETT1Y/qLhtgDR5AVnk71O7HMaOjcs/1VallePhgM4W7GKEz+tVtU8D hO+b9GTOnpRghU7WLE9ui3VbVZfBDPJeg9GIA46l2hUe2wVpPDcI8jvRC3vx7dmTkPak PNbQ==
X-Gm-Message-State: APf1xPCbbkB3ZAkEx2UuHojbVudVRNre4BsG8p0NkSmKoBn7/Goz1s+S cqmd+6Cf1pvc9rqKdioH/XhonWIeDOfmHAWSh40=
X-Google-Smtp-Source: AH8x225SJwBouBPQKWg59NNQJP3vFdm0B23Pg3A6koBhH4TCjKf59r7Y9h57j9Xdc6U4QUaKT4GomRG98EGd5f6E9JY=
X-Received: by 10.98.19.19 with SMTP id b19mr5708335pfj.118.1518001803660; Wed, 07 Feb 2018 03:10:03 -0800 (PST)
MIME-Version: 1.0
Received: by 10.236.156.11 with HTTP; Wed, 7 Feb 2018 03:10:02 -0800 (PST)
In-Reply-To: <CAN1APddkFxLFREQQe+0Kqqi+zJeU20ALjzN4R0Muf9FD1BzZUg@mail.gmail.com>
References: <CABkgnnVyo3MmWtVULiV=FJTnR528qfY8-OmKGWAs0bCvri-a_g@mail.gmail.com> <1F7FB3B8-A94C-4354-9944-FB09FB8DB68B@trammell.ch> <CABcZeBMbwdwyC9TxxHBLYaZKfNB-FG2wCGjqUZ_mNR-A1R47FA@mail.gmail.com> <9096e5ec-581e-875a-b1dd-bff0b05206fd@huitema.net> <CABkgnnWRQSAufwPss+qf=xAzCwRYeNNH8XLPm3yFaHxOb+ba4g@mail.gmail.com> <BF80500A-6277-45DC-8525-9C3FE138B76D@tik.ee.ethz.ch> <5A7191E0.6010003@erg.abdn.ac.uk> <5214AD93-8376-4B25-922F-AF5551CC2E95@netapp.com> <F990E064-E6F8-41A3-B791-F776C9955E15@nokia.com> <CAGD1bZab0GaZFsHwC+nw3AxxC4VusxMJ6oDanzk3dSDdWKAXdw@mail.gmail.com> <2C515BE8694C6F4B9B6A578BCAC32E2F83BA1443@MBX021-W3-CA-2.exch021.domain.local> <BY2PR15MB07757473DB9788558B902EB5CDF80@BY2PR15MB0775.namprd15.prod.outlook.com> <6E58094ECC8D8344914996DAD28F1CCD861B7F@DGGEMM506-MBX.china.huawei.com> <e529144067624fcba636fc8c24ee3ff4@usma1ex-dag1mb5.msg.corp.akamai.com> <BY2PR15MB07754D83A1721F2BD742359BCDFE0@BY2PR15MB0775.namprd15.prod.outlook.com> <2CD9DC43-D69B-43F0-8474-DFE798850A52@akamai.com> <CAGD1bZaUuNxqpDkn62B0wWcFD8=mCUWrAwWGG-rAOxH7Mf1=cQ@mail.gmail.com> <CY4PR21MB01334E30C7AF6AE75F58EEFDB6FE0@CY4PR21MB0133.namprd21.prod.outlook.com> <CAGD1bZaxrqzdkk0wxRaULwOTgg6wnrSrXNBK31s4uxdozaACBA@mail.gmail.com> <CAGD1bZbOAaSBcQw4nVtGuwRunaAW8MYHq9yPxNN6DdKHzt5HtQ@mail.gmail.com> <CANatvzx+uDHMV5XS=OuVYBqe_RYX=EmVWAmjuONS8BpNYCPweA@mail.gmail.com> <5233815B-00F3-4961-ABB8-505906258B89@trammell.ch> <CAN1APdcuKSLYw4Odyc4g=+4_+ojsNekeqmM9eYqxykkfxRx3Cg@mail.gmail.com> <CANatvzz3rmGPRgu1Z5+bAHhgjiN3L5OVTDhb4fmpPX+M8o4z3w@mail.gmail.com> <DB6PR10MB17661B9957DF90733FA28EC5ACFD0@DB6PR10MB1766.EURPRD10.PROD.OUTLOOK.COM> <DB6PR10MB176682C63A91007574BBEAECACFC0@DB6PR10MB1766.EURPRD10.PROD.OUTLOOK.COM> <CAN1APddkFxLFREQQe+0Kqqi+zJeU20ALjzN4R0Muf9FD1BzZUg@mail.gmail.com>
From: Kazuho Oku <kazuhooku@gmail.com>
Date: Wed, 07 Feb 2018 20:10:02 +0900
Message-ID: <CANatvzw3RFekoHx_MJWkDY0Q+G2gUNshpocozwkQWpH8sqnnTA@mail.gmail.com>
Subject: Re: Explicit measurability in the QUIC wire image (was Re: Packet number encryption)
To: Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>
Cc: "Brian Trammell (IETF)" <ietf@trammell.ch>, QUIC WG <quic@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/9g9KMRwz1TSAqkWf_gGei1pnacI>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Feb 2018 11:10:08 -0000

2018-02-07 18:10 GMT+09:00 Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>:
> Instead of a static Pi table, an xorshift+ PRNG could be used. It would
> likely be preferable to shorten the cycle such that observers can use hash
> lookups and hamming distance computations against selected segments of the
> sequence.

The pros of using a sequence that randomly distributes 0 and ones
(i.e. PI or xorshift+) is that you can extract good loss / reordering
information if the error rate is low.

OTOH, it is fragile to high error rate or certain patterns of error.
Let me explain two examples.

Consider the case where the packet loss rate is 50%. I doubt if you
could use pattern matching against those sequences to figure out the
loss rate. This is because the power among the sequence is mostly high
frequencies. If you use a sequence that distributes power among lower
frequencies (like square wave or sin wave that I discussed), you can
calculate the loss rate in such cases as well.

Consider another case where the sender uses multiple queues to emit
packets belonging to a single QUIC connection (BTW, I plan to
implement such one). You would see non-neglible amount of reorders. On
the wire, it will look like if two adjacent packets packets were
swapped; it wouldn't have any practical impact on performance. But
such frequent reordering will destroy the observability of a random
sequence.

To summarize, I think that we need a low frequency signal. It could
either be a square wave or sin wave. Using a sin wave might be better
here, since you the bit pattern (which flips a lot) to observe at a
higher precision when the the error rates of loss and reorder are both
low.

>
> https://en.wikipedia.org/wiki/Xorshift#xorshift+
>
> http://xoroshiro.di.unimi.it/xorshift128plus.c
>
> uint64_t s[2];
>
> uint64_t next(void) {
> uint64_t s1 = s[0];
> const uint64_t s0 = s[1];
> const uint64_t result = s0 + s1;
> s[0] = s0;
> s1 ^= s1 << 23; // a
> s[1] = s1 ^ s0 ^ (s1 >> 18) ^ (s0 >> 5); // b, c
> return result;
> }
>
>
> A simpler 32-bit version could also be used since we do not care about long
> cycles.
>
> http://excamera.com/sphinx/article-xorshift.html
>
> uint32_t seed = 7;  // 100% random seed value
>
> static uint32_t random()
> {
>   seed ^= seed << 13;
>   seed ^= seed >> 17;
>   seed ^= seed << 5;
>   return seed;
> }
>
>
> The output would be the bits shifted out of the 32-bit our 64-bit word in
> either MSB or LSB first. I’d prefer LSB because it is slightly simpler to
> test the LSB bit and divide by 2.
>
> On 7 February 2018 at 01.29.18, Mikkel Fahnøe Jørgensen (mikkelfj@gmail.com)
> wrote:
>
> Also note that this approach is insensitive to skipped packet numbers in
> optimistic ACK attack defence. It leaks zero information when the network is
> perfect and if the CID hash is random.
>
> ________________________________
> From: Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>
> Sent: Wednesday, February 7, 2018 12:58:33 AM
> To: Kazuho Oku
> Cc: Brian Trammell (IETF); QUIC WG
> Subject: Re: Explicit measurability in the QUIC wire image (was Re: Packet
> number encryption)
>
> I actually think a static 1KB table of Pi could work quite well.
>
> A subset of samples could be indexed in a hashtable and yield loss data
> early with some probability. Some samples would miss due to reordering or
> loss. If more exact analysis is wanted the levenshtein distance of a sample
> sequence against Pi from a synced offset would tell a lot about the data. Or
> DNA sequencing. This could be hardware optimized.
>
> Yet, transmission is always just the next bit in the Pi table.
>
> Since Pi is effectively random it will ebentually detect mutations if the
> observed sequence is long enough.
>
> Wrt privacy, the CID may be used as a start offset hash into the Pi table.
>
> There isn’t any need to cover a full RTT worth of Pi bits unless it is used
> for latency detection, but in that case the spin could be a pattern like
> 10101010 and 00001111 injected into the Pi sequence. A separate spin bit
> would be simpler.
>
>
> ________________________________
> From: Kazuho Oku <kazuhooku@gmail.com>
> Sent: Tuesday, February 6, 2018 5:22:35 PM
> To: Mikkel Fahnøe Jørgensen
> Cc: Brian Trammell (IETF); QUIC WG
> Subject: Re: Explicit measurability in the QUIC wire image (was Re: Packet
> number encryption)
>
> 2018-02-06 23:54 GMT+09:00 Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>:
>> This idea can be taken further: You can modulate the signal so you use
>> multiple packets to encode a zero or a one for half the wave duration. For
>> example 1 could be encoded as 0101 over four packets and zero could be
>> encoded as 0011 over four packets.
>> If there is any reordering, it would show up as an unexpected value in the
>> pulse.
>
> That's definitely an option.
>
> Actually, I considered using sin wave (that distributes the error
> among 1-bit samples) as an example instead of the square wave.
>
> The primary reason behind my preference to using a square wave is that
> it is easier to implement; in fact, emitting a square wave with the
> length of 512 packets is as easy as just taking the 9th bit (counting
> from LSB) of the packet number (if we forget about the gaps for a
> moment).
>
>
> --
> Kazuho Oku



-- 
Kazuho Oku