Re: [Rift] KV draft published

Tony Przygienda <tonysietf@gmail.com> Sat, 30 January 2021 20:37 UTC

Return-Path: <tonysietf@gmail.com>
X-Original-To: rift@ietfa.amsl.com
Delivered-To: rift@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 12D353A111A for <rift@ietfa.amsl.com>; Sat, 30 Jan 2021 12:37:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sf4nKwNwHolh for <rift@ietfa.amsl.com>; Sat, 30 Jan 2021 12:37:26 -0800 (PST)
Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 94D8A3A1119 for <rift@ietf.org>; Sat, 30 Jan 2021 12:37:26 -0800 (PST)
Received: by mail-io1-xd2a.google.com with SMTP id n2so13191568iom.7 for <rift@ietf.org>; Sat, 30 Jan 2021 12:37:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O4oLyesKnBrKXEyGd5yAUS19AjAPwr2CfzffRU59uJ0=; b=WSA2G3CcKxryLPgYUDGCW2d9qeQ04RPAQkTJ0sCygUZkZRk2ZI8Vb7A5vo1CMiyIII 5e8yMjmvtVhdznhlJKU2fFffyDqTUfjUinaQ8mGbP5OhV1Zfcu/231JY/6cs1ajbXFEI vDGpihppJPI/0C3o5lMsYStAdLxHIMk+Id+d+7FZ1NQ8Dy/KL8bYV/X8Usds82cuheQg Oj7W5BsrvqRwzB7S0fs217xK3qstV+Ji0gl0wn3ObJwrMUEdc60ZVVHmnzUv86TEzZZz fr1uNoB7rCwZZ7cppG6IgyV1tZHdgyebPon8wQ7a+D0oWBENXVmOCS2gMwIuQVNE5K43 rzAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O4oLyesKnBrKXEyGd5yAUS19AjAPwr2CfzffRU59uJ0=; b=XV8vl9ooLjSa6A5MnyOFTwmTToUWKC1kxOB1S2nH0b7w1NQREEVzmZyqEx5nPc6XH4 7ILoY0Hrkie9Gvpjm/yRMNi0/SkB2HjqULxDlExsbeEdSLzuKj+PLEdcuu2okzSLVwYt I9LUAClyjjxeDhL8f54D7Qjm+4IZm8yHr0oaW5JGVA4lMVPC5wggwA7zvwo6SqmlwYlr MwOi532OXbGTa1U5YBux1yH7GgJazW0CYXmxms+uYqilT+ju74yqz0EyfWIPl0BQr2Fs oSzrzqbHZc869BYYmbq4BAwhJXRXDkUbp65ziFnD76b9LumgREbf/GMM1WlBn6fTlTBE jllA==
X-Gm-Message-State: AOAM530hqZ35bioluaAErT4KNKAEJD00MmPfn0NAROz/r0Sq+/zBBBeM /A484N+2hgXVudW5pV0VA446NUqmiwhcNnNlvKI=
X-Google-Smtp-Source: ABdhPJzbATLxOOtUjyNZ4ucsFEdjuSwwuOeIxLFTHZIndoNg60B+99odjMxHNk3isbhbDJblbJi/tgujvow/fvERSyA=
X-Received: by 2002:a6b:cc07:: with SMTP id c7mr8016349iog.122.1612039045639; Sat, 30 Jan 2021 12:37:25 -0800 (PST)
MIME-Version: 1.0
References: <CA+wi2hMNpJOEZ_gC24gsMe-Z8KGVcOidTg7O8HgMdhNpckeZLg@mail.gmail.com> <A81D66E2-573E-44D9-9673-D6ECE1CD9028@gmail.com>
In-Reply-To: <A81D66E2-573E-44D9-9673-D6ECE1CD9028@gmail.com>
From: Tony Przygienda <tonysietf@gmail.com>
Date: Sat, 30 Jan 2021 21:36:49 +0100
Message-ID: <CA+wi2hMR3j_jbWwNovrJ2=3_1Z2cJF77SVSZJ7LNanR-K56xPQ@mail.gmail.com>
To: Bruno Rijsman <brunorijsman@gmail.com>
Cc: rift@ietf.org
Content-Type: multipart/alternative; boundary="000000000000adfa8f05ba24161a"
Archived-At: <https://mailarchive.ietf.org/arch/msg/rift/FKLoyV-J2D3ZGqPAD2UV2L0jdHw>
Subject: Re: [Rift] KV draft published
X-BeenThere: rift@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Discussion of Routing in Fat Trees <rift.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rift>, <mailto:rift-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rift/>
List-Post: <mailto:rift@ietf.org>
List-Help: <mailto:rift-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rift>, <mailto:rift-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jan 2021 20:37:29 -0000

Hey Bruno

1. agree with the binary vs string, I read some thrift spec that said
string=binary and string should be preferred that's why we ended like this
2. thrift has no extension concept, we would need to rev the model

value can be encoded model, nothing prevents it

On Fri, Jan 15, 2021 at 10:02 AM Bruno Rijsman <brunorijsman@gmail.com>
wrote:

