Internet DRAFT - draft-cptb-grow-bmp-yang

draft-cptb-grow-bmp-yang







GROW                                                          C. Cardona
Internet-Draft                                                P. Lucente
Intended status: Standards Track                                     NTT
Expires: 27 April 2023                                           T. Graf
                                                                Swisscom
                                                               B. Claise
                                                                  Huawei
                                                         24 October 2022


                            BMP YANG Module
                      draft-cptb-grow-bmp-yang-04

Abstract

   This document proposes a YANG module for BMP (BGP Monitoring
   Protocol) configuration and monitoring.  A complementary RPC triggers
   a refresh of the session of a BMP station.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on 27 April 2023.

Copyright Notice

   Copyright (c) 2022 IETF Trust and the persons identified as the
   document authors.  All rights reserved.











Cardona, et al.           Expires 27 April 2023                 [Page 1]

Internet-Draft               BMP YANG Module                October 2022


   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents (https://trustee.ietf.org/
   license-info) in effect on the date of publication of this document.
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.  Code Components
   extracted from this document must include Revised BSD License text as
   described in Section 4.e of the Trust Legal Provisions and are
   provided without warranty as described in the Revised BSD License.

Table of Contents

   1.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   3.  Model summary . . . . . . . . . . . . . . . . . . . . . . . .   3
   4.  Base ietf-bmp YANG module . . . . . . . . . . . . . . . . . .   3
     4.1.  Tree View . . . . . . . . . . . . . . . . . . . . . . . .   3
     4.2.  YANG Module . . . . . . . . . . . . . . . . . . . . . . .   6
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  22
   6.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  22
     6.1.  The IETF XML Registry . . . . . . . . . . . . . . . . . .  22
     6.2.  The YANG Module Name Registration . . . . . . . . . . . .  22
   7.  Open Issues . . . . . . . . . . . . . . . . . . . . . . . . .  22
   8.  Normative References  . . . . . . . . . . . . . . . . . . . .  23
   Appendix A.  Examples . . . . . . . . . . . . . . . . . . . . . .  25
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  26
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  26

1.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

   Routing Information Bases, peers, monitoring stations are defined in
   [RFC7854].

2.  Introduction

   This document specifies a YANG module for configuring and monitoring
   the BGP Monitoring Protocol (BMP) [RFC7854].  The model provides
   parameters for defining BMP monitoring stations, the selection of the
   BGP Routing Information Bases (RIBs), provides operational metrics
   and enables to reset BMP monitoring sessions.






Cardona, et al.           Expires 27 April 2023                 [Page 2]

Internet-Draft               BMP YANG Module                October 2022


3.  Model summary

   The BMP YANG model provides the methods for managing BMP monitoring
   stations.  It includes:

   *  Connectivity parameters, including station IP address and
      destination port.

   *  BMP session parameters, such as defining the BMP initiation
      message or the interval for statistics messages.

   *  BGP Data sources.  The model requires the explicit configuration
      of the Network instance, RIBs and address family to send to each
      monitoring station.  For Adj-RIB-in and Adj-RIB-out, both post and
      pre policy, the model also requires to reference the peer.  In
      those RIBs, the value "all_peers" can be used if the operators
      desire to receive data of all peers.

   *  Per BMP station status and statistics, such as established status,
      number of route-monitoring messages, number of route-mirroring
      messages, number of peer-down and peer-up messages, number of
      initiation messages.

   *  BMP session reset RPC action.

4.  Base ietf-bmp YANG module

4.1.  Tree View

   The following tree diagram provides an overview of the ietf-bmp.yang
   data model.

   =============== NOTE: '\\' line wrapping per RFC 8792 ===============

   module: ietf-bmp
     +--rw bmp
        +--rw stations
           +--rw station* [id]
           |  +--rw id               string
           |  +--rw connection
           |  |  +--rw (passive-or-active)?
           |  |  |  +--:(active)
           |  |  |  |  +--rw active
           |  |  |  |     +--rw network-instance    leafref
           |  |  |  |     +--rw station-address     inet:ip-address
           |  |  |  |     +--rw station-port        inet:port-number
           |  |  |  |     +--rw local-address       inet:ip-address
           |  |  |  |     +--rw local-port?         inet:port-number



Cardona, et al.           Expires 27 April 2023                 [Page 3]

