Re: [core] block1 size negotiation with 4.13 Request Entity Too Large
supjps-ietf@jpshallow.com Thu, 07 January 2021 21:04 UTC
Return-Path: <jon.shallow@jpshallow.com>
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 4A52C3A0EC3 for <core@ietfa.amsl.com>; Thu, 7 Jan 2021 13:04:10 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 qtmrOxINkZrX for <core@ietfa.amsl.com>; Thu, 7 Jan 2021 13:04:08 -0800 (PST)
Received: from mail.jpshallow.com (mail.jpshallow.com [217.40.240.153]) (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 41EAC3A0EC0 for <core@ietf.org>; Thu, 7 Jan 2021 13:04:08 -0800 (PST)
Received: from mail2.jpshallow.com ([192.168.0.3] helo=N01332) by mail.jpshallow.com with esmtp (Exim 4.92.3) (envelope-from <jon.shallow@jpshallow.com>) id 1kxcRx-0002zI-NK; Thu, 07 Jan 2021 21:04:05 +0000
From: supjps-ietf@jpshallow.com
To: Achim Kraus <achimkraus@gmx.net>, 'Carsten Bormann' <cabo@tzi.org>
Cc: core@ietf.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> <AE33D7A2-A503-4E90-AB66-9CC7C64FF211@tzi.org> <3560ba6c-9840-653a-bfb6-2685142c0988@gmx.net>
In-Reply-To: <3560ba6c-9840-653a-bfb6-2685142c0988@gmx.net>
Date: Thu, 07 Jan 2021 21:04:19 -0000
Message-ID: <034801d6e538$aa42eb90$fec8c2b0$@jpshallow.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQMnlbxFyzt/r52kzVIQGv204oQK2gHfla+WAW4JaswBo0oYDwOTXO8KAeLEH4unKA1dwA==
Content-Language: en-gb
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/z9_HsDxAQJ17cqFwz2QhViOsZDI>
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:04:10 -0000
Hi Achim, It is my understanding that CONTENT block2(num=5, size=256) CONTENT block2(num=20, size=64) Are equivalent as they both define the same offset into the data, and so returning " CONTENT block2(num=20, size=64)" is valid for your example. Regards Jon > -----Original Message----- > From: Achim Kraus [mailto:ietf-supjps-achimkraus@gmx.net] > Sent: 07 January 2021 20:44 > To: Carsten Bormann > Cc: core@ietf.org > Subject: Re: [core] block1 size negotiation with 4.13 Request Entity Too > Large > > 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 > >>> > >> > > > > _______________________________________________ > core mailing list > core@ietf.org > https://www.ietf.org/mailman/listinfo/core
- [core] block1 size negotiation with 4.13 Request … Simon Bernard
- Re: [core] block1 size negotiation with 4.13 Requ… Achim Kraus
- [core] Fwd: Re: block1 size negotiation with 4.13… Achim Kraus
- Re: [core] block1 size negotiation with 4.13 Requ… Carsten Bormann
- Re: [core] block1 size negotiation with 4.13 Requ… Simon Bernard
- Re: [core] block1 size negotiation with 4.13 Requ… Achim Kraus
- Re: [core] block1 size negotiation with 4.13 Requ… Carsten Bormann
- Re: [core] block1 size negotiation with 4.13 Requ… Simon Bernard
- Re: [core] block1 size negotiation with 4.13 Requ… Achim Kraus
- Re: [core] block1 size negotiation with 4.13 Requ… Achim Kraus
- Re: [core] block1 size negotiation with 4.13 Requ… supjps-ietf
- Re: [core] block1 size negotiation with 4.13 Requ… Carsten Bormann
- Re: [core] block1 size negotiation with 4.13 Requ… Achim Kraus
- Re: [core] block1 size negotiation with 4.13 Requ… Carsten Bormann