Re: 回复: Questions about QPACK

Dmitri Tikhonov <dtikhonov@litespeedtech.com> Sun, 24 November 2019 03:08 UTC

Return-Path: <dtikhonov@litespeedtech.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 93E51120091 for <quic@ietfa.amsl.com>; Sat, 23 Nov 2019 19:08:02 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=litespeedtech-com.20150623.gappssmtp.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 o4seWqGdicAp for <quic@ietfa.amsl.com>; Sat, 23 Nov 2019 19:08:00 -0800 (PST)
Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 943A112008B for <quic@ietf.org>; Sat, 23 Nov 2019 19:08:00 -0800 (PST)
Received: by mail-qt1-x82e.google.com with SMTP id i17so12975428qtq.1 for <quic@ietf.org>; Sat, 23 Nov 2019 19:08:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=litespeedtech-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=zpXqfCWlUHUycuYrZTWb+azfwKtTjoPNUOGGdIbX5CU=; b=K5toLdHomqsTEPcYIL1UOayu/nFgqHDpN9BuhjhiI/x/Iu3vZNaQ2U63oZ1nQiu5sj awHO9RtRtwXLxWsIJj5u9D9PHTDT4ahnfFVIZ6tvTHbVTPSOH+HLDYTxEPHD+5xUFnn+ GzXDr6jVx7pQoF028QWSjQAgiIyeP5tpnI0thhp/J2BmljMeQWykabm1jKOC6abtSw4v 3ZYgAo1e7HsPohq6WbxTpxr4DGPFIaxg+Cc0KDtsysVV+lOIRnsJmwxALkA6kVXDahqP ygIiUrCMkBIVQGJNCV0xbSCwiUqb1F7kORqLaersHZg6/iYb0B/PXeK8Ez14WpUH/xOf 223Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=zpXqfCWlUHUycuYrZTWb+azfwKtTjoPNUOGGdIbX5CU=; b=McgjQ6B1YEwpBo79gAqcEvJCABMFaaugxfWmBGjhLNH9tZxB4MPWWaPrWGjXpXnWwl 7y7o9GjCX9lwbu1cRt7hMvTiaFYJw9WzYP7xZrkoSzxlSioGB2RCaoGRfjFPv7PBIE41 MX/bHFf2f5Zec+nI7k0GG0PysBLgoeDYzaW3RZ32b3NnhEJ2JvsMlEW5QhHixdsnwNg1 VUy5ipvJd54+DzI5CUttNCMaWWdi5rzW/TwGlN7Ie9co8g4cKagXd0kzi9tJOkeyDyo3 d7/yNtpP1p24tsjWDccgYR8EXsjM/BaUsXLDajcCfrquppIHqbNco4m4YZlzie9YDrhR pH2g==
X-Gm-Message-State: APjAAAW6ucDZZv6AFxzE8Q8VMRZwPpV0lcBmhvqWM+O+jeHxa4Lvc38/ IO82Qe2EZhjLvM9goY+rG4gvhg==
X-Google-Smtp-Source: APXvYqysC5hJISr8X4JWog31JS6YQ8wqzhTAMV7k8ERFdAOQsww9zJqB2hgXBCSiygJQjSFrdCzR+Q==
X-Received: by 2002:ac8:1403:: with SMTP id k3mr22459243qtj.58.1574564879567; Sat, 23 Nov 2019 19:07:59 -0800 (PST)
Received: from ubuntu-dmitri (ool-44c1d219.dyn.optonline.net. [68.193.210.25]) by smtp.gmail.com with ESMTPSA id h186sm1265978qkf.64.2019.11.23.19.07.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Nov 2019 19:07:59 -0800 (PST)
Date: Sat, 23 Nov 2019 22:07:57 -0500
From: Dmitri Tikhonov <dtikhonov@litespeedtech.com>
To: 漂泊的梦 <78690842@qq.com>
Cc: Bence Bék <bnc@chromium.org>, Jiuhai Zhang <jiuhai.zhang@gmail.com>, quic <quic@ietf.org>
Subject: Re: 回复: Questions about QPACK
Message-ID: <20191124030756.GD25462@ubuntu-dmitri>
Mail-Followup-To: 漂泊的梦 <78690842@qq.com>, Bence Bék <bnc@chromium.org>, Jiuhai Zhang <jiuhai.zhang@gmail.com>, quic <quic@ietf.org>
References: <tencent_6865D1996656F65720369049BB7960478D06@qq.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <tencent_6865D1996656F65720369049BB7960478D06@qq.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/KRMuLC1r3AbIIC_TSJIz19Q8SMc>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.29
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: Sun, 24 Nov 2019 03:08:03 -0000

On Sun, Nov 24, 2019 at 01:14:04AM +0800, 漂泊的梦 wrote:
> I think it is not such a good idea to insert name with 0-length entry
> into dynamic table, because it needs to transmit more information to
> recipient through the encoder stream for synchronization of dynamic
> table between the sender and recipient.

I am afraid I don't understand what you mean here.

> In my option, it never need to insert name with 0-length entry into
> dynamic table. When we need reference the name only index in the
> Literal Header Field, we can use the index of the entry with the same
> name and a different value we first find in the dynamic table.

It is possible only to insert full name/value pairs into the dynamic
table, but it's not always the best thing to do.  If the value never
repeats again, it will just waste space in the dynamic table.

A good example of the header field whose name is not in the static
table and whose value rarely repeats is X-FB-Debug from the Facebook
server QIF file used for the QPACK interop [1].  ls-qpack inserts
such entries into the dynamic table with zero-length values [2].
This has a beneficial effect on compression ratio.  Without it (I
commented out this code for this test), encoding this QIF file [3]
makes compression ratio worse: from 0.176 to 0.178.

Now, if x-fb-debug is always inserted full -- including the value --
into the dynamic table, the compression ratio drops to 0.287.

> Could you please advise if this is a good idea or which method is
> better in the real situation?

There is no perfect method as different applications will produce
different header patterns.  ls-qpack uses history to decide which
entries to index; other implementations use hard-coded assumptions
(e.g. "user-agent" header never changes.).  This is an interesting
question.  A better method may yet be uncovered.

  - Dmitri.

1. https://github.com/qpackers/qifs/blob/master/qifs/fb-resp.qif
2. https://github.com/litespeedtech/ls-qpack/blob/d79ab9ae19d25bdb6e14d10bb76dbc9d7bcfcf21/lsqpack.c#L1795
3. Table size 4096, no risk, immediate ack.