Internet-Draft               BMP YANG Module                October 2022


           |  |  |  +--:(passive)
           |  |  |     +--rw passive
           |  |  |        +--rw network-instance    leafref
           |  |  |        +--rw station-address     inet:ip-address
           |  |  |        +--rw station-port?       inet:port-number
           |  |  |        +--rw local-address?      inet:ip-address
           |  |  |        +--rw local-port?         inet:port-number
           |  |  +--rw maximum-segment-size?    uint16
           |  |  +--rw mtu-discovery?           boolean
           |  |  +--rw keepalives! {keepalives-supported}?
           |  |  |  +--rw idle-time         uint16
           |  |  |  +--rw max-probes        uint16
           |  |  |  +--rw probe-interval    uint16
           |  |  +--rw secure-session-enable?   boolean
           |  |  +--rw secure-session
           |  |  |  +--rw (authentication)?
           |  |  |     +--:(ao)
           |  |  |     |  +--rw ao-keychain?
           |  |  |     |          key-chain:key-chain-ref
           |  |  |     +--:(md5)
           |  |  |        +--rw md5-keychain?
           |  |  |                key-chain:key-chain-ref
           |  |  +--rw initial-delay?           uint32
           |  |  +--rw backoff
           |  |     +--rw (backoff-options)?
           |  |        +--:(simple-exponential)
           |  |           +--rw simple-exponential
           |  |              +--rw initial-backoff?   uint32
           |  |              +--rw maximum-backoff?   uint32
           |  +--rw bmp-session
           |  |  +--rw initiation-message?    string
           |  |  +--rw statistics-interval?   uint32
           |  +--rw bmp-sources
           |  |  +--rw bmp-route-monitoring
           |  |     +--rw network-instances
           |  |        +--rw network-instance* [network-instance-id]
           |  |           +--rw network-instance-id    union
           |  |           +--rw adj-rib-in-pre
           |  |           |  +--rw enabled?            boolean
           |  |           |  +--rw address-families
           |  |           |     +--rw address-family* [name]
           |  |           |        +--rw name     leafref
           |  |           |        +--rw peers
           |  |           |           +--rw peer* [peer-id]
           |  |           |              +--rw peer-id    union
           |  |           |              +--rw filters
           |  |           |                 +--rw policy-filter
           |  |           |                    +--rw export-policy*    \



Cardona, et al.           Expires 27 April 2023                 [Page 4]

Internet-Draft               BMP YANG Module                October 2022


   \       leafref
           |  |           |                    +--rw default-export-pol\
   \icy?
           |  |           |                            rt-pol:default-p\
   \olicy-type
           |  |           +--rw adj-rib-in-post
           |  |           |  +--rw enabled?            boolean
           |  |           |  +--rw address-families
           |  |           |     +--rw address-family* [name]
           |  |           |        +--rw name     leafref
           |  |           |        +--rw peers
           |  |           |           +--rw peer* [peer-id]
           |  |           |              +--rw peer-id    union
           |  |           |              +--rw filters
           |  |           |                 +--rw policy-filter
           |  |           |                    +--rw export-policy*    \
   \       leafref
           |  |           |                    +--rw default-export-pol\
   \icy?
           |  |           |                            rt-pol:default-p\
   \olicy-type
           |  |           +--rw local-rib
           |  |           |  +--rw enabled?            boolean
           |  |           |  +--rw address-families
           |  |           |     +--rw address-family*
           |  |           |             [address-family-id]
           |  |           |        +--rw address-family-id
           |  |           |        |       identityref
           |  |           |        +--rw filters
           |  |           |           +--rw policy-filter
           |  |           |              +--rw export-policy*          \
   \ leafref
           |  |           |              +--rw default-export-policy?
           |  |           |                      rt-pol:default-policy-\
   \type
           |  |           +--rw adj-rib-out-pre
           |  |           |  +--rw enabled?            boolean
           |  |           |  +--rw address-families
           |  |           |     +--rw address-family* [name]
           |  |           |        +--rw name     leafref
           |  |           |        +--rw peers
           |  |           |           +--rw peer* [peer-id]
           |  |           |              +--rw peer-id    union
           |  |           |              +--rw filters
           |  |           |                 +--rw policy-filter
           |  |           |                    +--rw export-policy*    \
   \       leafref
           |  |           |                    +--rw default-export-pol\



Cardona, et al.           Expires 27 April 2023                 [Page 5]

