Re: [dispatch] A State Synchronization Working Group

Michael Toomim <toomim@gmail.com> Mon, 30 October 2023 14:13 UTC

Return-Path: <toomim@gmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E521AC151551 for <dispatch@ietfa.amsl.com>; Mon, 30 Oct 2023 07:13:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.195
X-Spam-Level:
X-Spam-Status: No, score=-2.195 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, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.091, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sTBuctDbbd4F for <dispatch@ietfa.amsl.com>; Mon, 30 Oct 2023 07:13:37 -0700 (PDT)
Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 72046C151070 for <dispatch@ietf.org>; Mon, 30 Oct 2023 07:13:37 -0700 (PDT)
Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1cc3542e328so8564405ad.1 for <dispatch@ietf.org>; Mon, 30 Oct 2023 07:13:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698675217; x=1699280017; darn=ietf.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=oVQez9Y6C47iNgpNScse1iyHw6QJgG3i4V7snmo76gk=; b=X/hvEyd6dKHyW9M6gf2/tpQ6YS0SuWame0dzKivFWDqmuH6/FwknB9XT+BlN0Hrvqh 9hXHBYNejCw9rl2aHvu7izWEDtR1DGO3KKVrbrkjnp70Z8timn1X8ZtN9Q2tNTfK736m 97lVy0pHPTcey0gBQvoirDoH/TyrRi0vGrHQCv2ODlNt7oKvFIdnEdii+g3hTc+woj6c NdIv/cKSQsmKEnj5eesn5Rup20b6qoRiZBLA84x0aK7Xk/imbbUUOFxMu65vivFwTwjt /cOAnExKIhVL0Vsf4za4EwsRsAt7S2h31Cgx+JgPYAzPoQXj98Db4ToLtSiJFPeiZFSC GHBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698675217; x=1699280017; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=oVQez9Y6C47iNgpNScse1iyHw6QJgG3i4V7snmo76gk=; b=DIJriy+BXduuTu1VDiPtTYLe0MT58RkP1O1WF3qjNEUQWPesnDbxLMu7mPTuJOyp+Z nGFMcv1dHRpwNaF888OgjWWdXgkJw6c44I5F6caKKwezjo5eZXcqgj8DuJchGTlv/4rH 2EeSTkVVfCAl+/iXl/slz5TketcbOCgE5RBaPE+QTjKT14yBEcV8gLGUHjmqfWFAQxVf AwOMp/A19zFDLYgQNrWkPhU2/RvYJC7QFQ+EHQbl5rAygNaBsxYsGTvbhg5du3B627+S c1Zm+ZMFRVfVSKXUe7FqJQfdZPrg7kij2hC7pfGsDxM2H/ht3S5Qctg05KqcIMFwom2d Hjqg==
X-Gm-Message-State: AOJu0YyLJYAS3vq8Deqjl0b9gJ4hT5i2SJOLgIN3zPlv7wj0v4vXPoLJ nLVwTuzpu22pgqiR/CaYKJ81C+z9h/4=
X-Google-Smtp-Source: AGHT+IEsloyltofJBCgIpjpEi4COclVqPZA1GZn8Akx5VLU0fmOwXLmAeFGcmE3RGf37+zFCnMmQGA==
X-Received: by 2002:a17:903:2341:b0:1cc:449b:41e3 with SMTP id c1-20020a170903234100b001cc449b41e3mr2721919plh.59.1698675216741; Mon, 30 Oct 2023 07:13:36 -0700 (PDT)
Received: from ?IPV6:2001:5a8:460f:2200:ddec:b7e0:8d6c:f5ca? ([2001:5a8:460f:2200:ddec:b7e0:8d6c:f5ca]) by smtp.gmail.com with ESMTPSA id g4-20020a170902868400b001cc2bc10510sm5133049plo.128.2023.10.30.07.13.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Oct 2023 07:13:36 -0700 (PDT)
Content-Type: multipart/alternative; boundary="------------YwdnP0sMOwcNUCh7toORdkPb"
Message-ID: <33d817be-11ca-b778-cd21-afa9a06d5572@gmail.com>
Date: Mon, 30 Oct 2023 07:13:34 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0
Content-Language: en-US
To: Joe Touch <touch@strayalpha.com>
Cc: dispatch@ietf.org
References: <bf9a894c-8540-6679-e3c4-85902581f773@gmail.com> <57ED1C14-DC52-409B-BFD4-EB6D4D4154EA@strayalpha.com>
From: Michael Toomim <toomim@gmail.com>
In-Reply-To: <57ED1C14-DC52-409B-BFD4-EB6D4D4154EA@strayalpha.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/jJWazH72xE0R9GqjqXXpJnqd0OA>
Subject: Re: [dispatch] A State Synchronization Working Group
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Oct 2023 14:13:42 -0000

