Re: [hybi] status of real world permessage-deflate implementations?

Yutaka Hirano <yhirano@chromium.org> Thu, 05 June 2014 08:56 UTC

Return-Path: <yhirano@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E61441A01C0 for <hybi@ietfa.amsl.com>; Thu, 5 Jun 2014 01:56:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.629
X-Spam-Level:
X-Spam-Status: No, score=-0.629 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.651, SPF_PASS=-0.001] autolearn=ham
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 uRb6dwzm0OP8 for <hybi@ietfa.amsl.com>; Thu, 5 Jun 2014 01:56:33 -0700 (PDT)
Received: from mail-yk0-x233.google.com (mail-yk0-x233.google.com [IPv6:2607:f8b0:4002:c07::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 29F201A0102 for <hybi@ietf.org>; Thu, 5 Jun 2014 01:56:33 -0700 (PDT)
Received: by mail-yk0-f179.google.com with SMTP id 19so541611ykq.38 for <hybi@ietf.org>; Thu, 05 Jun 2014 01:56:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8NgJm4TRULLry3oWKxhWzCB51yrmahWYoKq7bIB60ME=; b=fPoVtJqyHl0r5wldzG6zLswYC5soVv9BLIV78dsCHc539TLqn5GBptydgl8oliVKwb /bUJxIDhlpAHCYS/epQYINbgQFHI5M3uZYeJ90vlM/hA8te+d81lDItAUljQpiRQBev5 6gtiln0I86zkv3v6VsKwhtRmS4axvPY9eizSnZfVJX5PRRCKBTojHimGRH+OVmaA45c5 5FZfishVps+vs42DCYgJhud+BkyIwWprGs0XWgMT3FRLMH1ig1xuRBw+wiPJXhWx8wg8 TwwCEwjbi2uB4TR1gpKIQZ4K4kjNrAvRw+hbsQuIYXSoiw8APEn7ddvCGdTirha/LFJa UurQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8NgJm4TRULLry3oWKxhWzCB51yrmahWYoKq7bIB60ME=; b=aJs0tPkLDl6ctoK+x1PG7pmgavBX8IhN6ZV/cHCjzexDjh3KPwXO/vQNYe8bX6PmaG omXnCIDpWntHb+Ceixbdg+MsxDfm43xuP4VCD+NwW6+bGqPAZafZHXmjAQ2E6qwe4UfX ZJcBzVpRmITzDCgzsEdOGy6HRpAbo1JpiQmqM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8NgJm4TRULLry3oWKxhWzCB51yrmahWYoKq7bIB60ME=; b=PsnXbBSdkjKDcdgVaOxs0lqhxtfeVvbAm8Xi7LNl0+V0CQbOKzLxUnLqixNeNvpu8u q2Fceb97OfntMuG4tmGPLHUn2Ws4pyYxSZ8xFiGP63d4iKXtqYE4V5I/Qwzwn9/KtPt5 HDAXHtC8Ja6H5BNTmF/ab0VLmfbt8XfszQxNVR0Pq54WxOlV0FEADM26yItrP6LGoZEZ 5v/mjzUmTIHlO8W15Vm71/dtRKyz8kzoxSspkKvd1EJtQ7UYUEHguK02EPHG0awP+x3i FxonacVB5I9rSY4d2btoD0zjkhCNhF85ZV+g7ADSDKtT0VgiUzhsYEQQ9OPC7vI/RcGy uuiA==
X-Gm-Message-State: ALoCoQmJrOtaL/+PPRP2ddKFRmzXm/dCga+IpaQwFCMYRyvrjTZfIVIi3vffzZhTCS8QtYYMOZvk
MIME-Version: 1.0
X-Received: by 10.236.113.69 with SMTP id z45mr83245649yhg.0.1401958586374; Thu, 05 Jun 2014 01:56:26 -0700 (PDT)
Sender: yhirano@google.com
Received: by 10.170.78.214 with HTTP; Thu, 5 Jun 2014 01:56:26 -0700 (PDT)
In-Reply-To: <CAG4zZZBcaYJRqZOo1yOP3qovRJTpqFZwauHcCz_+Pb00DoLpFg@mail.gmail.com>
References: <CAG4zZZAkfCgWKSiy6XP3eKggCnDR0upC5tsM6i15ZUUHwvis6g@mail.gmail.com> <634914A010D0B943A035D226786325D444758070B4@EXVMBX020-12.exch020.serverdata.net> <CAH9hSJbkfSMa+-8RZ8ERteT=6qHzvRk0xZbsbHKKOF2kKoxMKQ@mail.gmail.com> <CAG4zZZBcaYJRqZOo1yOP3qovRJTpqFZwauHcCz_+Pb00DoLpFg@mail.gmail.com>
Date: Thu, 05 Jun 2014 17:56:26 +0900
X-Google-Sender-Auth: 4ffPXJlSjsgWRyX_alnvbj93Xps
Message-ID: <CABihn6G-BhHzvBd6gCGoo=EFxa7-z0ii0fOPzU2TcXLb35LBUA@mail.gmail.com>
From: Yutaka Hirano <yhirano@chromium.org>
To: Joakim Erdfelt <joakim@intalio.com>
Content-Type: multipart/alternative; boundary="20cf3010eb1187f47504fb12eb9f"
Archived-At: http://mailarchive.ietf.org/arch/msg/hybi/IuzFgerPjRl6HbQ-hT9mnhzFV5A
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] status of real world permessage-deflate implementations?
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi/>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Jun 2014 08:56:37 -0000

Sorry for the very late response.

I implemented permessage-deflate in Chrome so that it inserts
\x00\x00\xff\xff only at the end of the last frame of each message.
I have tested both the new and the old implementation in Chrome (ToT), but
it accepts your "by-spec-32k" data.
Please feel free to file a bug to http://crbug.com/.

Thanks,



On Fri, May 16, 2014 at 5:03 AM, Joakim Erdfelt <joakim@intalio.com> wrote:

> Some more updates...
>
> This is looking like more and more like a *VERY SPECIFIC* chrome bug.
> Would be happy to migrate this to a chrome specific bug tracker, but I
> just wanted to update the rest of the group first on these results.
>
> My test data:
> http://joakim.erdfelt.com/jetty/websocket-intratail/
>
> These are all from server, not masked, destined for client that is being
> tested.
> Each file is a single, complete, frame.
> Each directory represents a single overall message.
> Every message is the same...
>  UTF8 e-book -> "A Connecticut Yankee in King Arthur's Court, Complete, by
> Mark Twain"
>  From Project Gutenberg: http://www.gutenberg.org/ebooks/86.txt.utf-8
>
> Extension Negotiation:
>
>   There were 2 overall client offer styles seen.
>    a) permessage-deflate; client_max_window_bits, x-webkit-deflate-frame
>    b) permessage-deflate; client_max_window_bits
>
>   Server always negotiated as: permessage-deflate
>
> Once the connection is established, these raw frames are sent to the
> client, as-is, with no extra interpretation by the server.
> Connection is plain, http -> ws:// not https or wss:// or spdy.
>
>   /by-spec-*/        - intra-frame tail is present (per spec)
>   /by-spec-32k/      - fragmented, 20 frames,  32k max frame size
>   /by-spec-128k/     - fragmented,  5 frames, 128k max frame size
>   /by-spec-1-frame/  - not fragmented, 1 frame
>
>   /strip-intratails-*/        - intra-frame tail is removed (in violation
> of spec)
>   /strip-intratails-32k/      - fragmented, 20 frames,  32k max frame size
>   /strip-intratails-128k/     - fragmented,  5 frames, 128k max frame size
>   /strip-intratails-1-frame/  - not fragmented, 1 frame
>
> Tested Clients:
>
>   A) PyWebSocket Trunk (@revision 798) - echo_client.py - Python 2.7.5
>   B) Chrome 34.0.1847.132 - on Fedora 20 - Javascript/HTML
>   C) Chromium 34.0.1847.132-1.fc20 - on Fedora 20 - Javascript/HTML
>   D) Chrome 34.0.1847.131 - on OSX/10.9.2 (older MBP) - Javascript/HTML
>   E) Chrome Canary 37.0.1991.0 - on OSX/10.9.2 (older MBP) -
> Javascript/HTML
>   F) Chrome 34.0.1847.137 - on OSX/10.9.2 (first gen rMBP) -
> Javascript/HTML
>   G) Chrome Canary 37.0.1991.0 - on OSX/10.9.2 (first gen rMBP) -
> Javascript/HTML
>   H) Chrome Canary 37.0.1994.2 - on OSX/10.9.2 (first gen rMBP) -
> Javascript/HTML
>   I) Chrome 34.0.1847.137 m - Windows 7 SP1 (x64) - Javascript/HTML
>   J) Chrome 34.0.1847.131 m - Windows 8.1 (x64) - Javascript/HTML
>
> Results:
>
>   /by-spec-1-frame/          - all clients pass
>   /by-spec-32k/              - B fails, all of the rest are successful.
>   /by-spec-128k/             - all clients pass
>   /strip-intratails-1-frame/ - all clients pass
>   /strip-intratails-32k/     - only B passes, all other clients fail
>   /strip-intratails-128k/    - all clients fail.
>
> When a failure occurs, its always on the second frame sent.
>
> As these results are just mind-boggling, I went ahead and installed a
> fresh copy of fedora 20 in a vm (oracle virtualbox), updated all of the
> packages and tried again with Chrome 34.0.1847.132.  Same results.
> Important note! - When upgrading to stable version 34.0.1847.137-1 then
> chrome behaves properly again.
>
> As for the Fedora 20 main machine, it has a disabled firewall and selinux
> (so those can be ruled out as the cause).
>
>
> --
> Joakim Erdfelt <joakim@intalio.com>
> webtide.com <http://www.webtide.com/> - intalio.com/jetty
> Expert advice, services and support from from the Jetty & CometD experts
> eclipse.org/jetty - cometd.org
>
>
> On Thu, May 15, 2014 at 6:15 AM, Takeshi Yoshino <tyoshino@google.com>
> wrote:
>
>> Hi Joakim, Tobias,
>>
>>
>> On Wed, May 14, 2014 at 9:22 PM, Tobias Oberstein <
>> tobias.oberstein@tavendo.de> wrote:
>>
>>> Hi Joakim,
>>>
>>>
>>>
>>> couple of thoughts ..
>>>
>>>
>>>
>>> 1)
>>>
>>> The latest Autobahn testsuite did include testing of various deflate
>>> parameter sets (section 12)
>>>
>>>
>>>
>>> http://autobahn.ws/testsuite/reports_20140314/clients/index.html
>>>
>>>
>>>
>>> but does NOT yet include testing permessage-deflate combined with
>>> fragmentation and/or multiple deflate blocks.
>>>
>>>
>>>
>>> That is missing. I guess we need it.
>>>
>>>
>>>
>>> 2)
>>>
>>> FWIW, AutobahnPython allows to set auto-fragmentation of outgoing
>>> messages via
>>>
>>>
>>>
>>> WebSocketClientFactory.setProtocolOptions(autoFragmentSize = 1024)
>>>
>>> WebSocketServerFactory.setProtocolOptions(autoFragmentSize = 1024)
>>>
>>>
>>>
>>> However, this works like this: first compress the complete message in
>>> one go and _then_ fragment.
>>>
>>>
>>>
>>> This means, there will only be a _single_ deflate block that is then
>>> splitted between mulitple frames (see (B) below)
>>>
>>>
>>>
>>> 3)
>>>
>>> In other words, there is another dimension: multiple deflate blocks in
>>> one or multiple frames  (see (C) below).
>>>
>>>
>>>
>>> (A)
>>>
>>> [FRAME 1 : DEFLATE BLOCK 1 - without tail bytes]
>>>
>>>
>>>
>>> (B)
>>>
>>> [FRAME 1 : DEFLATE BLOCK 1 (Part 1/2)] [FRAME 2 : DEFLATE BLOCK 1 (Part
>>> 2/2)- without tail bytes]
>>>
>>>
>>>
>>> (C)
>>>
>>> [FRAME 1 : DEFLATE BLOCK 1 with tail bytes] [FRAME 2 : DEFLATE BLOCK 2
>>> without tail bytes]
>>>
>>>
>>>
>>> Regarding the spec:
>>>
>>>
>>>
>>> """
>>>
>>> Note that for non-final fragments, the removal of 0x00 0x00 0xff 0xff must not be done.
>>>
>>> """
>>>
>>>
>>>
>>> I am now wondering which of the following would be valid:
>>>
>>>
>>>
>>> (D)
>>>
>>> [FRAME 1 : DEFLATE BLOCK 1 with tail bytes] [FRAME 2 : empty payload]
>>>
>>
>> This doesn't work since the concatenation of payloads ends with the tail
>> bytes. On the receiver, it adds the tail bytes and decodes and sees an
>> error. FRAME 2 must include 0x00. Please see
>> https://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-18#section-8.2.3.6
>>
>>
>>>
>>>
>>> (E)
>>>
>>> [FRAME 1 : DEFLATE BLOCK 1 (Part 1/2)] [FRAME 2 : DEFLATE BLOCK 1 (Part
>>> 2/2) with tail bytes | DEFLATE BLOCK 2 without tail bytes]
>>>
>>>
>>>
>>
>> This is fine.
>>
>>
>>> (F)
>>>
>>> [FRAME 1 : DEFLATE BLOCK 1 with tail bytes | DEFLATE BLOCK 2 without
>>> tail bytes]
>>>
>>>
>>>
>>
>> This is also fine.
>>
>>
>>> and whether the intention of the spec was more like
>>>
>>>
>>>
>>> """
>>>
>>> The tail bytes of the last (and only the last) deflate block must be
>>> stripped.
>>>
>>> """
>>>
>>
>> Correct.
>>
>>
>>>
>>>
>>> That is: no reference to frames at all, only to deflate blocks (last or
>>> non-last).
>>>
>>
>> Thanks for suggestion. I'll review my texts about this.
>>
>>
>>>
>>>
>>> Anyway: which of (A) - (F) is intended to be valid/invalid?
>>>
>>>
>>>
>>> My current understanding: all but (D) are valid.
>>>
>>
>> Right.
>>
>>
>>>
>>>
>>> /Tobias
>>>
>>>
>>>
>>>
>>>
>>> *Von:* hybi [mailto:hybi-bounces@ietf.org] *Im Auftrag von *Joakim
>>> Erdfelt
>>> *Gesendet:* Mittwoch, 14. Mai 2014 20:12
>>> *An:* hybi@ietf.org
>>> *Betreff:* [hybi] status of real world permessage-deflate
>>> implementations?
>>>
>>>
>>>
>>> So, I've been testing the server and client side implementations of
>>> various permessage-deflate implementations and come to realize that there
>>> is no consistency (yet).
>>>
>>>
>>>
>>> In Chrome 34, its client side decompress (received frames) is different
>>> than pywebsocket client decompress (received frames) which is different
>>> from autobahn testsuite's handling.
>>>
>>>
>>>
>>> Been testing our Jetty side implementation, and for large compressed
>>> messages (been using the Gutenberg project's text of "A Connecticut Yankee
>>> in King Arthur's Court, Complete, by Mark Twain" as my data).
>>>
>>> http://www.gutenberg.org/ebooks/86.txt.utf-8
>>>
>>>
>>>
>>> All tests are done with client upgrading to Jetty side using ..
>>>
>>>
>>>
>>> offer: permessage-deflate; client_max_window_bits, x-webkit-deflate-frame
>>>
>>> negotiated: permessage-deflate
>>>
>>>
>>>
>>> I can make pywebsocket client happy, and it can send/receive single
>>> frame messages or fragmented messages (using either 16k and 32k max frame
>>> sizes) just fine.
>>>
>>> However, Chrome 34 errors out consistently if it receives a large
>>> fragmented message that is compressed.
>>>
>>> The inter-frame handling of the tail bytes (0x00, 0x00, 0xFF, 0xFF)
>>> appears to be different.
>>>
>>> In the last spec document,
>>> http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-18
>>> its clear that we must include the tail bytes.
>>>
>>> However, Chrome doesn't like that and fails the decompress w/abnormal
>>> closure.
>>>
>>> Inspection says:  failed to inflate a frame
>>>
>>> If I strip the tail bytes for Chrome 34, then its happy and pywebsocket
>>> is now broken.
>>>
>>> autobahn apparently doesn't care, one way or another, it accepts
>>> (happily) both with and without tail bytes between frames.
>>>
>>>
>>>
>>> --
>>>
>>> Joakim Erdfelt <joakim@intalio.com>
>>>
>>> webtide.com <http://www.webtide.com/> - intalio.com/jetty
>>>
>>> Expert advice, services and support from from the Jetty & CometD experts
>>>
>>> eclipse.org/jetty - cometd.org
>>>
>>> _______________________________________________
>>> hybi mailing list
>>> hybi@ietf.org
>>> https://www.ietf.org/mailman/listinfo/hybi
>>>
>>>
>>
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>
>