Re: [Rift] KV draft published

Bruno Rijsman <brunorijsman@gmail.com> Fri, 15 January 2021 09:02 UTC

Return-Path: <brunorijsman@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 18F7E3A10E4 for <rift@ietfa.amsl.com>; Fri, 15 Jan 2021 01:02:50 -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 UQx5G_hBHtsy for <rift@ietfa.amsl.com>; Fri, 15 Jan 2021 01:02:48 -0800 (PST)
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 718303A10E8 for <rift@ietf.org>; Fri, 15 Jan 2021 01:02:47 -0800 (PST)
Received: by mail-ej1-x636.google.com with SMTP id 6so12244806ejz.5 for <rift@ietf.org>; Fri, 15 Jan 2021 01:02:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=sIYioeLlbP+vL76mhPmNYNOKyN03LFw9he/ts8/tN0w=; b=mCxXgzmTU3aQLmFFZX4tgQaf4hTUY/eg50yjFSzkfqbiiaUKzKluWUysXyk2bKv6rX eTE+DnyGzH4NhcRq33QKxsUNQhy5ZRwuk8b7VrPWbSEaTrXeve29VN0VmSTWgNJUqyE7 j8MaG+njQESmLuZd9kqkUYJhF16DDqjgvTX9Qt15dqldJRD/OiYRciGgIy3wQ4b8BteK KVOycUaXhFi4WMoVoVpxp1m3PQxWhO4ylD9kRj1gMFl1/Sv+5d0Kwd75rKi1f45oZD0h X4x18AGyHP9zpdS9zUKXKV2JcPN2hGikWBT0u3Lcu8vvniUpsqhLVzbD5DIKd64bpJG6 SCYw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=sIYioeLlbP+vL76mhPmNYNOKyN03LFw9he/ts8/tN0w=; b=ZZS8Aw0bMx4yIE/PYRs3TTVViVCiVYjrb3zyLopx+J4rAvZ261GshhA8zL/yiBCQCg v+zlcWG2gBvrI2qMigjTs4eCfsl017tZn5XWntRdpG53wb2+iF6PxWzYzC//Q6PrJljP 7j+7btG8n9vv3tGLnToD9n806eUDTOFjZb1Hg+9EK6DETSlGA1QSvs+H4/L5j5Q1SfXX f114aYwUgU7DtECbqtln55C9vXjAvEG1JF8kYwvfHrM8qjb1uPbGSbuK2/Cx8bWa7g3F YlFkSFDljG0t11pZbJ3o106qjhwWYwRAjjCs1JCyNw3Bmy5K3osbxIK+Y4pushir/JHM r6CQ==
X-Gm-Message-State: AOAM530MouLJZ+AMj8kiLo8rgEdmB3zqNXvfLGvE9EOipSajuwGnqa4l SXfdVg+RNyvuWQbaARhpECIk/xr2NzE=
X-Google-Smtp-Source: ABdhPJzltH9AMVXHJp+yoQLhbors3IxBN3SkGDgF6lRKjIMhy4kqwr7Sxzc6xs97NQtOHEDWxv/fLA==
X-Received: by 2002:a17:906:d0c2:: with SMTP id bq2mr8074342ejb.1.1610701365625; Fri, 15 Jan 2021 01:02:45 -0800 (PST)
Received: from 2001-1c03-3f02-2400-615b-7ef7-1b2d-d168.cable.dynamic.v6.ziggo.nl (2001-1c03-3f02-2400-615b-7ef7-1b2d-d168.cable.dynamic.v6.ziggo.nl. [2001:1c03:3f02:2400:615b:7ef7:1b2d:d168]) by smtp.gmail.com with ESMTPSA id hr3sm1712617ejc.41.2021.01.15.01.02.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2021 01:02:44 -0800 (PST)
From: Bruno Rijsman <brunorijsman@gmail.com>
Message-Id: <A81D66E2-573E-44D9-9673-D6ECE1CD9028@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_E317FCF1-4F54-470E-96FA-71A7AC74F61F"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
Date: Fri, 15 Jan 2021 10:02:43 +0100
In-Reply-To: <CA+wi2hMNpJOEZ_gC24gsMe-Z8KGVcOidTg7O8HgMdhNpckeZLg@mail.gmail.com>
Cc: rift@ietf.org
To: Tony Przygienda <tonysietf@gmail.com>
References: <CA+wi2hMNpJOEZ_gC24gsMe-Z8KGVcOidTg7O8HgMdhNpckeZLg@mail.gmail.com>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/rift/y7RUcJvq9d2Y_S-xgXqmf5kfITk>
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: Fri, 15 Jan 2021 09:02:50 -0000

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/ <https://datatracker.ietf.org/doc/draft-przygienda-rift-kv-registry/>
> _______________________________________________
> RIFT mailing list
> RIFT@ietf.org
> https://www.ietf.org/mailman/listinfo/rift