(Forgot to reply all.)

Ah, yes, it is true that there is state synchronization happening within 
most stateful protocols like FTP and TCP. Let's clarify which aspects 
are within scope for this proposed Working Group.

    1. Not all state in a stateful protocol is synchronized across both
    (or all) peers. Some of it is held only in one peer. Out-of-scope is
    any aspect of the system where we don't require (1) both peers to
    hold the same state in memory over a period of time, and (2) the
    memory does not change over time while it is being held.

    2. Not all state synchronization needs a standard protocol. The WG
    would be pragmatic, like any other IETF working group. We would
    adopt work when there are multiple implementers that have a desire
    to interoperate, and when the work to generalize them appears to be
    feasible, and has volunteers willing to take it on.

So I would add to your statement of what is "useful" here:

> The challenge appears to be defining useful mechanisms that aren’t 
> domain specific. I.e., rsync is a file and directory state sync 
> protocol already. And by useful, IMO that would mean being a resource 
> in which the stateful parts of existing protocols could be represented 
> or implemented too.
Although I too am inspired by the mathematical elegance of the "General 
State Synchronization" problem, this WG would need to be pragmatic, and 
its definition for "useful" would have to include multiple implementers 
finding value in interoperability for real use-cases.

We can apply this to the TCP example. Perhaps there's value in 
generalizing TCP's method of synchronizing connection state (e.g. 
LISTENING/ESTABLISHED/CLOSED/SHUTDOWN) with other protocols for other 
things. If someone can persuade multiple implementers of that value, 
that would make a case for the WG to adopt this work.

That shouldn't be a blocker for us to generalize other simpler or 
clearer use-cases, though.

I think there is already clear attainable value in generalizing the 
state synchronization protocols in SCIM, IPP, NETCONF, SIP, JMAP, and 
most modern (dynamic) web apps. These do very similar types of state 
sync, over HTTP, and would benefit from performance improvements, 
network robustness, and standard tooling.

On 10/27/23 8:38 AM, Joe Touch wrote:
> Stateful protocols synchronize state. Not all sync is persistent or 
> fault-recovering.
>
> TCP synchronizes its state, the state of its options, as well as the 
> information about its segments. Some of these are one-shot events; 
> others have their shared state maintained.
>
> FTP relies on the state of TCP for its own basic state (connected or 
> not) and to perform transfers, but - as you note, the transfer part is 
> one-time.
>
> The challenge appears to be defining useful mechanisms that aren’t 
> domain specific. I.e., rsync is a file and directory state sync 
> protocol already. And by useful, IMO that would mean being a resource 
> in which the stateful parts of existing protocols could be represented 
> or implemented too.
>
> Joe
>
>> On Oct 26, 2023, at 3:40 PM, Michael Toomim <toomim@gmail.com> wrote:
>>
>> 
>> Joe Touch wrote:
>>> Hi, Michael,
>>>
>>> How is this not exactly what all stateful protocols all already do?
>>
>> Sure! Let's distinguish a *stateful* protocol from a *state 
>> synchronization* protocol, because these are totally different things.
>>
>> First, not all stateful protocols do synchronization. Consider the 
>> stateful protocol FTP:
>>
>>     $ ftp exmaple.com
>>     ...
>>     cwd docs
>>     mkd ietf-2023
>>     cwd ietf-2023
>>
>> These commands change the server state, but don't affect the client 
>> state. The client doesn't know what the current working directory is, 
>> nor what's on the server's filesystem.
>>
>> A state /synchronization/ protocol ensures (or tries to ensure) that 
>> both peers end up with the same state. For instance, a FTP client can 
>> download a file from a server:
>>
>>     get braid-http.txt
>>
>> ...but if the file changes on the server, FTP has no mechanism to 
>> automatically update the client. And if the file changes on the 
>> client, FTP does not automatically update the server. And if both 
>> client and server change the file simultaneously, FTP has no way to 
>> automatically merge those edits. And if the connection dies, FTP does 
>> not automatically re-establish the connection and the current working 
>> directory—the user has to do all of this manually. Thus, FTP is a 
>> /state transfer/ protocol, not a /state synchronization/ protocol, 
>> and it happens to do this /statefully/./
>> /
>>
>> As a rule of thumb, state synchronization protocols tend to have one 
>> or more of these keywords in them:
>>
>>     - Publish / Subscribe
>>     - Notify / Notification
>>     - Event, Event Types, State, Updates
>>     - Diffs, Patches, Merges
>>     - Synchronization
>>
>> See https://www.rfc-editor.org/rfc/rfc4533.html for an example that 
>> is currently open in a browser tab on my computer.
>>
>> Michael
>>