Re: [dhcwg] draft-ietf-dhc-dhcpv6-yang-04 - DUID representation in the model

Ted Lemon <mellon@fugue.com> Sun, 17 December 2017 00:26 UTC

Return-Path: <mellon@fugue.com>
X-Original-To: dhcwg@ietfa.amsl.com
Delivered-To: dhcwg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 07B4E126D45 for <dhcwg@ietfa.amsl.com>; Sat, 16 Dec 2017 16:26:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fugue-com.20150623.gappssmtp.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 yekTpqErYIR4 for <dhcwg@ietfa.amsl.com>; Sat, 16 Dec 2017 16:26:44 -0800 (PST)
Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (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 DFB5F1205D3 for <dhcwg@ietf.org>; Sat, 16 Dec 2017 16:26:43 -0800 (PST)
Received: by mail-io0-x22e.google.com with SMTP id x129so6328563iod.13 for <dhcwg@ietf.org>; Sat, 16 Dec 2017 16:26:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fugue-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1aCkEXQDJmyPqewEDbQan3t1CV4KPYyo0X8bM31vx+I=; b=JrNYgRX0sPxwo0zOsVIyoOeH70C1iwVroOKAYFKlgu2UeDa8fLgQbMexced8PNryuj zyGdZw+fgPlZbI7w9Gw7pcnRZmXOxLsQJuxiNJdJGol9Qwco32XXUCVd4BKXQt5PyMUZ VmGRMw+QTlNJD5CyNfOs5/V3X1H75jliK0yWJ8K+jazmniBd3PxpPeoTJPTlc9YQtSRP BoxSWHOMnSZzBD+LwvylT++ZktKtKMaa3OZ6tlVAWY8yrWnf0cS1H/CQMXxsLNOiJXRq DPJt6/I5BFyPhcp6peUWlWsThnWQO8DZIS4Vgb/3w94eCXHD7Kg93OP/2QHLeb/mTWXz IZpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1aCkEXQDJmyPqewEDbQan3t1CV4KPYyo0X8bM31vx+I=; b=qKV/xjQnQUWHbkYoq0i2qLvOJXGuXw4n6QF7LKS++rzQyB/AUUSIk7dXolEwU1pQVN r60YrsCXSTFMRwf3kFh9Sisa0mDxuWiGCxW6CI6L/2+bmyGY2IjQYtjqxSe432DDEMwG 8bps9a2acCiqlxtfB9R+KmYVGKpGCnb0sb89p64Ng+0ke6Z+OsiHLqlBWmA6ojnMYKlp RE3WmF1EC9P8+Vy9IEe9zBwOLlS/OuuNQ//2WpCFH6wogq+LeVCBz8vp8eKs6Q1pLpU6 FiPzYXcfDGE8+YPPxdxmBGlVtEzkFtQXfAygm70Yy1EIcF/xSasyn7ddBTeg2ijVgPmZ SeGw==
X-Gm-Message-State: AKGB3mKJ5MNonW4xu85PX/RaPMbI3FMklwMAkbqSZsuVYpLJaxfhaHXD GXjrZA2068YT/CTPVWUdfXnM0r/ajiDI7M7n3Ppg6Q==
X-Google-Smtp-Source: ACJfBotMevB8yaei8Sv8FxGyTtXReb5TnlfGIkhGSrLBBiSUefsMO86pGL2QvOExMtDKm3A9UBx64OTSOdtZbRlVztQ=
X-Received: by 10.107.168.216 with SMTP id e85mr18341913ioj.266.1513470403177; Sat, 16 Dec 2017 16:26:43 -0800 (PST)
MIME-Version: 1.0
Received: by 10.79.15.203 with HTTP; Sat, 16 Dec 2017 16:26:42 -0800 (PST)
Received: by 10.79.15.203 with HTTP; Sat, 16 Dec 2017 16:26:42 -0800 (PST)
In-Reply-To: <1CE63371-2F92-4167-9AF8-93A444A13E87@gmail.com>
References: <0cab196d775e45668ef2fec69f317ce1@XCH-ALN-003.cisco.com> <7E297315-1B5B-437D-A447-221E8DAA5388@gmx.com> <A670F3DD-DEBC-40D5-8890-A5D43233362F@cisco.com> <0D8F77A1-3B91-4D6E-A7F2-5720EF0AFA51@gmx.com> <A60591D3-7598-4BFB-9F30-A69257D65E01@thehobsons.co.uk> <D97294FF-5684-43B2-AD85-DB0C47D1A204@cisco.com> <B40E98BF-FAAF-4E48-9E10-CA69BD291D04@thehobsons.co.uk> <76ABAA0E-31D1-4AEC-B8A9-3E9C1098C279@gmail.com> <195BDEED-2A66-4AE8-BC97-BB1FCE02092C@fugue.com> <1CE63371-2F92-4167-9AF8-93A444A13E87@gmail.com>
From: Ted Lemon <mellon@fugue.com>
Date: Sat, 16 Dec 2017 19:26:42 -0500
Message-ID: <CAPt1N1kxWXKKbivo_10sdCySArd68c4HFuZZ2N5HkJxCC9Jhjg@mail.gmail.com>
To: hezihao <hezihao9512@gmail.com>
Cc: Simon Hobson <dhcp1@thehobsons.co.uk>, dhcwg <dhcwg@ietf.org>, "draft-ietf-dhc-dhcpv6-yang@ietf.org" <draft-ietf-dhc-dhcpv6-yang@ietf.org>
Content-Type: multipart/alternative; boundary="001a1142e704c2835e05607e493b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dhcwg/kA7uDbrQ59hOY27qygLYTsYCc_4>
Subject: Re: [dhcwg] draft-ietf-dhc-dhcpv6-yang-04 - DUID representation in the model
X-BeenThere: dhcwg@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: <dhcwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dhcwg>, <mailto:dhcwg-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dhcwg/>
List-Post: <mailto:dhcwg@ietf.org>
List-Help: <mailto:dhcwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dhcwg>, <mailto:dhcwg-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Dec 2017 00:26:46 -0000

That sounds right. I will trust that your yang knowledge is better than
mine!  :)

