Re: [core] block1 size negotiation with 4.13 Request Entity Too Large

Carsten Bormann <cabo@tzi.org> Wed, 22 July 2020 13:23 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C434E3A0919 for <core@ietfa.amsl.com>; Wed, 22 Jul 2020 06:23:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.92
X-Spam-Level:
X-Spam-Status: No, score=-1.92 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 Jj41dplmHuzK for <core@ietfa.amsl.com>; Wed, 22 Jul 2020 06:23:36 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 876B13A097C for <core@ietf.org>; Wed, 22 Jul 2020 06:23:23 -0700 (PDT)
Received: from [172.16.42.100] (p5089ae91.dip0.t-ipconnect.de [80.137.174.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4BBbkf0G2Xzysv; Wed, 22 Jul 2020 15:23:22 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <f114dcbf-ef6d-53d1-41e5-83db0835d408@gmx.net>
Date: Wed, 22 Jul 2020 15:23:21 +0200
Cc: "core@ietf.org" <core@ietf.org>, Simon Bernard <contact@simonbernard.eu>
X-Mao-Original-Outgoing-Id: 617117001.288372-37b0fbef75761ffcdcb7c1e6435a9a09
Content-Transfer-Encoding: quoted-printable
Message-Id: <AE33D7A2-A503-4E90-AB66-9CC7C64FF211@tzi.org>
References: <189d3f1e-9c83-b1c7-d8a1-7f195265bd2d@gmx.net> <e017c262-c88e-6d77-5f05-2ae2c1145aa8@gmx.net> <AA7B14A4-575F-465F-A106-3A6048877F79@tzi.org> <f114dcbf-ef6d-53d1-41e5-83db0835d408@gmx.net>
To: Achim Kraus <achimkraus@gmx.net>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/uPRzw3KmKQOByHZmQwkfmoBv9_k>
Subject: Re: [core] block1 size negotiation with 4.13 Request Entity Too Large
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Jul 2020 13:23:39 -0000

On 2020-07-22, at 15:20, Achim Kraus <achimkraus@gmx.net> wrote:
> 
> Hi Carsten,
> 
> thanks a lot!
> 
> > So it is not forbidden to request a smaller block size later.
> 
> My point is,
> - was this intented or
> - just not considered and therefore not explicitly forbidden?

This was intended.  A Stateless server may simply not know what it did before.  It might of course simply give up if the block number is ≠ 0, but we gave it a little more freedom, at the cost of maybe causing a bit more coding for clients that want to cope with these highly stateless servers.

> All examples and some text points more into the direction, that it is
> intended to be negotiated only in the 1. exchange. I'm still not
> convinced, I think to forbid this is the better approach.

I don’t know why the server would keep its preferences secret up to a few blocks into the transfer unless it is of the above kind and faces a sudden resource shortage.

Grüße, Carsten


> 
> Sure, if no-one else has doubts, go for it.
> 
> best regards
> Achim Kraus
> 
> Am 22.07.20 um 13:08 schrieb Carsten Bormann:
>> Hi Achim,
>> 
>> Good questions.
>> 
>>> On 2020-07-22, at 09:56, Achim Kraus <achimkraus@gmx.net> wrote:
>>> 
>>> Dear list,
>>> 
>>> I would really appreciate, if the detail questions about the 4.13
>>> failover could be answered!
>>> 
>>> Without answers, I'm still afraid, that implementations will became
>>> "overcomplicated" and "less interoperable".
>>> 
>>> 1. is it intended to change the block size only in the first exchange?
>>> Or on other exchanges? (Additionally, if changing later is considered as
>>> failure, how should that failure be handled/processed?)
>> 
>> RFC 7959 says (Section 2):
>> 
>>    In most cases, all blocks being transferred for a body (except for
>>    the last one) will be of the same size.  (If the first request uses a
>>    bigger block size than the receiver prefers, subsequent requests will
>>    use the preferred block size.)  The block size is not fixed by the
>>    protocol. […]
>> 
>> Simon cited some more text, but this is about too many blocks, not about too big blocks.  So it is not forbidden to request a smaller block size later.  I would expect that this is a rather unusual case, so I would not be surprised if a client gives up if this happens in mid-transfer.  On the other hand, it is also not hard to enable a client to adapt.
>> 
>>> 2. is it intended, that a 4.13 response without block1 option to a
>>> request also without block1 option, should also use/try a failover with
>>> a request with block 1 option?
>> 
>> That’s what RFC 7959 says:
>> 
>>    The error code 4.13 (Request Entity Too Large) can be returned at any
>>    time by a server that does not currently have the resources to store
>>    blocks for a block-wise request payload transfer that it would intend
>>    to implement in an atomic fashion.  (Note that a 4.13 response to a
>>    request that does not employ Block1 is a hint for the client to try
>>    sending Block1, and a 4.13 response with a smaller SZX in its Block1
>>    Option than requested is a hint to try a smaller SZX.)
>> 
>> This is phrased as a note, because the response contains a hint; there is no requirement that Block1 is supported.
>> 
>> Simon also asked:
>> 
>>>   2) What exactly should send the server ? 4.13 or 4.13 + block1 with szx option ? is size1 should be used to guess the correct block size ?
>> 
>> I would expect that the server should send the desired block size if it wants the client to change from the block size it used, so 4.13 + Block1.  Size1 is not about block size, but about the size of the whole body - if the server has a limitation there, it might want to error out on a 4.13 (without a Block1 option).
>> 
>> Grüße, Carsten
>> 
>