[netmod] YANG model for BGP extended communities

"Jason Sterne (Nokia)" <jason.sterne@nokia.com> Thu, 13 April 2023 21:16 UTC

Return-Path: <jason.sterne@nokia.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 C2CC8C152A16 for <netmod@ietfa.amsl.com>; Thu, 13 Apr 2023 14:16:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.085
X-Spam-Level:
X-Spam-Status: No, score=-2.085 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, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_NONE=0.001, T_SPF_HELO_TEMPERROR=0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=nokia.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BGGc3o61M0jO for <netmod@ietfa.amsl.com>; Thu, 13 Apr 2023 14:16:41 -0700 (PDT)
Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20723.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::723]) (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 73514C152A0A for <netmod@ietf.org>; Thu, 13 Apr 2023 14:16:41 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LMsinwwNwUO2M0D8GwojFVyZCv+ovTxQ61P32JP09eZ11RFDNfoJA0IHT4AB7Mpl9WXYclyKI5rX0a4zUXsCFw3vUgBWkLdy1NwS+pvogH3AjWFrKtFRXM/HFJ6iHcXqic4zgyE9bDE4BP1jq/Ds5rw2tfFIzpe6b4reKDye8b60td/EcKORTpp3WHCgymuhJ99P6D2A5qbSpRxPGENWEkvp4gfh3AQVJUgdD9T6iwKyCqhLT9FJTnYE1DSoXHTpdUlLYDDPv0MHb3pGK4ItyZdZKYmoLW1xj1tk5zqi+1Ldz+5W2PcOpqMhlc66hHAH+QyDfYF93jsbI37BmF3OEA==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j8mwFnVrBFQ+3qAPfvi80r0RrxBEHeNCndqw4OWHDMk=; b=gnrb+QNlna07XY5Ql6puiGMSbNqCsxr6/LO3zRBrQZKHHNNb9KjmBUcDs1s5ddGvKxiATaC9801mRWgaS/6rdCrePvR+v/7qakYw+h7u8ObAcv90QKSyRygbsstcMWsjQufppeV8KHyhEDJMZSJlS8qMoH0Jiz8Yt83nDkQF2bYYvsYMGuqqIM8auvjq7xUrjMi0mrQoUtuxy1jInSRAIDXh/v9xu7pVrJ/Ln3jt+AL2L266iUucmS6idNj21puR51Rb+tKZmWqlkXqif1QST44Ky2lrLGMMkTio/2+tjfO0PbX81hOyy0Tb6PeVCrYGm09DGfqTOsRAC9UTzSnJEA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j8mwFnVrBFQ+3qAPfvi80r0RrxBEHeNCndqw4OWHDMk=; b=tTIPJmA8cxkc74c5nAd/I9yyVix52ypMLn3xZEKBVjPR/nSNam0YLkrrcg/k2uidS3TPYe8AgQ04wkrSI9Atl9Zu9fWltgw6RZsmQGTxEYrih7EDXO2GTzLoOEe0pCG4ekCbboy52aQYrwZ59QmsLMbA2hBFWBAR48WC11OzNusrlI+VUKhFEfIomMFzXqa8l/4TamjzGNlOIBIexJv/0dRqcaQ1THzqS53c8IRyvBFytAMiLvOqiHrOuUMwQu4rPIUnFYh6XzaDQtJuxNw1gmmbMT4h2vRhLk88t6JzVLgaF5abBhioQHtSVKjzvJfITpmckXHqrfesV3cD7BpP7Q==
Received: from DM6PR08MB5084.namprd08.prod.outlook.com (2603:10b6:5:41::29) by MN2PR08MB6399.namprd08.prod.outlook.com (2603:10b6:208:1b2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 21:16:36 +0000
Received: from DM6PR08MB5084.namprd08.prod.outlook.com ([fe80::6e5c:8f58:eada:3d49]) by DM6PR08MB5084.namprd08.prod.outlook.com ([fe80::6e5c:8f58:eada:3d49%3]) with mapi id 15.20.6277.038; Thu, 13 Apr 2023 21:16:36 +0000
From: "Jason Sterne (Nokia)" <jason.sterne@nokia.com>
To: Jeffrey Haas <jhaas@pfrc.org>
CC: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: YANG model for BGP extended communities
Thread-Index: AQHZbk06OyN1jiV/MU6+wz9HLLHXVg==
Date: Thu, 13 Apr 2023 21:16:36 +0000
Message-ID: <DM6PR08MB5084DC8B335F8F40689B2A629B989@DM6PR08MB5084.namprd08.prod.outlook.com>
References: <167510951913.30783.6878062588510633543@ietfa.amsl.com> <70DA36EA-F90A-4800-A4C8-0DDCF6FFD845@pfrc.org> <0F8C57E5-F7F8-4383-A9BE-E98D2C6A6E42@pfrc.org> <DM6PR08MB50841A7B84BA1D84AC0B57809B9B9@DM6PR08MB5084.namprd08.prod.outlook.com> <DM6PR08MB5084E9656CA7C388D2A229779B9B9@DM6PR08MB5084.namprd08.prod.outlook.com> <A3EFA144-664D-4F67-8565-111EF650CE0B@pfrc.org> <DM6PR08MB508452FBF0266BCDEC68464F9B989@DM6PR08MB5084.namprd08.prod.outlook.com> <44DB67B7-D1D9-4A4D-835B-8182491E803E@pfrc.org>
In-Reply-To: <44DB67B7-D1D9-4A4D-835B-8182491E803E@pfrc.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DM6PR08MB5084:EE_|MN2PR08MB6399:EE_
x-ms-office365-filtering-correlation-id: 30fcb683-28eb-449d-161a-08db3c645d54
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: fBDJfsFVNavgv33W0d+nXd97NK0+ZBiVuH8ma6hH0Q/TgPqoVwm2Aw7YKsRJiLHxUP4jTpjoF+ZGICjaoJrK0QMSUhV3nH/zIUExC0TO7ERxD6gn5ai/k4pC33uNaqAdgZjX1k0mUhel8+2UYTxtGJsMF1Wf0mRje3/GUYY9ihMnrMKaHVRflWVCybkHqK50V4zFLGAmp271U540TF8ekv1qd/6V6cExaVv/qHaryzHB5V3uRJTwxn2+idJpxNDlCgmz9F0veYs2Iu/Bw7B1ip4Mh2ZiAk6FwFwOXu/bXPnjBGod9nV9FK/phqfJBMclcT7tbR/GpIeXuQM9ur0Pm1AZFTlYE59RUiUCTCC6OhAKuhKYpjjxAPhwz9uM+h4uxlKH15F99R8RELZvXLC1VDcFp81xvQ7Iau2utSW4aqiaI6Yv5q8EOLxkhDCBJBTP7vZ8PhC6v/qkxiavE3ZCyCjRi6qu67RIovH8DDFqkpQ9z/jRAb0+DbwI76LJ/rolMlqfg4pScsDSsKotGh6Aiv8+eCkEpeN3Uo4esAaUVVDveBeGXzMeN5Jh8rmJMbH3i3+RSwngfEGRJTKbQUyOKVnfrR+IL8MZu/d2VgFeb2M=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR08MB5084.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(451199021)(9686003)(53546011)(26005)(6506007)(55016003)(186003)(66899021)(83380400001)(966005)(71200400001)(7696005)(5660300002)(33656002)(52536014)(41300700001)(82960400001)(38100700002)(316002)(8676002)(8936002)(9326002)(86362001)(38070700005)(122000001)(478600001)(66946007)(66446008)(64756008)(76116006)(4326008)(6916009)(66476007)(66556008)(2906002)(21615005)(166002); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 0TUFf8tEIhpJCLzy8Bn5rPvFgkQSqbFpWMVvYqxj3kjlawGTfB/+2tqfLDpwOIJy41yk9/DxX/mIbzJ19VVgTEBvfYX7GCQAFTtk8mmp5HN2EC/r3SrpateKNBHtlg9PCqXhMa4qEa5GD6WiA2SGDTGbLq9HyO/fQ1yvqcr4yVHpn3/opocSlBst7rlfla2MUmEp0E08/mXOWt+Soxu/GTGj3E9sHugfJFv6xj9fVuo3NjIjKwmm4l6ZBeS3BhZch7rjQUgCZCuzPAzKB0qK5mbPIFLADHEZ9iiMEgOmbJ5zAZXc5i89XmukaQLUgKECpJ2mS1rB7LflnrFVsp779Glbh3vk5lox591OGA3o20MspM83H20gjBVbB98Led+KjW0b0onS0E90/klgwSL/xXwBvjbt26GzUhm7NgI9c2KVopMrd3JzH5A+IloKcrXz8hNmRcqkfgwEi/jcj0XxShgN1c2l+BIODGDnUpTwvbh/P8PhbxSJMMtCr6cwsSPl9NGC4I/0fCIEqokc02BmZvA4fNEXI+KV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="_000_DM6PR08MB5084DC8B335F8F40689B2A629B989DM6PR08MB5084namp_"
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM6PR08MB5084.namprd08.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 30fcb683-28eb-449d-161a-08db3c645d54
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2023 21:16:36.3224 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: vAHpnYA3sBunsVw24OEu8YYdnAr6QFkbun43D9X3EHK7qkAOwglbwNexL5xVKRQaQYvbZbMBa7omeNR0OW27/w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR08MB6399
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/m00qc6-clVZvsNk54CTi1woxHaQ>
Subject: [netmod] YANG model for BGP extended communities
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
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: Thu, 13 Apr 2023 21:16:45 -0000

Hi Jeff,

I’m branching off a separate thread for the extended communities discussion. Is this a good one from the draft for discussion?

  /* BGP Extended Community Types. */

  typedef bgp-ext-community-type {
    type union {
      type string {
        pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|'
              + '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):'
              + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|'
              + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[0-9])';
        /*
         * description
         *   "Type 0x00, Sub-Type 0x02: Route-Target
         *    route-target:(ASN):(local-admin)
         *    2 octets global administrator and 4 octets local
         *    administrator.";
         * reference
         *   "RFC 4360: BGP Extended Communities Attribute,
         *    Section 4.";
         */
      }

…snip…

      type string {
        pattern 'route\-origin:'
              + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|'
              + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[0-9])'
              + '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|'
              + '[1-9][0-9]{1,4}|[0-9])';
        /*
         * description
         *   "Type 0x02, Sub-Type 0x03: Route-Origin
         *    route-origin:(ASN):(local-admin)
         *    4 octets global administrator and 2 octets local
         *    administrator.";
         * reference
         *   "RFC 5668: 4-Octet AS Specific BGP Extended Community,
         *    Section 4.";
         */
      }

      type string {
        // raw with 8 octets
        pattern 'raw:'
             + '([0-9A-Fa-f][0-9A-Fa-f]:){7}'
             + '[0-9A-Fa-f][0-9A-Fa-f]';
      }
    }
    description
      "Type definition for extended community attributes.
       It includes a way to specify a 'raw' string that
       is followed by 8 bytes of octet string to support
       new and experimental type definitions.";
    reference
      "RFC 4360: BGP Extended Communities Attribute.";
  }

