Re: Blog: YANG Really Takes Off in the Industry

Dean Bogdanovic <deanb@juniper.net> Wed, 03 December 2014 20:57 UTC

Return-Path: <deanb@juniper.net>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7590C1A1EE9 for <ietf@ietfa.amsl.com>; Wed, 3 Dec 2014 12:57:02 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 j44TxtISyd3k for <ietf@ietfa.amsl.com>; Wed, 3 Dec 2014 12:57:00 -0800 (PST)
Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0736.outbound.protection.outlook.com [IPv6:2a01:111:f400:fc10::1:736]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 95EC91A702E for <ietf@ietf.org>; Wed, 3 Dec 2014 12:56:56 -0800 (PST)
Received: from BN1PR05MB424.namprd05.prod.outlook.com (10.141.58.148) by BN1PR05MB422.namprd05.prod.outlook.com (10.141.58.142) with Microsoft SMTP Server (TLS) id 15.1.26.15; Wed, 3 Dec 2014 20:56:33 +0000
Received: from BN1PR05MB424.namprd05.prod.outlook.com ([169.254.8.84]) by BN1PR05MB424.namprd05.prod.outlook.com ([169.254.8.84]) with mapi id 15.01.0026.003; Wed, 3 Dec 2014 20:56:33 +0000
From: Dean Bogdanovic <deanb@juniper.net>
To: Phillip Hallam-Baker <phill@hallambaker.com>
Subject: Re: Blog: YANG Really Takes Off in the Industry
Thread-Topic: Blog: YANG Really Takes Off in the Industry
Thread-Index: AQHQDXWjTnozmsgPSE+qdeYcA4j0zJx7beOAgAABfACAAAZTAIAAAQgAgAAk6wCAAAFRAIAAAiQAgADCkYCAAfqkgA==
Date: Wed, 03 Dec 2014 20:56:33 +0000
Message-ID: <944767E5-A8CE-4185-90F5-D5A6079B9BEA@juniper.net>
References: <54770BA5.5060603@cisco.com> <809EFD2B-A845-46B7-A394-A9C9E5393CD5@piuha.net> <547874D6.1090001@cisco.com> <7890AE32-F7A9-4C32-9C3D-8251E70B1F29@lucidvision.com> <m2sigyhpxc.wl%randy@psg.com> <8BBBDF7F-00A0-44BD-AA64-DA7044D35012@lucidvision.com> <C51AC247-C16D-4452-874E-0D97BDB009EB@juniper.net> <547D0AEA.4020309@gmail.com> <0BFD0B22-EC45-473F-8E7A-7FB608B60E6F@juniper.net> <139D837E-F131-4791-A026-234699A7E617@nominum.com> <4DD04125-EA18-499A-A060-219056E4ABE3@juniper.net> <CAMm+LwhEXF56OgU8hMeYfz+SsDteiv2AVqzZHd3ubbPumyxoHg@mail.gmail.com>
In-Reply-To: <CAMm+LwhEXF56OgU8hMeYfz+SsDteiv2AVqzZHd3ubbPumyxoHg@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.1510)
x-ms-exchange-messagesentrepresentingtype: 1
x-originating-ip: [66.129.241.10]
x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR05MB422;
x-exchange-antispam-report-test: UriScan:;
x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:;SRVR:BN1PR05MB422;
x-forefront-prvs: 0414DF926F
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(377454003)(199003)(189002)(24454002)(51704005)(50226001)(40100003)(50986999)(76176999)(101416001)(36756003)(19580395003)(19580405001)(64706001)(122556002)(20776003)(33656002)(4396001)(21056001)(66066001)(110136001)(97736003)(82746002)(104166001)(120916001)(99396003)(99286002)(105586002)(68736005)(87286001)(62966003)(31966008)(106356001)(95666004)(106116001)(92726001)(92566001)(93886004)(83716003)(88136002)(46102003)(57306001)(77156002)(107046002)(93916002)(87936001)(2656002)(89996001)(86362001)(104396002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR05MB422; H:BN1PR05MB424.namprd05.prod.outlook.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <492DD8E8C22AED4F8367ECA7076B6C8D@namprd05.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
Archived-At: http://mailarchive.ietf.org/arch/msg/ietf/R39GR3fu2bOtSB4_pBKSjIEXNi4
Cc: IETF-Discussion list <ietf@ietf.org>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ietf/>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Dec 2014 20:57:02 -0000

Phillip,

Thank you for bringing us back to the topic and a very good post.

So my original comment was that YANG as language that is being used for modeling.  Models can be done badly in any language, it doesn't matter which one. If Arista has a good model, the representation of that model shouldn't matter if it is in YANG or another language. Using YANG, it gives a more widely understanding then using a proprietary language.

Dean
On Dec 2, 2014, at 9:43 AM, Phillip Hallam-Baker <phill@hallambaker.com> wrote:

> Please, it is not a question of whether YANG is a good or a bad data
> model. Whether it is applicable to a problem depends on what that
> problem is.
> 
> There are two sorts of (useful) schema language for two different problems.
> 
> If your problem is modeling existing data formats then you need an
> expressive schema language that allows the irregularities and
> inconsistencies of the existing formats to be described. XML Schema is
> horribly complex because one of the constraints was that it should be
> a superset of SGML DTDs to allow automatic translation from DTDs to
> Schema.
> 
> I have schemas that describe DNS and RFC822 headers and the like and
> while they are fairly straightforward, they are not 'clean'. There are
> six different ways to encode headers in RFC822 style and DNS RRs are
> much more complicated.
> 
> So if you are trying to model IP headers or the like you are going to
> want an expressive language.
> 
> 
> If what you want to do is to define an application protocol that does
> not need to be backwards compatible with a legacy system then you want
> as little flexibility as possible. Because standards writing is taking
> decisions that don't matter out of the equation.
> 
> This is why ASN.1 is so unfit for purpose. Despite the claim to be
> 'abstract', the data model is full of design choices that only exist
> to micromanage the wire format. The distinction between sets and
> lists, implicit versus explicit tagging etc. etc.
> 
> At the end of the day, every message in an application protocol is
> going to map to an API call or return somewhere in the application
> implementation. We can make that mapping complicated or we can make it
> simple.
> 
> If we have a protocol TimeService with method for finding the time:
> 
> class TimeService {
>    public Status GetTime (out DateTime Now);
>    }
> 
> We can have a schema language that allows fifty different encodings
> for the DateTime object or we can pick one and stick to it. If we are
> using a JSON encoding which is text, we would probably map DateTime
> onto a string and use ISO 8601 or RFC 3339 to describe the encoding.
> 
> If we were dealing with legacy we might have to deal with other forms.
> But the best schema language for writing new apps would not provide
> that flexibility.
> 
> {GetTimeResult : {Now: "2014-01-02T13:10:00Z"}}
> 
> Now the reason I chose this particular example is that time is
> actually a case where encoding does matter because embedded devices
> might not know about the leap seconds which some idiots have managed
> to visit on us:
> 
> class TimeService {
>    public Status GetTime (out DateTime Now, out Int64? ElapsedSeconds);
>    }
> 
> Here we do have a schema issue since JSON integers can be of any size
> while using bignum arithmetic in an API has a severe impact on
> performance and convenience. And in this case we will have bigger
> problems long before the Int64 time rollover occurs.
> 
> Now since the C# syntax for a nullable type (Int64?) doesn't make the
> message signature obvious, I actually use my own private schema
> language:
> 
> Message GetTimeResult
>    DateTime Now
>        Required
>    Integer ElapsedSeconds
>        Bits 64
> 
> 
> YANG is a lot more powerful and flexible than my system. And that is
> why I would not use it for the type of applications I work on. I do
> not want to have the option of encoding the data in more than one way
> because in a new application that is 'bikeshedding'.
> 
> If your problem is dealing with legacy systems and requires modeling
> of statefull interactions then you need that flexibility.
> 
> 
> In summary, there is a place for YANG but it is certainly not the only
> schema language that is useful. There is also a place for XML Schema
> but that place is not describing Web Service protocols. There is also
> a place for simpler schema formats that allow a direct mapping of API
> calls to messages. And there are some schema languages that should
> never be used at all.