Re: [hybi] With deflate-stream, Close frame doesn't work as an end of data marker

Takeshi Yoshino <tyoshino@google.com> Fri, 25 February 2011 06:58 UTC

Return-Path: <tyoshino@google.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 1E2C53A6938 for <hybi@core3.amsl.com>; Thu, 24 Feb 2011 22:58:06 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.376
X-Spam-Level:
X-Spam-Status: No, score=-105.376 tagged_above=-999 required=5 tests=[AWL=0.600, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id enux1LeAmQc3 for <hybi@core3.amsl.com>; Thu, 24 Feb 2011 22:58:04 -0800 (PST)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by core3.amsl.com (Postfix) with ESMTP id E82B03A691E for <hybi@ietf.org>; Thu, 24 Feb 2011 22:58:03 -0800 (PST)
Received: from kpbe17.cbf.corp.google.com (kpbe17.cbf.corp.google.com [172.25.105.81]) by smtp-out.google.com with ESMTP id p1P6wrbK030404 for <hybi@ietf.org>; Thu, 24 Feb 2011 22:58:54 -0800
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1298617134; bh=lecIfdwlHsD70yO0c0W17z5WSgc=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=I13DSZgbfAkLnF+YJg0npzLtKVQ/80TrLRZcgVwm4H/n7p9OOURXOinqXDKOVDA5g yXuen8nZNWkU5/gqxlG+w==
Received: from iwl42 (iwl42.prod.google.com [10.241.67.234]) by kpbe17.cbf.corp.google.com with ESMTP id p1P6wqAT018409 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <hybi@ietf.org>; Thu, 24 Feb 2011 22:58:52 -0800
Received: by iwl42 with SMTP id 42so1125043iwl.18 for <hybi@ietf.org>; Thu, 24 Feb 2011 22:58:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=//zSbNSlSJzNQCyaFANKQ9ArxNgmjB7H5DdD+HdfE78=; b=hrDDw3+be8HJ9AXOvdO4C/cIsrr1OXCWdrrWOlns6/YnnVZY2TdURHyKPutxxLt7ui 3gDPH+hftR4wBJrF59Zw==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=IMB+8UFFuz/SKU/bq0Pj0VI/GW+ooGiJCU6mStEB77wz7ysvWDbNX5x5BbgwjNoxY7 sqhLuZadRYjHs2C/vqcA==
Received: by 10.42.229.135 with SMTP id ji7mr385216icb.365.1298617132131; Thu, 24 Feb 2011 22:58:52 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.17.201 with HTTP; Thu, 24 Feb 2011 22:58:32 -0800 (PST)
In-Reply-To: <OFED4F78E9.C77C54B8-ON88257842.001A696A-88257842.001D41FB@playstation.sony.com>
References: <AANLkTinVwPRpo7NgJjf3+6gcrBHaJugT9OugKKAsMU9X@mail.gmail.com> <OFED4F78E9.C77C54B8-ON88257842.001A696A-88257842.001D41FB@playstation.sony.com>
From: Takeshi Yoshino <tyoshino@google.com>
Date: Fri, 25 Feb 2011 15:58:32 +0900
Message-ID: <AANLkTikE9zarwuRURCcPLU-QOgDt4UsaaWNWv4U7=hQ6@mail.gmail.com>
To: Yutaka_Takeda@playstation.sony.com
Content-Type: multipart/alternative; boundary="90e6ba476b39dc250a049d15dc2f"
X-System-Of-Record: true
Cc: hybi@ietf.org
Subject: Re: [hybi] With deflate-stream, Close frame doesn't work as an end of data marker
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/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: Fri, 25 Feb 2011 06:58:06 -0000

Hi,

On Fri, Feb 25, 2011 at 14:19, <Yutaka_Takeda@playstation.sony.com> wrote:

>
> Hi,
>
> If we could apply deflate-stream only to payload, that would solve
> the problem. I was looking for reasons why entire stream has to be
> compressed, and found only one here:
>
> http://www.ietf.org/mail-archive/web/hybi/current/msg04117.html
>
> From layering aspects, I would prefer any compression taking place
> on top of framing layer from the other way around:
>
>
Yeah, Patrick initially proposed compression using that approach
http://www.ietf.org/mail-archive/web/hybi/current/msg04071.html

The options we can take are basically
a) compress only application data not keeping compression state
b) compress only application data while keeping compression state between
multiple frame
c) compress entire stream

John, Dave objected a) since it's degrading compression rate. I agree that.
So, b) and c) are left. Patrick wrote up c) as deflate-stream extension.

The name deflate-stream was given for c) (see
http://www.ietf.org/mail-archive/web/hybi/current/msg04129.html). I think
it's OK to leave deflate-stream extension as is. I'm also fine with this
built-in in the initial version of the WebSocket protocol spec. What we
should do now is try to define some "better-deflate" which convinces people.
These threads is in a kind of suspended state. We should use them or create
a new thread for resuming discussion on some "better-deflate" there.

- Some said we need ability to disable compression on frame with
incompressible contents
- Coordination with mux is also problem
- If frame header is compressible/incompressible is still a question.
etc...


>    +-------------+
>    | compression |
>    +-------------+
>    +-------------+
>    | WS framing  |
>    +-------------+
>    +-------------+
>    |     TCP     |
>    +-------------+
>
> where, current draft -05 sugggests:
>
>    +-------------+
>    | WS framing  |
>    +-------------+
>    +-------------+
>    | compression |
>    +-------------+
>    +-------------+
>    |     TCP     |
>    +-------------+
>
> Justifications for the former layering would be:
>
> o  Framing is necessary because of the underlying transport
>    layer is in fact 'streaming', or TCP. (TCP and WS-framing
>    are more tightly coupled)
>

For endpoints/intermediaries which don't recognize deflate-stream, yes, it's
problematic.

Except for this, technically, it's ok since frame boundary can be
immediately told to the other peer by flush-ing e.g. Z_SYNC_FLUSH of zlib.


> o  WS-layer needs to buffer entire message (passed by app/JS)
>    anyway.
> o  Text and binary do not interleave fragments, hence there
>    needs only one context for compression / decompression in
>    memory.
>

People seemed to be more concerned about compression efficiency at that time
than the cost of compression state sharing. This is a point to revisit.


> o  Overhead (frame headers and control frames) are much smaller
>    than payload of text/binary frames and negligible as to
>    compression ratio.
>

Not sure.


> o  Close frame appears at the end of stream with no traling
>    bytes. (Can remove requirement for TCP graceful shutdown).
>
>
Yes, it's not a problem if we adopt payload only compression.


> Please let me know if I am missing something...
>
> Best.
> - Yutaka
>
>