On Dec 16, 2017 02:28, "hezihao" <hezihao9512@gmail.com> wrote:

> On 12/16/2017 11:53,Ted Lemon<mellon@fugue.com> <mellon@fugue.com> wrote:
>
> *I would suggest that you just have an "invalid type" for unknown types
> and malformed DUIDs, and have it have the type code in it:*
>
> *|     +--:(duid-invalid)*
> *|        +--rw type-code?                   uint16*
> *|        +--rw data?                        yang:bytes*
>
> *This would be used for any DUID that either has an unrecognized type, or
> doesn't contain enough bytes to satisfy the format corresponding to the
> type code that was received.*
>
> *I used yang:bytes because I don't actually know how to represent raw
> bytes in a yang data model; hopefully it's something like that.*
>
>
> Zihao -
> Hi Ted, thanks for your suggestion and I re-modeled DUID accordingly,
> which is shown in the tree diagram below.
> I think the built-in type 'binary'  is a good choice to represent raw
> bytes in a yang model.
>      +--rw duid
>          |  +--rw type-code?                   uint16
>     ---- default:0xffff
>          |  +--rw (duid-type)?
>         ---- default: duid-invalid
>          |     +--:(duid-llt)
>          |     |  +--rw duid-llt-hardware-type?      uint16
>          |     |  +--rw duid-llt-time?               yang:timeticks
>          |     |  +--rw duid-llt-link-layer-addr?    yang:mac-address
>          |     +--:(duid-en)
>          |     |  +--rw duid-en-enterprise-number?   uint32
>          |     |  +--rw duid-en-identifier?          string
>          |     +--:(duid-ll)
>          |     |  +--rw duid-ll-hardware-type?       uint16
>          |     |  +--rw duid-ll-link-layer-addr?     yang:mac-address
>          |     +--:(duid-uuid)
>          |     |  +--rw uuid?                        yang:uuid
>          |     +--:(duid-invalid)
>          |        +--rw data?                binary
> (Since the identifiers of all child nodes must be unique within all cases
> in a choice, I moved 'type-code' out of 'duid-type'.)
>
> Besides, I set the default value for 'type-code' as 0xffff and the default
> case of 'duid-type' as 'duid-invalid', thus reducing the possibility of a
> malformed DUID to be treated as a known type.
>
>
>