Re: [yang-doctors] YANG QUIC-LB model
Ladislav Lhotka <ladislav.lhotka@nic.cz> Tue, 02 February 2021 08:26 UTC
Return-Path: <ladislav.lhotka@nic.cz>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1])
by ietfa.amsl.com (Postfix) with ESMTP id 449D03A1860
for <yang-doctors@ietfa.amsl.com>; Tue, 2 Feb 2021 00:26:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level:
X-Spam-Status: No, score=-2.1 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, NICE_REPLY_A=-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 (1024-bit key)
header.d=nic.cz
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 9guzOXFk-AX2 for <yang-doctors@ietfa.amsl.com>;
Tue, 2 Feb 2021 00:26:39 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ietfa.amsl.com (Postfix) with ESMTPS id 2042C3A185F
for <yang-doctors@ietf.org>; Tue, 2 Feb 2021 00:26:39 -0800 (PST)
Received: from [IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8] (unknown
[IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8])
by mail.nic.cz (Postfix) with ESMTPSA id 277FC140AD0
for <yang-doctors@ietf.org>; Tue, 2 Feb 2021 09:26:37 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default;
t=1612254397; bh=NMBBthagiVj1sPLbm4SrRwIJ9nmWlcsJANrA8goyMgg=;
h=To:From:Date;
b=qHBB5SDlH4aYA8KUZL9exva1q/XkGT9dycLg4gNLd8l5tv8kCGF7yiSLPrE1oS+E5
9S/UMqfEEeC5iFSmtv86tt4q895NUU25qrbb+Nm47jrq8QTsXWLZWtt4tOQhEKJ7Fo
OuB6w+C56JwCMEwzp5JixOrzw0JzHt4E3OYtnSm4=
To: yang-doctors@ietf.org
References: <CAM4esxQasY3G6c6j73KLTOFssbNnowRnZxApzAH_yY1qiNBe4A@mail.gmail.com>
<20210202.085617.2109522487602609857.id@4668.se>
From: Ladislav Lhotka <ladislav.lhotka@nic.cz>
Organization: CZ.NIC
Message-ID: <31a7b811-08be-22a4-930c-b23b12ae46aa@nic.cz>
Date: Tue, 2 Feb 2021 09:26:36 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.7.0
MIME-Version: 1.0
In-Reply-To: <20210202.085617.2109522487602609857.id@4668.se>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.102.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/vXj5impDzjGGdAow3Qnk5hFuBQ4>
Subject: Re: [yang-doctors] YANG QUIC-LB model
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>,
<mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>,
<mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 02 Feb 2021 08:26:41 -0000
On 02. 02. 21 8:56, Martin Björklund wrote: > Hi, > > > Martin Duke <martin.h.duke@gmail.com> wrote: >> Hello yang-doctors, >> >> I don't know that this rises to the level of a full review, but the QUIC-LB >> draft (currently adopted by the QUIC WG) is basically a standard for >> configuration of QUIC Load Balancers and servers to work together. After >> much reluctance to take on a format I don't understand, I took a shot at a >> YANG model: >> >> https://github.com/quicwg/load-balancers/blob/yang/draft-ietf-quic-load-balancers.md >> >> (The YANG stuff is in an appendix near the end -- search for #yang-model). >> >> Before we talk about a full review where you labor to understand the data >> items, I'd appreciate an informal quick sanity check that I am doing this >> roughly correctly, as I have zero experience with YANG. > > I downloaded the module and ran it through a YANG compiler, and > started to fix several minor syntactical errors (such as missing ";"), > but then I ran into other issues that made it difficult for me to > guess what you meant. I suggest you ensure that the model compiles > (there are a bunch of compilers available, e.g., pyang, yanglint, ...) > and post it again. > > Some comments though: > > You have: > > list cid-configs { > key "config-rotation-bits"; > > leaf config-rotation-bits { > type uint8 { > range "0..2"; > } > > This means that there can only be max 3 entries in this list. Is that > what you meant? > > > You also have: > > typedef quic-lb-key { > type yang:hex-string { > length 16; > } > } > > The YANG statement "length", when given on a type "string", or derived > from "string", operates on the number of characters in the string. In > this case, you probably what to limit the number of bytes represented > by the hex-string. Unfortunately, it is not possible in standard YANG > 1.1 to do this. An alternative then might be to use the "binary" type, its length restriction is related to the number of octets. Lada > > However, in this particular case it sort-of works, since the length of > the hex-string is 2 * N + 1, where N is the number of bytes. Hence, > the length would be 33. If you do this I suggest you explain this in > the description statement. > > An alternative could be to drop the length statement and only explain > it in the description statement. > >> One other silly question: I have a field whose length depends on other >> fields. Can you give me an example on how to express this correctly? e.g. >> >> leaf foo-length { >> type uint8 >> } >> >> leaf foo { >> type yang:hex-string { >> length foo-length; >> } >> } > > This is possible by using a "must" statement. However, it has the > same problem with the lexical value as above: > > leaf foo { > type yang:hex-string; > must 'string-length(.) = 2 * ../foo-length + 1'; > } > > > > /martin > > _______________________________________________ > yang-doctors mailing list > yang-doctors@ietf.org > https://www.ietf.org/mailman/listinfo/yang-doctors > -- Ladislav Lhotka Head, CZ.NIC Labs PGP Key ID: 0xB8F92B08A9F76C67
- [yang-doctors] YANG QUIC-LB model Martin Duke
- Re: [yang-doctors] YANG QUIC-LB model Ladislav Lhotka
- Re: [yang-doctors] YANG QUIC-LB model Martin Björklund
- Re: [yang-doctors] YANG QUIC-LB model Jan Lindblad
- Re: [yang-doctors] YANG QUIC-LB model Ladislav Lhotka
- Re: [yang-doctors] YANG QUIC-LB model Martin Duke