Internet-Draft               BMP YANG Module                October 2022


   \icy?
           |  |           |                            rt-pol:default-p\
   \olicy-type
           |  |           +--rw adj-rib-out-post
           |  |              +--rw enabled?            boolean
           |  |              +--rw address-families
           |  |                 +--rw address-family* [name]
           |  |                    +--rw name     leafref
           |  |                    +--rw peers
           |  |                       +--rw peer* [peer-id]
           |  |                          +--rw peer-id    union
           |  |                          +--rw filters
           |  |                             +--rw policy-filter
           |  |                                +--rw export-policy*    \
   \       leafref
           |  |                                +--rw default-export-pol\
   \icy?
           |  |                                        rt-pol:default-p\
   \olicy-type
           |  +--rw session-stats
           |     +--rw discontinuity-time
           |     |       yang:date-and-time
           |     +--ro established-session?               boolean
           |     +--ro total-route-monitoring-messages?   uint64
           |     +--ro total-statistics-messages?         uint64
           |     +--ro total-peer-down-messages?          uint64
           |     +--ro total-peer-up-messages?            uint64
           |     +--ro total-initiation-messages?         uint64
           |     +--ro total-route-mirroring-messages?    uint64
           +--rw actions
              +---x session-reset
                 +--ro output
                    +--ro (outcome)?
                       +--:(success)
                       |  +--ro success?   empty
                       +--:(failure)
                          +--ro failure?   string

