All Downloads are FREE. Search and download functionalities are using the official Maven repository.

[email protected] Maven / Gradle / Ivy

There is a newer version: 0.22.6
Show newest version
module openconfig-bgp-multiprotocol {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/bgp-multiprotocol";

  prefix "bgp-mp";

  // import some basic inet types
  import openconfig-routing-policy { prefix rpol; }
  import openconfig-bgp-types { prefix bgp-types; }
  import openconfig-bgp-operational { prefix bgp-op; }
  import openconfig-types { prefix oc-types; }
  import openconfig-extensions { prefix oc-ext; }

  // meta
  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    [email protected]";

  description
    "This module is part of a YANG model for BGP protocol
    configuration, focusing on configuration of multiprotocol
    BGP, in particular various relevant address families (AFI) and
    sub-address families (SAFI).

    Identities (rather than enumerated types) are used to identify
    each AFI / SAFI type to make it easier for users to extend to
    pre-standard or custom AFI/SAFI types.  This module is only
    intended to capture the most";

  oc-ext:openconfig-version "1.1.0";

  revision "2015-10-09" {
    description
      "Initial OpenConfig public release";
    reference "1.1.0";
  }

  revision "2015-05-15" {
    description
      "Refactored multiprotocol module";
    reference "Pre-release";
  }

  grouping ipv4-unicast-group {
    description
      "Group for IPv4 Unicast configuration options";

    container ipv4-unicast {
      when "../afi-safi-name = 'bgp-mp:ipv4-unicast'" {
        description
          "Include this container for IPv4 Unicast specific
          configuration";
      }

      description "IPv4 unicast configuration options";

      // include common IPv[46] unicast options
      uses ipv4-ipv6-unicast-common;

      // placeholder for IPv4 unicast  specific configuration
    }
  }

  grouping ipv6-unicast-group {
    description
      "Group for IPv6 Unicast configuration options";

    container ipv6-unicast {
      when "../afi-safi-name = 'bgp-mp:ipv6-unicast'" {
        description
          "Include this container for IPv6 Unicast specific
          configuration";
      }

      description "IPv6 unicast configuration options";

      // include common IPv[46] unicast options
      uses ipv4-ipv6-unicast-common;

      // placeholder for IPv6 unicast specific configuration
      // options
    }
  }

  grouping ipv4-labelled-unicast-group {
    description
      "Group for IPv4 Labelled Unicast configuration options";

    container ipv4-labelled-unicast {
      when "../afi-safi-name = 'bgp-mp:ipv4-labelled-unicast'" {
        description
          "Include this container for IPv4 Labelled Unicast specific
          configuration";
      }

      description "IPv4 Labelled Unicast configuration options";

      uses all-afi-safi-common;

      // placeholder for IPv4 Labelled Unicast specific config
      // options
    }
  }

  grouping ipv6-labelled-unicast-group {
    description
      "Group for IPv6 Labelled Unicast configuration options";

    container ipv6-labelled-unicast {
      when "../afi-safi-name = 'bgp-mp:ipv6-labelled-unicast'" {
        description
          "Include this container for IPv6 Labelled Unicast specific
          configuration";
      }

      description "IPv6 Labelled Unicast configuration options";

      uses all-afi-safi-common;

      // placeholder for IPv6 Labelled Unicast specific config
      // options.
    }
  }

  grouping l3vpn-ipv4-unicast-group {
    description
      "Group for IPv4 Unicast L3VPN configuration options";

    container l3vpn-ipv4-unicast {
      when "../afi-safi-name = 'bgp-mp:l3vpn-ipv4-unicast'" {
        description
          "Include this container for IPv4 Unicast L3VPN specific
          configuration";
      }

      description "Unicast IPv4 L3VPN configuration options";

      // include common L3VPN configuration options
      uses l3vpn-ipv4-ipv6-unicast-common;

      // placeholder for IPv4 Unicast L3VPN specific config options.
    }
  }

  grouping l3vpn-ipv6-unicast-group {
    description
      "Group for IPv6 Unicast L3VPN configuration options";

    container l3vpn-ipv6-unicast {
      when "../afi-safi-name = 'bgp-mp:l3vpn-ipv6-unicast'" {
        description
          "Include this container for unicast IPv6 L3VPN specific
          configuration";
      }

      description "Unicast IPv6 L3VPN configuration options";

      // include common L3VPN configuration options
      uses l3vpn-ipv4-ipv6-unicast-common;

      // placeholder for IPv6 Unicast L3VPN specific configuration
      // options
    }
  }