Things can get tricky with unions in YANG, especially if things overlap. Are there values that one could configure as “raw:…” that overlap with the other union members? The raw value and the “other value” (that overlaps) would be considered completely different & separate tokens in YANG.  In other words, it isn’t really valid to set a “raw” value in a NETCONF server, but then fetch the configuration and see a different value (i.e. auto converted by the server to the known non-raw equivalent).

A more intuitive example for me is thinking about TCP ports. This is an example of a potentially problematic union:
               Union {
                   Type uint16;
                   Type enumeration {
                       Enum ssh {
                           Value 22;  <- could actually be any other number (not significant)
                       }
               }
YANG sees the values “ssh” and “22” as completely separate independent values/tokens.

If the typedef was used for state (config false) then it gets tricky to decide what to return for the value of a leaf of this type (when the port is 22). A human user sees 22 and ssh as the same thing, but YANG doesn’t.

Maybe this issue doesn’t turn out to be a problem for this particular extended community typedef but I’m not sure (implementors could make a mistake with it).

Jason

From: Jeffrey Haas <jhaas@pfrc.org>
Sent: Thursday, April 13, 2023 4:44 PM
To: Jason Sterne (Nokia) <jason.sterne@nokia.com>
Cc: netmod@ietf.org
Subject: Re: Unknown bits - backwards compatibility



I wish to point you and others concerned on these points to the BGP YANG modeling for Extended Communities, which will have these problems in a different flavor: Known communities will render via the typedefs, unknown will render using the prefix 'raw'.  (See typedef bgp-ext-community-type.)  This headache is already a consideration in every BGP implementation that deals with extended communities in changing meaning.
[>>JTS:] Can you point me to a repository or RFC where I can see this? I’m not familiar with where this YANG work is being done.

Sorry for not including the URL.  This document went to WGLC for IDR a few days ago.  We'll be asking (yet yet yet again) for YANG doctor review.
https://www.ietf.org/archive/id/draft-ietf-idr-bgp-model-16.html

You'll find the typedef issue for extended communities in there, and also the field for unknown bits in the operational state that is the genesis for this conversation.


-- Jeff