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

Achim Kraus <achimkraus@gmx.net> Thu, 07 January 2021 21:42 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 749793A00F7 for <core@ietfa.amsl.com>; Thu, 7 Jan 2021 13:42:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.38
X-Spam-Level:
X-Spam-Status: No, score=-2.38 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_DNSWL_BLOCKED=0.001, 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
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 mEQtsjv7VnAb for <core@ietfa.amsl.com>; Thu, 7 Jan 2021 13:42:55 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 A5A0E3A00E0 for <core@ietf.org>; Thu, 7 Jan 2021 13:42:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610055759; bh=+AvUR+0pgTwwMefzEHaDnBFBvYPwDw7RVXHHMfcIqOc=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Vx63gJVzGxK5pxqMpNX9dTG1g1couUkx2E8k3YVygpAlrr/z+fqOCeTsik1UMvjDI eoVWQtDGYnJ6zAwB3MVMTiuSEOzWpjJgweqy8tvUKJSjm2fgUgGiy4VMddbqo3tTvh V4hc/beBS0SOUq01dfRiz+WX5uYaXHx2GUa2f7YQ=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.178.100] ([178.2.229.186]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M1Hdw-1kzI0b1fII-002ntD; Thu, 07 Jan 2021 22:42:39 +0100
To: Carsten Bormann <cabo@tzi.org>, jon.shallow@jpshallow.com
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> <3560ba6c-9840-653a-bfb6-2685142c0988@gmx.net> <D324751F-D453-42D5-9310-753DF44619B4@tzi.org>
From: Achim Kraus <achimkraus@gmx.net>
Message-ID: <3558e7a7-4252-4fe5-ed6e-fbfaa7b72bf3@gmx.net>
Date: Thu, 07 Jan 2021 22:42:38 +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: <D324751F-D453-42D5-9310-753DF44619B4@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:3kxU/Mb+K9ckVR/lWGe3oIIerWXGd8azGdga2s4wtfdPif6qXnk 6MohnY57NiW1uDyZd3ux4ktXREHQ0Yp/8XIbe6DFnf2uPm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At: <https://mailarchive.ietf.org/arch/msg/core/W-LfSq7KOCyiV-UigwmNXifV98M>
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 21:42:57 -0000

Hi Jon,
Hi carsten,

thanks for the fast answers!

So, changing the block-number to compensate a blocksize change, is the
intended behavior.

 > I don’t know of any issues that the change in “num” would cause.

That may depend on the interpretation of,

RFC 7959, 2.3. Block Options in Requests and Responses

Block 2 / Request
"The NUM field in the Block2 Option gives the block number of
the payload that is being requested to be returned in the
response."

The interpretation may be, either
- the requested "block number" is to be returned in the response, or
- the payload of the request block is to be returned.

best regards
Achim

Am 07.01.21 um 22:16 schrieb Carsten Bormann:
> Hi Achim,
>
> On 2021-01-07, at 21:44, Achim Kraus <achimkraus@gmx.net> wrote:
>>
>> 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 operative word here is “starts with”.
> So this is the first time the server has a chance to react to the proposed block size.
>
> Section 2 of RFC 7959 says:
>
>     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 […]
>
> This talks about the “first request”, which could be read as meaning “num=0”, but in this case clearly matches the premise.
>
>> - 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.
>
> I don’t know of any issues that the change in “num” would cause.
> “Num” is just a terse encoding for the current byte position (*), based on “szx”, and when szx changes, num has to change in unison.
> (Jon is right that, with the size divided by four, the num needs to be multiplied by four to start filling in the right byte position(**).)
>
>> - the server respond with an error; but which one should be used?
>
> Since the protocol has been designed to enable stateless servers, we didn’t see a need to provide an error that a stateless server would never know what to use for.
>
> Grüße, Carsten
>
> (*) Well, that is just given as an “Implementation note” in Section 2.2, but I would expect a sane implementation to follow this note.
>
> (**) A prank implementation might try to fill in num=23 for size=64, as this is also part of the block 5 at size 256.  I don’t think that this behavior would be justifiable, as the case for num=0 clearly fills in the leftmost block.
>