  grouping l3vpn-ipv4-multicast-group {
    description
      "Group for IPv4 L3VPN multicast configuration options";

    container l3vpn-ipv4-multicast {
      when "../afi-safi-name = 'bgp-mp:l3vpn-ipv4-multicast'" {
        description
          "Include this container for multicast IPv6 L3VPN specific
          configuration";
      }

      description "Multicast IPv4 L3VPN configuration options";

      // include common L3VPN multicast options
      uses l3vpn-ipv4-ipv6-multicast-common;

      // placeholder for IPv4 Multicast L3VPN specific configuration
      // options
    }
  }

  grouping l3vpn-ipv6-multicast-group {
    description
      "Group for IPv6 L3VPN multicast configuration options";

    container l3vpn-ipv6-multicast {
      when "../afi-safi-name = 'bgp-mp:l3vpn-ipv6-multicast'" {
        description
          "Include this container for multicast IPv6 L3VPN specific
          configuration";
      }

      description "Multicast IPv6 L3VPN configuration options";

      // include common L3VPN multicast options
      uses l3vpn-ipv4-ipv6-multicast-common;

      // placeholder for IPv6 Multicast L3VPN specific configuration
      // options
    }
  }

  grouping l2vpn-vpls-group {
    description
      "Group for BGP-signalled VPLS configuration options";

    container l2vpn-vpls {
      when "../afi-safi-name = 'bgp-mp:l2vpn-vpls'" {
        description
          "Include this container for BGP-signalled VPLS specific
          configuration";
      }

      description "BGP-signalled VPLS configuration options";

      // include common L2VPN options
      uses l2vpn-common;

      // placeholder for BGP-signalled VPLS specific configuration
      // options
    }
  }

  grouping l2vpn-evpn-group {
    description
      "Group for BGP EVPN configuration options";

    container l2vpn-evpn {
      when "../afi-safi-name = 'bgp-mp:l2vpn-evpn'" {
        description
          "Include this container for BGP EVPN specific
          configuration";
      }

      description "BGP EVPN configuration options";

      // include common L2VPN options
      uses l2vpn-common;

      // placeholder for BGP EVPN specific configuration options
    }
  }



  grouping bgp-route-selection-options_config {
    description
      "Set of configuration options that govern best
       path selection.";

    leaf always-compare-med {
      type boolean;
      default "false";
      description
        "Compare multi-exit discriminator (MED) value from
        different ASes when selecting the best route.  The
        default behavior is to only compare MEDs for paths
        received from the same AS.";
    }

    leaf ignore-as-path-length {
      type boolean;
      default "false";
      description
        "Ignore the AS path length when selecting the best path.
        The default is to use the AS path length and prefer paths
        with shorter length.";
    }

    leaf external-compare-router-id {
      type boolean;
      default "true";
      description
        "When comparing similar routes received from external
        BGP peers, use the router-id as a criterion to select
        the active path.";
    }

    leaf advertise-inactive-routes {
      type boolean;
      default "false";
      description
        "Advertise inactive routes to external peers.  The
        default is to only advertise active routes.";
    }

    leaf enable-aigp {
      type boolean;
      default false;
      description
        "Flag to enable sending / receiving accumulated IGP
        attribute in routing updates";
    }

    leaf ignore-next-hop-igp-metric {
      type boolean;
      default "false";
      description
        "Ignore the IGP metric to the next-hop when calculating
        BGP best-path. The default is to select the route for
        which the metric to the next-hop is lowest";
    }
  }

  grouping bgp-use-multiple-paths-ebgp-as-options_config {
    description
      "Configuration parameters specific to eBGP multipath applicable
      to all contexts";

    leaf allow-multiple-as {
     type boolean;
     default "false";
     description
      "Allow multipath to use paths from different neighbouring
      ASes.  The default is to only consider multiple paths from
      the same neighbouring AS.";
    }
  }

  grouping bgp-use-multiple-paths-ebgp_config {
    description
      "Configuration parameters relating to multipath for eBGP";

    uses bgp-use-multiple-paths-ebgp-as-options_config;

    leaf maximum-paths {
     type uint32;
     default 1;
     description
      "Maximum number of parallel paths to consider when using
      BGP multipath. The default is use a single path.";
    }
  }