4.2.  YANG Module

   <CODE BEGINS> file "ietf-bmp@2022-01-27.yang"

   module ietf-bmp {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-bmp";
     prefix bmp;

     import ietf-yang-types {



Cardona, et al.           Expires 27 April 2023                 [Page 6]

Internet-Draft               BMP YANG Module                October 2022


        prefix yang;
      }

     import ietf-inet-types {
       prefix inet;
       reference
         "RFC 6991: Common YANG Data Types";
     }
     import ietf-routing {
       prefix rt;
       reference
         "RFC 8349, A YANG Data Model for Routing Management
          (NMDA Version).";
     }

     import ietf-bgp-types {
       prefix bt;
       reference
         "RFC AAAA: BGP YANG module for Service Provider Network.
          RFC-EDITOR: please update XXX with the RFC ID assigned
          to I-D.ietf-idr-bgp-model";
     }

     import ietf-bgp {
       prefix bgp;
       reference
         "RFC BBBB: BGP YANG module for Service Provider Network.
          RFC-EDITOR: please update XXX with the RFC ID assigned
          to I-D.ietf-idr-bgp-model";
     }

     import ietf-netconf-acm {
       prefix nacm;
       reference
         "RFC 8341: Network Configuration Access Control Model";
     }

     import ietf-tcp-common {
       prefix "tcpcmn";
       reference
         "I-D.ietf-netconf-tcp-client-server: YANG Groupings for TCP
          Clients and TCP Servers.";
     }

     import ietf-network-instance {
       prefix "ni";
       reference
       "RFC 8529: YANG Data Model for Network Instances";



Cardona, et al.           Expires 27 April 2023                 [Page 7]

Internet-Draft               BMP YANG Module                October 2022


     }

     import ietf-routing-policy {
       prefix "rt-pol";
       reference
       "RFC 9067: A YANG Data Model for Routing Policy";

     }

     import ietf-key-chain {
          prefix key-chain;
          reference
            "RFC 8177: YANG Key Chain.";
     }

     organization
       "IETF GROW Working Group";
     contact
       "WG Web:   <https://datatracker.ietf.org/wg/grow/>
        WG List:  <mailto:grow@ietf.org>

        Author:  Camilo Cardona
           <mailto:camilo@ntt.net>

        Author:  Paolo Lucente
           <mailto:cpaolo@ntt.net>

        Author:  Thomas Graf
           <mailto:thomas.graf@swisscom.com>

        Author:  Benoit Claise
           <mailto:benoit.claise@huawei.com>";
     description
       "This module specifies a structure for BMP
        (BGP Monitoring Protocol) configuration and monitoring.

        The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
        'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
        'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
        are to be interpreted as described in BCP 14 (RFC 2119)
        (RFC 8174) when, and only when, they appear in all
        capitals, as shown here.

        Copyright (c) 2022 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject to



Cardona, et al.           Expires 27 April 2023                 [Page 8]

Internet-Draft               BMP YANG Module                October 2022


        the license terms contained in, the Revised BSD License set
        forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (https://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC 9196
        (https://www.rfc-editor.org/info/rfc9196); see the RFC itself
        for full legal notices.";

     revision 2022-10-18 {
       description
         "initial version";
       reference
         "RFC YYYY: BMP YANG Module
         RFC-EDITOR: please update YYYY with this RFC ID";
     }

     identity bmp-peer-types-idty {
       description "Enum values for peer selection specific for BMP";
     }

     identity bmp-peer-types-all-peers-idty {
       base bmp-peer-types-idty;
       description "This identify is an explicit way
         of defining that the device SHOULD send the
         updates from all peers to the station for a
         particular RIB/AFI.";
     }

     identity bmp-ni-types-idty {
       description "Enum values for network instances
         specific for BMP";
     }

     identity bmp-ni-types-all-ni-idty {
       base bmp-ni-types-idty;
       description "The identify is an explicit way
         of defining that the device SHOULD send the
         updates from all network instances.";
     }


     grouping bmp-tcp-options {
       description
         "TCP options for the connection to the station";
       leaf maximum-segment-size {
         type uint16;
         description



Cardona, et al.           Expires 27 April 2023                 [Page 9]

Internet-Draft               BMP YANG Module                October 2022


           "Maximum segment size for the TCP connections.";
       }
       // Taken from the bgp yang module
       leaf mtu-discovery {
           type boolean;
           default "true";
           description
             "Turns path mtu discovery for the  TCP sessions
             on (true) or off (false).";
           reference
             "RFC 1191: Path MTU discovery.";
         }
       uses tcpcmn:tcp-common-grouping;

       // taken from the bgp yang module but using groupings
       leaf secure-session-enable {
          type boolean;
          default "false";
          description
            "Does this session need to be secured?";
       }


      container secure-session {
        when "../secure-session-enable = 'true'";
        description
          "Container for describing how a particular BGP session
           is to be secured.";

         choice authentication {
          case ao {
            leaf ao-keychain {
              type key-chain:key-chain-ref;
              description
                "Reference to the key chain that will be used by
                 this model. Applicable for TCP-AO and TCP-MD5
                 only";
              reference
                "RFC 8177: YANG Key Chain.";
            }
            description
              "Uses TCP-AO to secure the session. Parameters for
               those are defined as a grouping in the TCP YANG
               model.";
            reference
              "RFC 5925 - The TCP Authentication Option.";
         }




Cardona, et al.           Expires 27 April 2023                [Page 10]

Internet-Draft               BMP YANG Module                October 2022


          case md5 {
            leaf md5-keychain {
              type key-chain:key-chain-ref;
              description
                "Reference to the key chain that will be used by
                 this model. Applicable for TCP-AO and TCP-MD5
                 only";
              reference
                "RFC 8177: YANG Key Chain.";
            }
            description
              "Uses TCP-MD5 to secure the session. Parameters for
               those are defined as a grouping in the TCP YANG
               model.";
            reference
              "RFC 5925: The TCP Authentication Option.";
          }
          description
            "Choice of TCP authentication.";
         }
      }


     }

     grouping bmp-ip-connection {
       description
         "common elements for defining connectivity
          to a bmp station";
       choice passive-or-active {
         description
           "Choice for active or passive connection";
         case active {
           description
             "The device starts the connection to the station";
           container active {
             description
               "The device starts the connection to  the station";
             leaf network-instance {
               type leafref {
                 path "/ni:network-instances/ni:network-instance/"
                    + "ni:name";
               }
               mandatory true;
               description
                 "Network-instance to used to reach the station.";
             }
             leaf station-address {



Cardona, et al.           Expires 27 April 2023                [Page 11]

Internet-Draft               BMP YANG Module                October 2022


               type inet:ip-address;
               mandatory true;
               description
                 "Destination IP address of station";
             }
             leaf station-port {
               type inet:port-number;
               mandatory true;
               description
                 "Destination port of the station";
             }
             leaf local-address {
               type inet:ip-address;
               mandatory true;
               description
                 "Local IP address to source active connection";
             }
             leaf local-port {
               type inet:port-number;
               description
                 "Optional Local port for active connection";
             }

           }

         }

         case passive {
           description
             "The device waits for the connection
             in a local endpoint";
           container passive {
             description
               "The device waits for the connection
               in a local endpoint";
             leaf network-instance {
               type leafref {
                 path "/ni:network-instances/ni:network-instance/"
                    + "ni:name";
               }
               mandatory true;
               description
                 "Network-instance to use to reach the station.";
             }
             leaf station-address {
               type inet:ip-address;
               mandatory true;
               description



Cardona, et al.           Expires 27 April 2023                [Page 12]

Internet-Draft               BMP YANG Module                October 2022


                 "address of station";
             }
             leaf station-port {
               type inet:port-number;
               description
                 "Optional port identifying the connection,
                 if provided it MUST match";
             }
             leaf local-address {
               type inet:ip-address;
               description
                 "Local IP address to wait for the connection";
             }
             leaf local-port {
               type inet:port-number;
               description
                 "Local port to wait for the connection";
             }

           }

         }
       }
     }

     grouping bmp-source-configuration {
       description
       "Group containing some general characteristics for configuring
       a BMP source";
       container filters {
         description
         "Contains containers specifying filters for deciding
         which routes to export to the station";
         container policy-filter {
             description
             "Filter routes based on a policy";
             leaf-list export-policy {
              type leafref {
                path "/rt-pol:routing-policy/"
                   + "rt-pol:policy-definitions/"
                   + "rt-pol:policy-definition/rt-pol:name";
                require-instance true;
              }
              ordered-by user;
              description
                 "List of policy names in sequence used to select
                 routes to be exported to station.";
            }



Cardona, et al.           Expires 27 April 2023                [Page 13]

Internet-Draft               BMP YANG Module                October 2022


            leaf default-export-policy {
              type rt-pol:default-policy-type;
              default "accept-route";
              description
                "Explicitly set a default policy if no policy
                definition in the export policy chain
                is satisfied.";
            }
         }
       }
     }

     grouping bmp-peer-ribs-filter {
       description
         "Leaves for configuring RIBs where
          origin/destination peers are well defined.";
       leaf enabled {
         type boolean;
         description
           "Enables the specified RIB";
       }

       container address-families {
         description
           "container for lists of address-families";
         list address-family {
           key "name";
           description
             "List of address families.
              The name of the address family, as defined
              in the BGP model is used for keying.";
           leaf name {
             type leafref {
               path "/rt:routing/rt:control-plane-protocols/"
                  + "rt:control-plane-protocol/bgp:bgp/"
                  + "bgp:global/bgp:afi-safis/bgp:afi-safi/bgp:name";
             }
             description
               "Name of the address family";
           }
           container peers {
             description
             "Identification of peers
             for which we send BMP data to the collector";
             list peer {
               key "peer-id";
               description
               "Identification of peers



Cardona, et al.           Expires 27 April 2023                [Page 14]

Internet-Draft               BMP YANG Module                October 2022


               for which we send BMP data to the collector";
               leaf peer-id {
                 type union {
                   type leafref {
                     path "/rt:routing/rt:control-plane-protocols/"
                     + "rt:control-plane-protocol/bgp:bgp/"
                     + "bgp:neighbors/bgp:neighbor/bgp:remote-address";
                   }
                   type bt:peer-type;
                   type identityref {
                     base bmp-peer-types-idty;
                   }
                 }
                 description
                   "Peers can be identified by a remote-address,
                    or by an enum value corresponding to groups
                    of peers.  This way an operator can
                    select all external peers, all internal
                    peers, or all peers.";
               }
               uses bmp-source-configuration;

             }
           }
         }
       }
     }

     grouping bmp-route-monitoring-sources {
       description
         "Route monitoring sources";

       container network-instances {
         description
         "container for lists of network-instances";
         list network-instance {
           key "network-instance-id";
           description
             "Network instance to monitory using BMP.";
           leaf network-instance-id {
             type union {
               type leafref {
                 path "/ni:network-instances/ni:network-instance/"
                    + "ni:name";
               }
               type identityref {
                 base bmp-ni-types-all-ni-idty;
               }



Cardona, et al.           Expires 27 April 2023                [Page 15]

Internet-Draft               BMP YANG Module                October 2022


             }
             description
               "Identification of a network-instance.
               Network instances can be identified
               directly by their path or one can define all of
               them using an identity";

           }



           container adj-rib-in-pre {
             description
               "Configuration for the adj-rib-in pre-policy";
             reference
               "RFC7854: BGP Monitoring Protocol (BMP), Section 2.";
             uses bmp-peer-ribs-filter;
           }
           container adj-rib-in-post {
             description
               "Configuration for the adj-rib-in post-policy";
             reference
               "RFC7854: BGP Monitoring Protocol (BMP), Section 2.";
             uses bmp-peer-ribs-filter;
           }
           container local-rib {
             description
               "Configuration for the local-rib";
             reference
               "RFC9069: Support for Local RIB in the BGP Monitoring
               Protocol (BMP), Section 3.";
             leaf enabled {
               type boolean;
               description
                 "Enables the specified RIB";
             }
             container address-families {
               description
                 "List of address families to enable for
                  local-rib.";
               list address-family {
                 key "address-family-id";
                 description
                  "Address family to enable for local-rib";
                 leaf address-family-id {
                   type identityref {
                     base bt:afi-safi-type;
                   }



Cardona, et al.           Expires 27 April 2023                [Page 16]

Internet-Draft               BMP YANG Module                October 2022


                   description
                   "Address family id to enable for local-rib";
                 }
                 uses bmp-source-configuration;
               }
             }
           }
           container adj-rib-out-pre {
             description
               "Configuration for the adj-rib-out pre-policy";
             uses bmp-peer-ribs-filter;
             reference
               "RFC8671: Support for Adj-RIB-Out in the BGP Monitoring
               Protocol (BMP) , Section 3.";
           }
           container adj-rib-out-post {
             description
               "Configuration for the adj-rib-out post-policy";
             uses bmp-peer-ribs-filter;
             reference
               "RFC8671: Support for Adj-RIB-Out in the BGP Monitoring
               Protocol (BMP) , Section 3.";
           }

         }

       }

     }

     grouping bmp-session-options {
       description
         "leaves for configuration of the bmp session";
       leaf initiation-message {
         type string;
         description
           "User defined message to append to the
            initiation message";
       }
       leaf statistics-interval {
         type uint32;
         description
           "Default Interval for statistic message.";
       }
     }

     container bmp {
       description



Cardona, et al.           Expires 27 April 2023                [Page 17]

Internet-Draft               BMP YANG Module                October 2022


         "Main level for BMP configuration ";
       container stations {
         description
           "Container for the list of BMP stations";
         list station {
           key "id";
           description
             "Configuration for BMP stations.";
           leaf id {
             type string;
             description
               "Identification string for the station";
           }
           // Connection, missing tcp tuning params
           // like keep-alives, segment sizes, etc.
           container connection {
             description
               "Connection details for the station";
             uses bmp-ip-connection;
             uses bmp-tcp-options;

             leaf initial-delay {
               type uint32;
               units "seconds";
               default 0;
               description
                 "Initial delay of the connection to the station";
             }

             container backoff {
               description
                 "Configures the backoff strategy after a connection
                 retry";
               choice backoff-options {
                 description
                   "Options for backoff strategies";
                 case simple-exponential {
                   description
                     "Simple exponential backoff with limits.";
                   container simple-exponential {
                     description
                       "Simple exponential backoff with limits.
                       Starts with the initial backoff and doubles
                       the backoff of every retry until reaching the
                       maximum backoff";
                     leaf initial-backoff {
                       type uint32;
                       units "seconds";



Cardona, et al.           Expires 27 April 2023                [Page 18]

Internet-Draft               BMP YANG Module                October 2022


                       default 30;
                       description
                         "Initial backoff time";
                     }
                     leaf maximum-backoff {
                       type uint32;
                       units "seconds";
                       default 720;
                       description
                         "Maximum backoff time";
                     }
                   }
                 }
               }
             }
           }

           container bmp-session {
             description
               "BMP session options for the station";
             uses bmp-session-options;
           }
           container bmp-sources {
             description
               "Configuration of the data sources for the station";
             container bmp-route-monitoring {
               description
                 "Configuration of the data sources for
                 route-monitoring messages";
               uses bmp-route-monitoring-sources;
             }
           }
           container session-stats {
             description
               "stats and operational values for the station";

             leaf discontinuity-time {
                type yang:date-and-time;
                mandatory true;
                description
                  "The time on the most recent occasion at which any
                  one or more of this station's counters suffered a
                  discontinuity.  If no such discontinuities have
                  occurred since the last re-initialization of the
                  local management subsystem, then this node contains
                  the time the local management subsystem
                  re-initialized itself.";
              }



Cardona, et al.           Expires 27 April 2023                [Page 19]

Internet-Draft               BMP YANG Module                October 2022


             leaf established-session {
               type boolean;
               config false;
               description
                 "Value indicating if the session is currently
                  established";
             }
             leaf total-route-monitoring-messages {
               type uint64;
               config false;
               description
                 "Number of route-monitoring messages sent since last
                  successful connection";
             }
             leaf total-statistics-messages {
               type uint64;
               config false;
               description
                 "Number of statistics messages sent since last
                  successful connection";
             }
             leaf total-peer-down-messages {
               type uint64;
               config false;
               description
                 "Number of peer-down messages sent since last
                  successful connection";
             }
             leaf total-peer-up-messages {
               type uint64;
               config false;
               description
                 "Number of peer-up messages sent since last successful
                  connection";
             }
             leaf total-initiation-messages {
               type uint64;
               config false;
               description
                 "Number of initiation messages sent since last
                  successful connection";
             }
             leaf total-route-mirroring-messages {
               type uint64;
               config false;
               description
                 "Number of route-mirroring messages sent since last
                  successful connection";



Cardona, et al.           Expires 27 April 2023                [Page 20]

Internet-Draft               BMP YANG Module                October 2022


             }
           }
         }

         container actions {
           nacm:default-deny-all;
           description
             "Container with the actions for the BMP operation";
           action session-reset {
             description
               "Resets the session for a station.";
             output {
               choice outcome {
                 description
                   "Output of the reset operation. Either a success or
                    failure. For the latter, the reason for the
                    error is provided.";
                 leaf success {
                   type empty;
                   description
                     "Reset successful";
                 }
                 leaf failure {
                   type string;
                   description
                     "Reset could not be performed.
                     Reason is included in the field";
                 }
               }
             }
           }
         }


       }


     }
   }

   <CODE ENDS>










Cardona, et al.           Expires 27 April 2023                [Page 21]

Internet-Draft               BMP YANG Module                October 2022


5.  Security Considerations

   The YANG module specified in this document defines a schema for data
   that is designed to be accessed via network management protocols such
   as NETCONF [RFC6241] or RESTCONF [RFC8040].  The lowest NETCONF layer
   is the secure transport layer, and the mandatory-to-implement secure
   transport is Secure Shell (SSH) [RFC6242].  The lowest RESTCONF layer
   is HTTPS, and the mandatory-to-implement secure transport is TLS
   [RFC8446].  The NETCONF Access Control Model (NACM) [RFC8341]
   provides the means to restrict access for NETCONF or RESTCONF users
   to a preconfigured subset of all available NETCONF or RESTCONF
   protocol operations and content.

   BGP data is sensible for security considerations.  The model
   described in this document could be used to send BGP information to
   malicious BMP stations.  Write access to this model SHOULD therefore
   be properly protected.

   The session-reset action can demand considerable amount of resources
   from network elements.  It SHOULD thus be protected from illegal
   access.

6.  IANA Considerations

6.1.  The IETF XML Registry

   This document registers a URIs in the IETF XML registry [RFC3688].
   Following the format in [RFC3688], the following registrations are
   requested:

      URI: urn:ietf:params:xml:ns:yang:ietf-bmp
      Registrant Contact: The IESG.
      XML: N/A, the requested URI is an XML namespace.

6.2.  The YANG Module Name Registration

   This document registers the following YANG module in the " YANG
   Module Names" registry registry [RFC6020]:

      Name: ietf-bmp
      Namespace: urn:ietf:params:xml:ns:yang:ietf-bmp
      Prefix: bmp
      Reference: [This RFC-to-be]

7.  Open Issues

      Shall we leverage other IETF models to specify TCP parameters?




Cardona, et al.           Expires 27 April 2023                [Page 22]

Internet-Draft               BMP YANG Module                October 2022


      The security considerations section will have to be aligned with
      https://trac.ietf.org/trac/ops/wiki/yang-security-guidelines

8.  Normative References

   [I-D.ietf-idr-bgp-model]
              Jethanandani, M., Patel, K., Hares, S., and J. Haas, "BGP
              YANG Model for Service Provider Networks", Work in
              Progress, Internet-Draft, draft-ietf-idr-bgp-model-15, 13
              October 2022, <https://www.ietf.org/archive/id/draft-ietf-
              idr-bgp-model-15.txt>.

   [I-D.ietf-netconf-tcp-client-server]
              Watsen, K. and M. Scharf, "YANG Groupings for TCP Clients
              and TCP Servers", Work in Progress, Internet-Draft, draft-
              ietf-netconf-tcp-client-server-14, 19 October 2022,
              <https://www.ietf.org/archive/id/draft-ietf-netconf-tcp-
              client-server-14.txt>.

   [RFC1191]  Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191,
              DOI 10.17487/RFC1191, November 1990,
              <https://www.rfc-editor.org/info/rfc1191>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.






Cardona, et al.           Expires 27 April 2023                [Page 23]

Internet-Draft               BMP YANG Module                October 2022


   [RFC6991]  Schoenwaelder, J., Ed., "Common YANG Data Types",
              RFC 6991, DOI 10.17487/RFC6991, July 2013,
              <https://www.rfc-editor.org/info/rfc6991>.

   [RFC7854]  Scudder, J., Ed., Fernando, R., and S. Stuart, "BGP
              Monitoring Protocol (BMP)", RFC 7854,
              DOI 10.17487/RFC7854, June 2016,
              <https://www.rfc-editor.org/info/rfc7854>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8177]  Lindem, A., Ed., Qu, Y., Yeung, D., Chen, I., and J.
              Zhang, "YANG Data Model for Key Chains", RFC 8177,
              DOI 10.17487/RFC8177, June 2017,
              <https://www.rfc-editor.org/info/rfc8177>.

   [RFC8341]  Bierman, A. and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018,
              <https://www.rfc-editor.org/info/rfc8341>.

   [RFC8349]  Lhotka, L., Lindem, A., and Y. Qu, "A YANG Data Model for
              Routing Management (NMDA Version)", RFC 8349,
              DOI 10.17487/RFC8349, March 2018,
              <https://www.rfc-editor.org/info/rfc8349>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

   [RFC8529]  Berger, L., Hopps, C., Lindem, A., Bogdanovic, D., and X.
              Liu, "YANG Data Model for Network Instances", RFC 8529,
              DOI 10.17487/RFC8529, March 2019,
              <https://www.rfc-editor.org/info/rfc8529>.

   [RFC8671]  Evens, T., Bayraktar, S., Lucente, P., Mi, P., and S.
              Zhuang, "Support for Adj-RIB-Out in the BGP Monitoring
              Protocol (BMP)", RFC 8671, DOI 10.17487/RFC8671, November
              2019, <https://www.rfc-editor.org/info/rfc8671>.






Cardona, et al.           Expires 27 April 2023                [Page 24]

Internet-Draft               BMP YANG Module                October 2022


   [RFC9069]  Evens, T., Bayraktar, S., Bhardwaj, M., and P. Lucente,
              "Support for Local RIB in the BGP Monitoring Protocol
              (BMP)", RFC 9069, DOI 10.17487/RFC9069, February 2022,
              <https://www.rfc-editor.org/info/rfc9069>.

Appendix A.  Examples

   This section shows an example of a BMP configuration using the model.
   In the example, the device will send information from the global
   network instance, the adj-rib-out-pre RIB, IPv4 AFI, and only from
   peers that are external.

   <bmp xmlns="urn:ietf:params:xml:ns:yang:ietf-bmp">
       <stations>
         <station>
           <id>1</id>
           <connection>
             <active>
               <network-instance>global</network-instance>
               <station-address>203.0.113.1</station-address>
               <station-port>49192</station-port>
               <local-address>203.0.113.2</local-address>
             </active>
           </connection>
           <bmp-sources>
             <network-instances>
               <network-instance>
                 <network-instance-id>global</network-instance-id>
                 <adj-rib-in-pre>
                   <enabled>true</enabled>
                   <address-families>
                     <address-family>
                         <name xmlns:bt="urn:ietf:params:xml:ns:yang:\/
                         ietf-bgp-types">bt:ipv4-unicast</name>
                       <peers>external</peers>
                     </address-family>
                   </address-families>
                 </adj-rib-out-pre>
               </network-instance>
             </network-instances>
           </bmp-sources>
         </station>
       </stations>
   </bmp>







Cardona, et al.           Expires 27 April 2023                [Page 25]

Internet-Draft               BMP YANG Module                October 2022


Acknowledgements

   The authors would like to thank Yimin Shen, Jeff Haas, Pierre Vander
   Vorst, and Tom Petch for their review and feedback.

Authors' Addresses

   Camilo Cardona
   NTT
   164-168, Carrer de Numancia
   08029 Barcelona
   Spain
   Email: camilo@ntt.net


   Paolo Lucente
   NTT
   Siriusdreef 70-72
   2132 Hoofddorp
   Netherlands
   Email: paolo@ntt.net


   Thomas Graf
   Swisscom
   Binzring 17
   CH- Zurich 8045
   Switzerland
   Email: thomas.graf@swisscom.com


   Benoit Claise
   Huawei
   Email: benoit.claise@huawei.com

















Cardona, et al.           Expires 27 April 2023                [Page 26]