Re: [Wish] Use entity-tags for solving out of order PATCH requests

Lorenzo Miniero <lorenzo@meetecho.com> Thu, 03 March 2022 11:39 UTC

Return-Path: <lorenzo@meetecho.com>
X-Original-To: wish@ietfa.amsl.com
Delivered-To: wish@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E422D3A112A for <wish@ietfa.amsl.com>; Thu, 3 Mar 2022 03:39:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.911
X-Spam-Level:
X-Spam-Status: No, score=-1.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=aruba.it
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 ab6guxIzsT2Z for <wish@ietfa.amsl.com>; Thu, 3 Mar 2022 03:39:07 -0800 (PST)
Received: from smtpcmd14161.aruba.it (smtpcmd14161.aruba.it [62.149.156.161]) by ietfa.amsl.com (Postfix) with ESMTP id 451513A1129 for <wish@ietf.org>; Thu, 3 Mar 2022 03:39:06 -0800 (PST)
Received: from lminiero ([2.232.93.8]) by Aruba Outgoing Smtp with ESMTPSA id PjnSnlpvfNVvLPjnTn3Oft; Thu, 03 Mar 2022 12:39:04 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1646307544; bh=0D6e5T10arCV58L8TzEHcxFTTfBjmeAlMhT9ZJua2Ck=; h=Date:From:To:Subject:MIME-Version:Content-Type; b=Uw479zFXseJMp4mFbgbyW1whYRLbkB7BkMkaLNJrKs8zsXcJ5LTCJnU3pOrUrhOAx MUYpSfL2yQE2R6Tc9KZd2RyDQ7MKtdnPRwsZ/62z2C0SBKOY7K/b62u7yCuRQMUOfl EhrrfcU3ZrOtpDlZScLk0lIXnpDwVYvltQLlnBcCJzK4wBG/5TrDFT7uyP8PSopUBx pbrbVPcdCbQEsoP3614NfWuG8z/AhCp7jwD0OvHSuq0vrC9h/NKfd3UY75PP/RHJRP UXcl0sb0kQjdOjNkZ//Jhu0LHV6JP+cHJGyMNJv+/0YriDvbh5mcG711FXR96w0kLs RLN0ho+SV3XeQ==
Date: Thu, 03 Mar 2022 12:39:02 +0100
From: Lorenzo Miniero <lorenzo@meetecho.com>
To: Juliusz Chroboczek <jch@irif.fr>
Cc: Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com>, WISH List <wish@ietf.org>
Message-ID: <20220303123902.7a36f9fd@lminiero>
In-Reply-To: <87ee3juvgx.wl-jch@irif.fr>
References: <CA+ag07bXRH9en5rWg3FBXOFp4OCz1N5HtpyK6+nbjycj1jkTaA@mail.gmail.com> <87ee3juvgx.wl-jch@irif.fr>
Organization: Meetecho
X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-CMAE-Envelope: MS4wfA4lLEYr6xF7Jf/W/sxC+4RrfY0ue2EI+Tyz0BfME9ivvHh5pq+Bq30QX4b3NcjlKJADhXHbetGA3BZ22SQp0291VCEfscUirlBronkOY64jafEyMsM8 Nhs2UpFEGSR2okQac7bjME8w6LacRqwiy3SK4h9iMUUdw9XSES1lVe1SRlcJvPZg0bZ9If0p9NVUCp7y40fXbb5Uo28/Iv1cW04=
Archived-At: <https://mailarchive.ietf.org/arch/msg/wish/0SMmsa3UvdhXll7-4_-LEgwmSps>
Subject: Re: [Wish] Use entity-tags for solving out of order PATCH requests
X-BeenThere: wish@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: WebRTC Ingest Signaling over HTTPS <wish.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/wish>, <mailto:wish-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/wish/>
List-Post: <mailto:wish@ietf.org>
List-Help: <mailto:wish-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/wish>, <mailto:wish-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 03 Mar 2022 11:39:13 -0000

On Thu, 03 Mar 2022 12:27:42 +0100
Juliusz Chroboczek <jch@irif.fr> wrote:

> Thanks a lot for your work, Sergio.  I think I got it now.
> 


Hi Juliusz,

chiming in with some responses (from my understanding of the document)
and comments, waiting for Sergio to answer.


> 1. Would you consider adding guidance for server implementers about
> how to generate the ETag ?  For example, something like
> 
> "The ETag could, for example, be generated by appending the ICE ufrag
> with the ice password, or by using the timestamp of the last ICE
> restart."
> 
> (I'm not very familiar with HTTP, but it is my understanding that a
> strong ETag must be unique over the lifetime of a resource.  I'm not
> quite sure what a resource is, and I'm not sure what data can be used
> to guarantee the properties of the ETag that are required by HTTP.
> I'm sure I'm not the only person who would find such guidance useful.)
> 


It's my understanding that any random string would work, so if
concatenating ICE ufrag and pwd (which is what Sergio does in the
draft) works for you, then it's ok. Even if the ETag is supposed to be
unique over the lifetime of a resource, as you say, a WHIP resource has
a short life, since once the PeerConnection is closed it goes away
(further attempts to publish to the same WHIP endpoint will in practice
create a new resource, even if the URI is the same). As such, it should
be easy to enforce those unique IDs in that limited scope.


> 2. Could you please spell out explicitly how the server distinguishes
> between restarts and candidates?  My understanding is that one says
> "If-Match: "*"" while the other carries a strong ETag, but I'd like
> to see it spelled out explicitly.
> 


The right way to do that would be looking at the payload, I suppose: if
the provided ICE credentials differ from the ones you knew, it's a
restart. In my prototype, for instance, I'm only allowing "*" as a
value if the payload _actually_ contains a restart: not sure if that's
overly zealous, or even plain wrong (maybe 412 makes no sense if the
client is sending "*"?).


> 3. What should a server do if it cannot parse a candidate (say, the
> client sends an mDNS candidate, and the server doesn't implement
> mDNS, or the server is IPv6-only and the client sends an IPv4
> candidate).  Should it return success and ignore the candidate, or
> should it return an error?  If so, which one?
> 


I think it's up to the implementation: in my case I'm just sending a
204 back whether Janus will accept the trickle candidate or not,
without waiting for a response.


> 4. What should the server do if restarting ICE fails?  Should it
> ignore the restart and return the same ETag as before, should it
> return an error to the client and continue with the previous ICE
> generation, or should it return the error and close the RTP stream
> (with RTCP BYE)?
> 


That's a good point: in my implementation, I'm sending a 400 back
(arbitrary choice, some text in the draft would indeed help), but I'm
not actively tearing down the PeerConnection. In theory, if an ICE
restart is required and the ICE restart itself fails, I guess it's
reasonable to assume the PC will eventually go down by itself anyway,
but maybe some guidance in the draft would indeed help.

Lorenzo

-- 
I'm getting older but, unlike whisky, I'm not getting any better
https://twitter.com/elminiero