[netmod] Structuring a DHCP module

tom petch <ietfc@btconnect.com> Wed, 20 January 2021 16:41 UTC

Return-Path: <ietfc@btconnect.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 490BA3A03FA for <netmod@ietfa.amsl.com>; Wed, 20 Jan 2021 08:41:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H2=-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=btconnect.onmicrosoft.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 UjeNIzJ0KRWV for <netmod@ietfa.amsl.com>; Wed, 20 Jan 2021 08:41:24 -0800 (PST)
Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60110.outbound.protection.outlook.com [40.107.6.110]) (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 D67053A03F3 for <netmod@ietf.org>; Wed, 20 Jan 2021 08:41:23 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fHk0ma5h7rMde1vbUEHQCL+F1tAoO4wkXQyp0LI8Hv9KIYN0gWNlHqkSfjGjXAJXESguW2pAzbw6q7h4BZ1tnUOno8DtJJcaxQ4iYGLq6P3bNCmh3iejY8GsmyASNy+82BG+mrJEM0HZrUi7Hz4LzUcJ0UKgJl1+/KNCDr0ts5lmFWmZYIfXRHfKvEjghJdH91Zoj/f33E563BqiJydrYlSD0tvgXmuc9nKsfoOSLsJgYlzO0aAZeVkWmhsiG4Aze6EPsnbFTgxaopKLB0sWtGhDlNAqj96d8jeeLnCkTjaPoMi+PaAkZlEld1wti5NtUVOtBqEO6VKb+g6ntYkpZg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3vnoxU/b0uZc0K2/DCmrRcHsb2awWOXZUDJH4yuvRQo=; b=WNACUVW4aVomWEBycJm5gaNRWathncO7z/0pJMjnH8WepAdvzuD79McxlIi+3OJX9f+ZVBxqNBHYAdHA5Ia8/Jf6qUvUFmRore5AzjYUhTqnvYjWgkTQC1MhA3OeLhOtW3W4LWV6B92tPExtVZXnXIF2YG0JZ2fmDnqmmQPlPGE8/e5s8D/wjoL+5joWx1xHoW+EHvMLb8sxqVpLTnOBXnE4J/a1265iJOjtr46XZOGHeRGamY+dF2PWpNn92GiGcCvTKdiPwLM+0Q4cgBXFk0Aq9PuuP1L2ZoRbW00M1tcONL60NLvEHrbKwbqJ8boTlimMoRTtco4LY2drGRoExQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=btconnect.com; dmarc=pass action=none header.from=btconnect.com; dkim=pass header.d=btconnect.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btconnect.onmicrosoft.com; s=selector2-btconnect-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3vnoxU/b0uZc0K2/DCmrRcHsb2awWOXZUDJH4yuvRQo=; b=fX/4c3//zzuSoQ9YI+sDIza1yHOko3jaJyy4TNYZdaWI+651HKF1JLJxvZOlNwgwztHvIYeD8S/07ZJ6ZYkEzPHVgLFLGWBuv2Qg5qOrHn0BA5RJbv6I35bYDgAUYJqZn/LXQPgPFZCmhq0hl/SmnQzx50NqmKT7GjCydlnQN8I=
Received: from (2603:10a6:20b:134::11) by AM6PR07MB5108.eurprd07.prod.outlook.com (2603:10a6:20b:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.5; Wed, 20 Jan 2021 16:41:21 +0000
Received: from AM7PR07MB6248.eurprd07.prod.outlook.com ([fe80::6d46:4f3c:643:4849]) by AM7PR07MB6248.eurprd07.prod.outlook.com ([fe80::6d46:4f3c:643:4849%5]) with mapi id 15.20.3763.014; Wed, 20 Jan 2021 16:41:21 +0000
From: tom petch <ietfc@btconnect.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: Structuring a DHCP module
Thread-Index: AQHW70sVzeGJg/CSikuUFwnormzctQ==
Date: Wed, 20 Jan 2021 16:41:21 +0000
Message-ID: <AM7PR07MB6248BC693F7056249D29CF16A0A20@AM7PR07MB6248.eurprd07.prod.outlook.com>
References: <161100770222.25746.4414271883591983954@ietfa.amsl.com>
In-Reply-To: <161100770222.25746.4414271883591983954@ietfa.amsl.com>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: ietf.org; dkim=none (message not signed) header.d=none;ietf.org; dmarc=none action=none header.from=btconnect.com;
x-originating-ip: [86.146.121.140]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 72550d9d-ee22-49bb-de43-08d8bd6237d6
x-ms-traffictypediagnostic: AM6PR07MB5108:
x-microsoft-antispam-prvs: <AM6PR07MB510877760DD5329E910B288BA0A20@AM6PR07MB5108.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: uoJvzzeLvkf4MlJKz9B1eKF0xtg/1elf1tS/yAVtJWluZTu7hP/d120rSM/dnbhpzCMGYAvfx61OabayoGV9Ok1w4y2lr9qzIEfuN2EOy3NyMdg8AhST4NFrcDC6oiz4xt1NKyxxgoohF+jDzsOgJcdZd7lG/ZslLIhCuBsncDfFxPOkjHs64KOFHnk/DeKPy4E0yWwr/nIR8OjfwGwOJrGpBA//FjBBmalyO539Hb6kJ80yaYlp9MwLkIw84XL/G13P8MvpgJOwBXIj1aH3F0R2ya4A4g5gU80ZrOAmkaluBzwwZTscRuha7/RZTvS0e8kEbJdj9Ay5vZ6PrLlC8iqWbp+QnnRf/Tb2llx4jZrvc5cZfhfsEOTUEoroudak6644eE7m0bExcezweRAGSWF4ip98yspQZVApo4P1UcMdEwkEJ4k8Q47xsJmpZXJu
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR07MB6248.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(136003)(39860400002)(366004)(376002)(346002)(6916009)(4326008)(52536014)(66946007)(2906002)(76116006)(7696005)(91956017)(316002)(5660300002)(66476007)(66556008)(33656002)(66446008)(64756008)(54906003)(55016002)(83380400001)(186003)(26005)(478600001)(71200400001)(9686003)(3480700007)(53546011)(6506007)(8676002)(86362001)(8936002)(518174003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: k320etwqmd7jntIM6Xytx1eSFK7xA1bVThIhwW77uoZtW/ex9cXuXD2CyrqBQM6bSPYsmDu8V/DRqDk+76QgvZZ5aCccSx2pJQpddIP7LwPMSxlarzmXRs1wLfh3Q+15NsDhAaI9l08JBsQf2TkPtpm1H/P03CfizebuLJZ7wYp9nZ4bYvzLMNKATQOLSqCE6gHNzQvGdwWxRzuQoO+mIXg6ia0CTrJLFEzAFZCS78cX1yveGK5PDDM/eO5uXN3KSr5ECWL4znxCHjhA4/bn6maPwMU5K9tiFlwREfWpo+DjuUjfuXj+3WAMdAOk62TPghr/tzY6qeq/MwaiSIPyF5VIqMbJOx1zLAy0KFVRhh3ipt5EEI0FRBKZ6VimUD/tuQwWb8+45NoTHVpVQV+hbDuSnvhqDKFqtyPR7CsetEWGDAlvJRYWhciotyktqY1nAeX4d+8eEKzkvkHNQq/hWhUArUXs4saNDwWgI9CE0tc/bFyfBUGHNiClAXWmbnqGy8j1bfHcS6QhR4EZfiGf7cM8QoEM5uw76ngVj2KlPDrL63D/A4nEIfWschbLdzT1b822VJNa/jwveFt0+lAY6v47L0HoMBrl+i5n0OyGUi2tXs9mB6NRXjeNHZQ5thfDgrmeL5wz5QmoLZO99EkUiXSNDYCiumpK66iQR3kIrVxfrXiRtmb5AMes48VaBbQv+bYbLNAyGWSc1aYKjHRtKOH9Jt8tC62mFm44MMQQmYAGjRxSYRTUDeN4xjO8xoonstYvBEU4ZQqp1Jo4wEgb1U8HL0GOPuwr0akDaOYqixiODQqQmr7WxCWlnEoj21V6R+l96ARHSRC6n5oKlRo7xeha6fOZIZoOoVTNnW1s8tY4bpcrSk1u17MiCfp9RfQoJIs33cwZ5AAlIaStSPi4KguWO5vxu2C82lIxdyaSvLDp+JQP1AfQRcTIZr1NvgkDaq6J2dohnI/LnZI0WP/VFLUKq6t1oe7qL5pxQou7WquaLApcpz4D+pKnfMPA7Xoc+IEirAVWHnjuqSoA9wRDPD5dkagkG3iVpQQnVTRanM5ORKWH4++wU4cAOy6pFSc1
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: btconnect.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM7PR07MB6248.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 72550d9d-ee22-49bb-de43-08d8bd6237d6
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2021 16:41:21.2555 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: cf8853ed-96e5-465b-9185-806bfe185e30
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: UMfjbtLHlmJSZIfTqLCJ1BXPjRfOYCPIZCAdfhbxRRwrp55HvPBvzJrKEKwnlL2OLuC5ETJjctkZaVSusQUIfA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR07MB5108
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/CpzB2f8ebtoYbYBnh58gLOGrHCI>
Subject: [netmod] Structuring a DHCP module
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jan 2021 16:41:26 -0000

Juergen, Lada, Martin, Andy

I wonder if one of you, or perhaps another on this list, would be willing to give advice on the 
structuring of  the YANG module for DHCP.  It has been revised and restructured several times and, to me, is not progressing.

It models three roles - client, server, relay - and a dozen optional function which can appear in one or more roles.  A node will likely have only one role but may have many options.

There are, at present, seven modules
server which defines a server identity  based on common identity inter alia
relay which defines relay identity ditto
client which defines client identity ditto
server options which has groupings for each option for a server
client options which has groupings for each option for a relay
relay options which has groupings for each option for a client
common which defines the common identity inter alia
Since options are common across roles, some groupings are replicated in the three options modules.  Three separate option modules were created to avoid problems with imports as Ian explains below.  The I-D is draft-ietf-dhc-dhcpv6-yang

My take is that one module is best, using 'when' or if-feature to select, which is what I see with OSPF, PCE, TCP, IGMP and almost everything else but am struggling to convince others, especially  the author Ian.  [IF] in the e-mail extract below

I suggested asking a YANG Doctor, NOT to look at the module but rather to advise on a structure given the requirements to which Ian said that he had not had much joy with YANG Doctors.  I append our most recent exchange in which he responds to my query as to why there are seven modules; formatting is a bit of a mess I am afraid.  The posts are to the DHCWG mail list.

Any advice appreciated even if it is that Ian is on just the right track!

Tom Petch

On 19/01/2021 11:25, tom petch wrote:
> ________________________________________
> From: dhcwg <dhcwg-bounces@ietf.org> on behalf of ianfarrer@gmx.com <ianfarrer@gmx.com>
> Sent: 19 January 2021 07:37
>
> Thanks for your comments. Please see inline below.
>
> Ian
>
> On 14. Jan 2021, at 13:40, t petch <ietfa@btconnect.com<mailto:ietfa@btconnect.com>> wrote:
>
> Ian
>
> I do not understand this I-D; I have tracked it for a number of years and my understanding of it is diminishing.
>
> Currently, it is seven YANG modules: why?
>
> [if - The separation into client/server/relay, and DHCP options has been in the draft since -05 and the changes were presented and discussed at IETF101 - I’ve described the reasoning for this split in the next answer. Beyond that, the common module was added to avoid (well reduce as you point out below) duplication.
>
> The separation of the option modules came at a later stage based on import dependencies of a single options module. When the options module imports the client/server/relay modules so it can augment the relevant module based on identity, an implementation also needs to import these modules and will declare them in it’s capabilities as available even though it doesn’t implement them. Dividing the options modules avoids the need for deviations.
>
> Even though there are 7 modules defined here, the likely hood is that an element implementation would require 3 modules to be implemented (e.g. client, common and client options).]
>
> [tp] Other WG have models with multiple roles and many options and have a single YANG module, using the features of YANG to tailor the module to different configurations.
>
> [if - It’s not really tailoring the module to different configurations, they are for the most part separate functional elements in the network with any device only implementing one of the client, relay or server functions.
>
> However, even in the case that a device is both a server and a client (e.g. a home gateway with a client on the WAN and a server on the LAN), the likelihood is that these will be done using different software implementations, so having separate modules for server and client offers implementation flexibility.
>
> In the case of a monolithic module with the relevant client/relay/server functionality enabled by features, the module would do nothing unless one or more of the features was enabled, and Is unlikely that you’d ever enable more than one. Is this approach used by other WGs? Could you point me to some some examples as I've only seen features been used as relatively small optional extensions used when the bulk of the nodes are common?]

[tp]
Ian

Almost all the YANG models I know of are single module.  For example,
draft-ietf-ospf-yang supports two versions modelled as identity and 28 
options modelled as features.

draft-ietf-tcpm-yang supports client and server as containers with 
if-feature and has other features as well

draft-ietf-pim-igmp-mld-yang supports five versions of two protocol 
using identity

draft-pce-pcep-yang offers the roles of pcc or pce or both using typedef.

And so on and so on.  if-feature, when and suchlike provide the 
necessary customisation.

I think that your problems with options are because the identity are 
defined in the wrong place.  The base, the common module (or part of the 
one and only module) should define what is common, what everyone needs; 
if there are three roles and a dozen options, than that is where they 
need to be defined.

Then there can be an object which is configured with the roles of a 
particular box, client or server or relay, or if required, a combination 
of the there - simpler if that is out of scope as you suggest.

My starting point would be a dhc container with a leaf for a role and then 
containers for client, relay, server, added by augment and controlled by 
when pointing at the role.

I will post something to the netmod WG list - there are lots of people 
there with greater exposure than mine who can give better guidance than I.

Tom Petch

> Here you have modelled the options as YANG grouping. The intent of a grouping is to provide a block of statements that can be reused so avoiding duplication with the attendant problems.  Here you have the same grouping in triplicate in three different YANG modules which seems to me to be the antithesis of a grouping.
>
> [If - We could move the option definitions for "status-code-option-group” (client, server, relay) and “rapid-commit-option-group, vendor-specific-information-option-group; reconfigure-accept-option-group” (client, server) into the common module to resolve the duplication. I didn’t do this previously as the intention was to keep options definitions in the options modules for consistency, but it  would be simple to change. ]
>
> [tp] Likewise I find the specification of server v client v relay unusual.
>
> [If - A similar approach for separated client/server modules is also used in RFC8676, where the client and server have discrete function, as with DHCP.]
>
> [tp]I wonder if it is worth consulting a YANG doctor, NOT to show them the YANG and invite comments, rather outline in an abstract way what it is you want to model and see what they suggest; that might well be a single YANG module.
>
> [if - Yes, I’d be happy to. Is there someone that you have in mind (I’ve not had much luck with getting YANG doctor input outside of the formal review process in the past)?. I’m not opposed to changing the way that the modules are structured on principal, I do however, think that the separation by functional element is logical and simpler for implementers, and I would like to know what the benefits of a single module (or other structure) might be.]
>
> [tp]I do have quite a number of detailed comments but do not think them worth making until the I-D seems to me more stable.
>
> [if - It’d be great if you could supply them as well so I can start going though them and fixing what’s currently fixable in parallel to the discussion above.]
>
> Tom Petch
>
> On 07/01/2021 16:10, ianfarrer@gmx.com<mailto:ianfarrer@gmx.com> wrote:
> Hi Tom,
>