  grouping bgp-use-multiple-paths-ibgp_config {
    description
      "Configuration parmaeters relating to multipath for iBGP";

    leaf maximum-paths {
      type uint32;
      default 1;
      description
        "Maximum number of parallel paths to consider when using
        iBGP multipath. The default is to use a single path";
    }
  }

  grouping bgp-use-multiple-paths {
    description
      "Configuration parameters relating to multipath for BGP - both
      iBGP and eBGP";

    container use-multiple-paths {
      description
        "Parameters related to the use of multiple paths for the
        same NLRI";

      container config {
        description
          "Configuration parameters relating to multipath";
        uses bgp-use-multiple-paths_config;
      }
      container state {
        description
          "State parameters relating to multipath";
        uses bgp-use-multiple-paths_config;
      }

      container ebgp {
        description
          "Multipath parameters for eBGP";
        container config {
          description
            "Configuration parameters relating to eBGP multipath";
          uses bgp-use-multiple-paths-ebgp_config;
        }
        container state {
          config false;
          description
            "State information relating to eBGP multipath";
          uses bgp-use-multiple-paths-ebgp_config;
        }
      }

      container ibgp {
        description
          "Multipath parameters for iBGP";
        container config {
          description
            "Configuration parameters relating to iBGP multipath";
          uses bgp-use-multiple-paths-ibgp_config;
        }
        container state {
          config false;
          description
            "State information relating to iBGP multipath";
          uses bgp-use-multiple-paths-ibgp_config;
        }
      }
    }
  }

  grouping bgp-use-multiple-paths-neighbor {
    description
      "Per-neighbor configuration for multipath for BGP";

    container use-multiple-paths {
      description
        "Parameters related to the use of multiple-paths for the same
        NLRI when they are received only from this neighbor";

      container config {
        description
          "Configuration parameters relating to multipath";
        uses bgp-use-multiple-paths_config;
      }
      container state {
        description
          "State parameters relating to multipath";
        uses bgp-use-multiple-paths_config;
      }

      container ebgp {
        description
          "Multipath configuration for eBGP";
        container config {
          description
            "Configuration parameters relating to eBGP multipath";
          uses bgp-use-multiple-paths-ebgp-as-options_config;
        }
        container state {
          config false;
          description
            "State information relating to eBGP multipath";
          uses bgp-use-multiple-paths-ebgp-as-options_config;
        }
      }
    }
  }

  grouping bgp-use-multiple-paths_config {
    description
      "Generic configuration options relating to use of multiple
      paths for a referenced AFI-SAFI, group or neighbor";

    leaf enabled {
      type boolean;
      default false;
      description
        "Whether the use of multiple paths for the same NLRI is
        enabled for the neighbor. This value is overridden by
        any more specific configuration value.";
    }
  }

  grouping bgp-afi-safi-graceful-restart_config {
    description
      "BGP graceful restart parameters that apply on a per-AFI-SAFI
      basis";

    leaf enabled {
      type boolean;
      default false;
      description
        "This leaf indicates whether graceful-restart is enabled for
        this AFI-SAFI";
    }
  }

  grouping bgp-afi-safi_config {
    description
      "Configuration parameters used for all BGP AFI-SAFIs";

    leaf afi-safi-name {
      type identityref {
        base bgp-types:afi-safi-type;
      }
      description "AFI,SAFI";
    }

    leaf enabled {
      type boolean;
      default false;
      description
        "This leaf indicates whether the IPv4 Unicast AFI,SAFI is
        enabled for the neighbour or group";
    }
  }

  grouping all-afi-safi-common-prefix-limit_config {
    description
      "Configuration parameters relating to prefix-limits for an
      AFI-SAFI";

    leaf max-prefixes {
      type uint32;
      description
        "Maximum number of prefixes that will be accepted
        from the neighbour";
    }

    leaf shutdown-threshold-pct {
      type oc-types:percentage;
      description
        "Threshold on number of prefixes that can be received
        from a neighbour before generation of warning messages
        or log entries. Expressed as a percentage of
        max-prefixes";
    }

    leaf restart-timer {
      type decimal64 {
        fraction-digits 2;
      }
      units "seconds";
      description
        "Time interval in seconds after which the BGP session
        is re-established after being torn down due to exceeding
        the max-prefix limit.";
    }
  }

  grouping ipv4-ipv6-unicast-common_config {
    description
      "Common configuration parameters for IPv4 and IPv6 Unicast
      address families";

    leaf send-default-route {
      type boolean;
      default "false";
      description
        "If set to true, send the default-route to the neighbour(s)";
    }
  }

