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

Achim Kraus <achimkraus@gmx.net> Thu, 07 January 2021 20:44 UTC

Return-Path: <achimkraus@gmx.net>
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 E597C3A0E84 for <core@ietfa.amsl.com>; Thu, 7 Jan 2021 12:44:13 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.381
X-Spam-Level:
X-Spam-Status: No, score=-2.381 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.262, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=gmx.net
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 9OVBLA-2AIRz for <core@ietfa.amsl.com>; Thu, 7 Jan 2021 12:44:12 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 02CB83A0E83 for <core@ietf.org>; Thu, 7 Jan 2021 12:44:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610052241; bh=f/XH/SlxQixz65S7KropuLvM4rJpr/ndYl2Dlz3XugM=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Zj8APYuHt1g9mYHvH0kHPi4+8LS4vlQ0vPIOGyegKjGX9pezE8VnnCmL8rZynJ/fK v+5KCA5evALZ+vuXyRQRKG1QZWLk8GkI6dcLbK9djE00nDQz9rBG/5K4sOb8VeezBl 3sMrFeH/2u/XP7NaeWiR+UHkcATW4QJIqKRwe9/I=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.178.100] ([178.2.229.186]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuUj2-1k6KlG3kbi-00rZY8; Thu, 07 Jan 2021 21:44:01 +0100
To: Carsten Bormann <cabo@tzi.org>
Cc: "core@ietf.org" <core@ietf.org>, Simon Bernard <contact@simonbernard.eu>
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> <AE33D7A2-A503-4E90-AB66-9CC7C64FF211@tzi.org>
From: Achim Kraus <achimkraus@gmx.net>
Message-ID: <3560ba6c-9840-653a-bfb6-2685142c0988@gmx.net>
Date: Thu, 07 Jan 2021 21:44:00 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <AE33D7A2-A503-4E90-AB66-9CC7C64FF211@tzi.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: de-AT-frami
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:oZ0kJ3HH9vWp39ZTSguDV2Ifp6TEPi+uL/MFrPfkeuaEjpjBzYA HcwOD+0fduWJ1POqrjgvODTw1VMk7Mu1pA57EIUYo1CG1EeuWuHmqZYEwHV10us/optLaaa CXV0+ZIGLp3uvSN1WyDSckp5+SoKh/AL86a2iR1hYd9r+61YifXMh/Ai34NRXj8a4XPB0gh T1+rcKLxjOP5oA7tDm/kw==
X-UI-Out-Filterresults: notjunk:1;V03:K0:w2v1mBKKsKI=:kcB37mVjwGvny/hORaF14w /MOt8q3a3/GN32zxzMUgxwSNWXw/vsoVQZODurVGiI1xnSHdWypen+mb2j2qIweveW7KdtnM2 IUHXTqevMcCiHiRhEXe1fmlPWjZS2keCbg+gVeBxYBFUMLPqgKiIY9uh8BoktY7tKynY6Yagc ioLsQ0fgA++sX+j4wThdzNYlzhb31Wvh9KJdBc79cABIXv9Gz45I2/M6ueOhiNOCUd9niI6Nn Y1QFIR/hXXx4lDVw32fKPwvCsO2VWaETRqoYgoFtiwJtCStyUtmCrUjv8CV9BNOPkx6WvXIez UdTA7E67HVbDTXR0Xj3J9RtSoklwQpyathU7Rx7225bjGnbD9/PzDpqUt/yQVWr/kMIL+7mY1 VnLRpluUxXo16nl0hh+X+Efc49C715j0x3Ir8SxIxcNCuO4LOTCxRJiwuNLG6C6AIIaaoPN/4 s58V4sbH+I+XHXrvjqJ8lBODvouZu7+u6qQkgn5j8a6mbzneMDkRIUvLx4Qp5t9H7teGXZ/k9 M9MF9M79JdmVrPzUjLLG1qfIXL2h3LKen4LmircMSCfX3wIcVrkkAvGIgaEDHyxuA2ohBTWVK sxmZNCX8tCXDeTq556N7nKs0X1nJHrdqsFIwbTU4PYEQg6nLmtqUa5HeLNR6p7i+gskSAXroS I5T97hdsijr8e6Jr9zaGBrqJDOB63SlgKPpdxwlfL6D4GlWBetkNpUuu5pcoon7ZI4mqxFqsS b4HpeExEQcL2uXoliF2nnkYiTtCWwi3U3PY7T+qoQq2unslUAxtn27Q0SdH7IwNakKF8l/sHg EpZEmH0akEKhJcmxywOi64Ahdi/3NTbDGbN4ZT0ihC17mmlbCLsvPUFXLEQQK06PYL63G4ffS HU8mifMkzEkX7N6MEgOA==
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/fYy61XmXaaDvu2sk_6hg4aP83Yw>
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: Thu, 07 Jan 2021 20:44:14 -0000

Hi Carsten
Hi List,

sorry for that late follow up of that question from last summer.
Currently I try to cleanup that code in Californium.
Doing so, I'm not sure, what the intended behaviour in the following
scenario should be:
- the client starts with a request "GET block2(num=5, size=256)".
- the server is configured to send blocks only up to 64 bytes.

If that exchange would happen at num=0, it works fine to send just a
smaller response, but with "num=5", I'm not sure, what is intended.
So, does this result in:

- the server respond with "CONTENT block2(num=?, size=64)"
   the issue with that is in my opinion, that either the "num" must
   be changed, or the offset can not longer calculated by
   option.num * option.size. To change the "num" may cause issues,
   though that "num" seems to be used to ACK the blocks.

- the server respond with an error; but which one should be used?

best regards
Achim

Am 22.07.20 um 15:23 schrieb Carsten Bormann:
> 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
>>>
>>
>