> Some comments:
>
> *Comment #1*. In draft-ietf-rift-rift-12 both the key type (KeyIDType)
> and the key value (keyvalues) are defined as a Thrift string type. In the
> Thrift spec (https://thrift.apache.org/docs/types) a string is defined as
> "A text string encoded using UTF-8 encoding". We cannot encode arbitrary
> sequences of bytes into a UTF-8 encoded string. All sorts of libraries will
> throw exceptions / return errors when the string is not a valid UTF-8
> encoded string. At the very least we have to change it from a Thrift string
> type to a Thrift binary type (but we should also consider something more
> sophisticated - see #2, #4 and #5 below).
>
> *Comment #2*. It would be a very nice validation of the model-based
> approach if the key-values could be modeled using Thrift. It kind of feels
> like a let-down that we are reverting back to old fashioned ASCII
> byte-layout diagrams. More specific proposals below in #4 and #5.
>
> *Comment #3*. Do we need to introduce a new capability to announce that
> an implementation understands this particular format of key-values?
> Something along the lines of:
>
> struct NodeCapabilities {
>   ...
>   4: optional bool rfcxxxx_key_values;   /* Means we understand the key
> types and values as defined in separate RFC xxxx)
> }
>
> *Comment #4*. Comments #2 and #3 bring up the following question: how do
> we extend the Thrift data model (e.g. introduce new fields and/or structs)
> without having to (a) update the base spec or (b) repeat the entire RIFT
> data model, add something, and bump the version in the spec that defines
> the new thing? Google protobuf2 provides an "extensions" mechanism for
> exactly this purpose (
> https://developers.google.com/protocol-buffers/docs/proto#extensions).
> Similarly, both SNMP (ASN.1) and YANG have "augment" statements. What is
> the mechanism in Thrift for one data model (spec) to augment another data
> model (spec)?
>
> I imagine augmenting the RIFT data model would look something similar to
> the following. Here I am using protobuf2 syntax because I am not aware of
> what the corresponding mechanism in Thrift is. (Maybe I got the protobuf2
> details wrong; it's the idea that counts.)
>
> /*------- RIFT base spec -------*/
>
> message KeyType {
>   extensions 100 to max;
> }
>
> typedef bytes KeyValue;
>
> message NodeCapabilities {
>   required uint32 minor_version = 1;
>   optional bool flood_reduction = 2 [default = false];
>   /* ... other capabilities defined in base spec ... */
>   extensions 100 to max;
> }
>
> /*------- Key-value spec -------*/
>
> extend basespec.KeyType {
>   optional StandardKeyType = 100;
>   optional VendorKeyType = 101;
> }
>
> message StandardKeyType {
>   required bytes standard_assigned_type = 1;
> }
>
> message VendorKeyType {
>   required bytes vendor_oiu = 1;   /* Must be exactly 3 bytes *.
>   required bytes vendor_assigned_type = 2;
> }
>
> extend basespec.KeyValue {
>   optional OUIScopedKeyValue = 100;
> }
>
>
> extend basespec.NodeCapabilities {
>   optional oui_scoped_key_values = 100 [default = false];
> }
>
> PS: Protobuf3 dropped support for extensions and uses the Any type
> instead, which is interesting.
>
> *Comment #5*: In the proposal described in comment #4 the key values are
> still opaque byte strings (same as in the current base spec). The key-value
> internal structure is still not described in the data model. If you follow
> the above line of reasoning to its logical conclusion, you wouldn't need
> seperate key-ids and key-values. You could just have an monilithic
> "expansion" field, along the following lines (using protobuf2 syntax, once
> again):
>
> PS: I carefully picked the term "expansion" to avoid confusion with the
> "extension" GPB keyword.
>
> /*------- Base spec -------*/
>
> message ExpansionTIEElement {
>   repeated optional ExpansionType expansions = 1;
> }
>
> message ExpansionType {
>   /* The format of expansions is defined in other specifications */
>   extensions 100 to max;
> }
>
> /*------- Spec for vendor-defined expansions -------*/
>
> extend basespec.ExpansionType {
>   repeated optional VendorExpansion vendor_expansions = 100;
> }
>
> message VendorExpansion {
>   required bytes vendor_oiu = 1;   /* Must be exactly 3 bytes *.
>   required bytes vendor_assigned_type = 2;
>   optional bytes value = 3;
> }
>
> extend basespec.NodeCapabilities {
>   optional vendor_expansion = 100 [default = false];
> }
>
> /*------- Hypothetical standard spec to flood host names -------*/
>
> extend basespec.ExpansionType {
>   optional HostNameExpansion host_name_expansion = 101;
> }
>
> message HostNameExpansion {
>   required string host_name = 1;
> }
>
> extend basespec.NodeCapabilities {
>   optional host_name_expansion = 101 [default = false];
> }
>
> /*------- Hypothetical standard spec to flood GPS coordinates -------*/
>
> extend basespec.ExpansionType {
>   optional GPSCoordinateExpansion gps_coordinate_expansion = 102;
> }
>
> message GPSCoordinateExpansion {
>   required float longitude = 1;
>   required float lattitude = 2;
>   optional string datum = 3;
> }
>
> extend basespec.NodeCapabilities {
>   optional gps_coordinate_expansion = 102 [default = false];
> }
>
>
>
> — Bruno
>
> On Dec 14, 2020, at 7:59 AM, Tony Przygienda <tonysietf@gmail.com> wrote:
>
> Co-authorship and discussions around use cases/codepoints encouraged
>
> https://datatracker.ietf.org/doc/draft-przygienda-rift-kv-registry/
>
> _______________________________________________
> RIFT mailing list
> RIFT@ietf.org
> https://www.ietf.org/mailman/listinfo/rift
>
>
>