  grouping all-afi-safi-common {
    description
      "Grouping for configuration common to all AFI,SAFI";

    container prefix-limit {
      description
        "Configure the maximum number of prefixes that will be
        accepted from a peer";

      container config {
        description
          "Configuration parameters relating to the prefix
          limit for the AFI-SAFI";
        uses all-afi-safi-common-prefix-limit_config;
      }
      container state {
        config false;
        description
          "State information relating to the prefix-limit for the
          AFI-SAFI";
        uses all-afi-safi-common-prefix-limit_config;
      }
    }
  }

  grouping ipv4-ipv6-unicast-common {
    description
      "Common configuration that is applicable for IPv4 and IPv6
      unicast";

    // include common afi-safi options.
    uses all-afi-safi-common;

    // configuration options that are specific to IPv[46] unicast
    container config {
      description
        "Configuration parameters for common IPv4 and IPv6 unicast
        AFI-SAFI options";
      uses ipv4-ipv6-unicast-common_config;
    }
    container state {
      config false;
      description
        "State information for common IPv4 and IPv6 unicast
        parameters";
      uses ipv4-ipv6-unicast-common_config;
    }
  }

  grouping l3vpn-ipv4-ipv6-unicast-common {
    description
      "Common configuration applied across L3VPN for IPv4
       and IPv6";

    // placeholder -- specific configuration options that are generic
    // across IPv[46] unicast address families.
    uses all-afi-safi-common;
  }

  grouping l3vpn-ipv4-ipv6-multicast-common {
    description
      "Common configuration applied across L3VPN for IPv4
      and IPv6";

    // placeholder -- specific configuration options that are
    // generic across IPv[46] multicast address families.
    uses all-afi-safi-common;
  }

  grouping l2vpn-common {
    description
      "Common configuration applied across L2VPN address
      families";

    // placeholder -- specific configuration options that are
    // generic across L2VPN address families
    uses all-afi-safi-common;
  }

  grouping bgp-route-selection-options {
    description
      "Parameters relating to the BGP route selection process";

    container route-selection-options {
      description
        "Parameters relating to options for route selection";
      container config {
        description
          "Configuration parameters relating to route selection
          options";
        uses bgp-route-selection-options_config;
      }
      container state {
        config false;
        description
          "State information for the route selection options";
        uses bgp-route-selection-options_config;
      }
    }
  }

  // *********** STRUCTURE GROUPINGS **********************

  grouping bgp-global-afi-safi {
    description
      "Parameters and route selection options for MP-BGP
      specific to the Global AFI-SAFI";
    uses bgp-route-selection-options;
  }

  grouping bgp-group-afi-safi {
    description
      "Parameters and route selection options for MP-BGP
      specific to peer groups";
    uses bgp-route-selection-options;
  }

  grouping bgp-common-afi-safi-list {
    description
      "List of address-families associated with the BGP instance,
      a peer-group or neighbor";

    list afi-safi {
      key "afi-safi-name";

      description
        "AFI,SAFI configuration available for the
        neighbour or group";


      leaf afi-safi-name {
        type leafref {
          path "../config/afi-safi-name";
        }
        description
          "Reference to the AFI-SAFI name used as a key
          for the AFI-SAFI list";
      }

      container graceful-restart {
        description
          "Parameters relating to BGP graceful-restart";
        container config {
          description
            "Configuration options for BGP graceful-restart";
          uses bgp-afi-safi-graceful-restart_config;
        }
        container state {
          config false;
          description
            "State information for BGP graceful-restart";
          uses bgp-afi-safi-graceful-restart_config;
        }
      }

      container config {
        description
          "Configuration parameters for the AFI-SAFI";
        uses bgp-afi-safi_config;
      }
      container state {
        config false;
        description
          "State information relating to the AFI-SAFI";
        uses bgp-afi-safi_config;
        uses bgp-op:bgp-afi-safi_state;
      }

      // import and export policy included for the afi/safi
      uses rpol:apply-policy-group;

      uses ipv4-unicast-group;
      uses ipv6-unicast-group;
      uses ipv4-labelled-unicast-group;
      uses ipv6-labelled-unicast-group;
      uses l3vpn-ipv4-unicast-group;
      uses l3vpn-ipv6-unicast-group;
      uses l3vpn-ipv4-multicast-group;
      uses l3vpn-ipv6-multicast-group;
      uses l2vpn-vpls-group;
      uses l2vpn-evpn-group;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy