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-operational {

  yang-version "1";

  // namespace
  // TODO: change to an ietf or other more generic namespace
  namespace "http://openconfig.net/yang/bgp-operational";

  prefix "bgp-op";

  // import some basic inet types
  import ietf-inet-types { prefix inet; }
  import ietf-yang-types { prefix yang; }
  import openconfig-bgp-types { prefix bgp-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 operational data (i.e., state
    variables) related to BGP operations";

  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
      "Initial revision";
    reference "Pre-release";
  }

  // extension statements

  // feature statements

  // identity statements

  // typedef statements

  // grouping statements

  grouping bgp-counters-message-types_common {
    description
      "Grouping of BGP message types, included for re-use
      across counters";

    leaf UPDATE {
      type uint64;
      description
        "Number of BGP UPDATE messages announcing, withdrawing
        or modifying paths exchanged.";
    }

    leaf NOTIFICATION {
      type uint64;
      description
        "Number of BGP NOTIFICATION messages indicating an
        error condition has occurred exchanged.";
    }
  }


  grouping bgp-context-pfx-path-counters_common {
    description
      "Grouping containing common counters relating to prefixes and
      paths";

    leaf total-paths {
      type uint32;
      description
        "Total number of BGP paths within the context";
    }

    leaf total-prefixes {
      type uint32;
      description
        "";
    }
  }

  grouping bgp-global_state {
    description
      "Grouping containing operational parameters relating to the
      global BGP instance";
    uses bgp-context-pfx-path-counters_common;
  }

  grouping bgp-global-afi-safi_state {
    description
      "Grouping containing operational parameters relating to each
      AFI-SAFI within the BGP global instance";
    uses bgp-context-pfx-path-counters_common;
  }

  grouping bgp-peer-group_state {
    description
      "Grouping containing operational parameters relating to a BGP
      peer group";
    uses bgp-context-pfx-path-counters_common;
  }

  grouping bgp-neighbor_state {
    description
      "Grouping containing operational state variables relating to a
      BGP neighbor";

    leaf session-state {
      type enumeration {
          enum IDLE {
            description
              "neighbor is down, and in the Idle state of the
              FSM";
          }
          enum CONNECT {
            description
              "neighbor is down, and the session is waiting for
              the underlying transport session to be established";
          }
          enum ACTIVE {
            description
              "neighbor is down, and the local system is awaiting
              a conncetion from the remote peer";
          }
          enum OPENSENT {
            description
              "neighbor is in the process of being established.
              The local system has sent an OPEN message";
          }
          enum OPENCONFIRM {
            description
              "neighbor is in the process of being established.
              The local system is awaiting a NOTIFICATION or
              KEEPALIVE message";
          }
          enum ESTABLISHED {
            description
              "neighbor is up - the BGP session with the peer is
              established";
          }
        }
      description
        "Operational state of the BGP peer";
    }

    leaf-list supported-capabilities {
      type identityref {
        base bgp-types:bgp-capability;
      }
      description
        "BGP capabilities negotiated as supported with the peer";
    }
  }

  grouping bgp-neighbor-afi-safi_state {
    description
      "Operational state on a per-AFI-SAFI basis for a BGP
      neighbor";

    leaf active {
      type boolean;
      description
        "This value indicates whether a particular AFI-SAFI has
        been succesfully negotiated with the peer. An AFI-SAFI
        may be enabled in the current running configuration, but a
        session restart may be required in order to negotiate the new
        capability.";
    }

    uses bgp-neighbor-prefix-counters_state;
  }

  grouping bgp-neighbor-prefix-counters_state {
    description
      "Counters for BGP neighbor sessions";

    container prefixes {
      description "Prefix counters for the BGP session";
      leaf received {
        type uint32;
        description
          "The number of prefixes received from the neighbor";
      }

      leaf sent {
        type uint32;
        description
          "The number of prefixes advertised to the neighbor";
      }

      leaf installed {
        type uint32;
        description
          "The number of advertised prefixes installed in the
          Loc-RIB";
      }
    }
  }

  grouping bgp-neighbor-message-counters-sent_state {
    description
      "Counters relating to messages sent to a BGP neighbor";
    uses bgp-counters-message-types_common;
  }

  grouping bgp-neighbor-message-counters-received_state {
    description
      "Counters relating to the mesages received from a BGP
      neighbor";
    uses bgp-counters-message-types_common;
  }

  grouping bgp-neighbor-queue-counters_state {
    description
      "Counters relating to the message queues associated with the
      BGP peer";
    leaf input {
      type uint32;
      description
        "The number of messages received from the peer currently
        queued";
    }

    leaf output {
      type uint32;
      description
        "The number of messages queued to be sent to the peer";
    }
  }

  grouping bgp-neighbor-transport_state {
    description
      "Operational state parameters relating to the transport session
      used for the BGP session";

    leaf local-port {
      type inet:port-number;
      description
        "Local TCP port being used for the TCP session supporting
        the BGP session";
    }

    leaf remote-address {
      type inet:ip-address;
      description
        "Remote address to which the BGP session has been
        established";
    }

    leaf remote-port {
      type inet:port-number;
      description
        "Remote port being used by the peer for the TCP session
        supporting the BGP session";
    }
  }

  grouping bgp-neighbor-error-handling_state {
    description
      "Operational state parameters relating to enhanced error
      error handling for BGP";

    leaf erroneous-update-messages {
      type uint32;
      description
        "The number of BGP UPDATE messages for which the
        treat-as-withdraw mechanism has been applied based
        on erroneous message contents";
    }
  }

  grouping bgp-neighbor-timers_state {
    description
      "Operational state parameters relating to BGP timers associated
      with the BGP session";

    leaf uptime {
      type yang:timeticks;
      description
        "This timer determines the amount of time since the
        BGP last transitioned in or out of the Established
        state";
    }

    leaf negotiated-hold-time {
      type decimal64 {
        fraction-digits 2;
      }
      description
        "The negotiated hold-time for the BGP session";
    }
  }

  grouping bgp-afi-safi_state {
    description
      "Operational state information relevant to all address
      families that may be carried by the BGP session";

    // placeholder - options in this container are
    // valid in both the global and per-neighbor
    // paths

  }

  grouping bgp-afi-safi-graceful-restart_state {
    description
      "Operational state information relevant to graceful restart
      for BGP";

    leaf peer-restart-time {
      type uint16 {
        range 0..4096;
      }
      description
        "The period of time (advertised by the peer) that
        the peer expects a restart of a BGP session to
        take";
    }

    leaf peer-restarting {
      type boolean;
      description
        "This flag indicates whether the remote neighbor is currently
        in the process of restarting, and hence received routes are
        currently stale";
    }

    leaf local-restarting {
      type boolean;
      description
        "This flag indicates whether the local neighbor is currently
        restarting. The flag is unset after all NLRI have been
        advertised to the peer, and the End-of-RIB (EOR) marker has
        been unset";
    }

    leaf mode {
      type enumeration {
        enum HELPER-ONLY {
          description
            "The local router is operating in helper-only mode, and
            hence will not retain forwarding state during a local
            session restart, but will do so during a restart of the
            remote peer";
        }
        enum BILATERAL {
          description
            "The local router is operating in both helper mode, and
            hence retains forwarding state during a remote restart,
            and also maintains forwarding state during local session
            restart";
        }
        enum REMOTE-HELPER {
          description
            "The local system is able to retain routes during restart
            but the remote system is only able to act as a helper";
        }
      }
      description
        "Ths leaf indicates the mode of operation of BGP graceful
        restart with the peer";
    }
  }

  grouping bgp-neighbor-afi-safi-graceful-restart_state {
    description
      "Operational state variables relating to the graceful-restart
      mechanism on a per-AFI-SAFI basis";

    leaf received {
      type boolean;
      description
        "This leaf indicates whether the neighbor advertised the
        ability to support graceful-restart for this AFI-SAFI";
    }

    leaf advertised {
      type boolean;
      description
        "This leaf indicates whether the ability to support
        graceful-restart has been advertised to the peer";
    }
  }


}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy