Re: [yang-doctors] YANG QUIC-LB model
Jan Lindblad <janl@tail-f.com> Tue, 02 February 2021 08:26 UTC
Return-Path: <janl@tail-f.com>
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 ECFE43A1860
for <yang-doctors@ietfa.amsl.com>; Tue, 2 Feb 2021 00:26:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5
tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 g5NAVI20ENxd for <yang-doctors@ietfa.amsl.com>;
Tue, 2 Feb 2021 00:26:23 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45])
by ietfa.amsl.com (Postfix) with ESMTP id 76D6F3A185F
for <yang-doctors@ietf.org>; Tue, 2 Feb 2021 00:26:23 -0800 (PST)
Received: from [192.168.1.117] (213-67-237-150-no99.tbcn.telia.com
[213.67.237.150])
by mail.tail-f.com (Postfix) with ESMTPSA id 4A1D31AE0473;
Tue, 2 Feb 2021 09:26:21 +0100 (CET)
From: Jan Lindblad <janl@tail-f.com>
Message-Id: <DB8B91F8-8B10-4857-8E41-DA9C3506A0BF@tail-f.com>
Content-Type: multipart/alternative;
boundary="Apple-Mail=_1E607170-ED91-4433-A231-714F1FAF9DB5"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
Date: Tue, 2 Feb 2021 09:26:20 +0100
In-Reply-To: <20210202.085617.2109522487602609857.id@4668.se>
Cc: =?utf-8?Q?Martin_Bj=C3=B6rklund?= <mbj+ietf@4668.se>,
YANG Doctors <yang-doctors@ietf.org>
To: martin.h.duke@gmail.com
References: <CAM4esxQasY3G6c6j73KLTOFssbNnowRnZxApzAH_yY1qiNBe4A@mail.gmail.com>
<20210202.085617.2109522487602609857.id@4668.se>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/LI6AeVsnbr_YXcBwHk045pzOROU>
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:26 -0000
Martin, Actually, I think the string length is "0 | 3 * N - 1" since each byte is encoded as two hex digits and a colon, except the last byte which is just two hex digits, as in "11:22:33:44". But I wonder, why do you need a configured value for the length at all? Would it not suffice that the operator configures the hex-string and let the system figure out the length based on that? I did a quick scan of your module. It has a lot of trivial issues (naming, mandatory, prefix, ...) that are easy to fix, but overall I think you've understood how to do this. Best Regards, /jan > On 2 Feb 2021, at 08:56, Martin Björklund <mbj+ietf@4668.se> wrote: > > Hi, > > > Martin Duke <martin.h.duke@gmail.com <mailto: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. > > 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 <mailto:yang-doctors@ietf.org> > https://www.ietf.org/mailman/listinfo/yang-doctors <https://www.ietf.org/mailman/listinfo/yang-doctors>
- [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