openconfig-sampling-sflow

This module defines configuration and operational state data related to data plane traffic sampling based on sFlow. RFC 3176 - ...

  • Version: 2020-06-26

    openconfig-sampling-sflow@2020-06-26


    
      module openconfig-sampling-sflow {
    
        yang-version 1;
    
        namespace
          "http://openconfig.net/yang/sampling/sflow";
    
        prefix oc-sflow;
    
        import openconfig-extensions {
          prefix oc-ext;
        }
        import openconfig-inet-types {
          prefix oc-inet;
        }
        import openconfig-interfaces {
          prefix oc-if;
        }
        import openconfig-yang-types {
          prefix oc-yang;
        }
        import openconfig-network-instance {
          prefix oc-netinst;
        }
    
        organization "OpenConfig working group";
    
        contact
          "OpenConfig working group
        www.openconfig.net";
    
        description
          "This module defines configuration and operational state data
        related to data plane traffic sampling based on sFlow.
    
        RFC 3176 - InMon Corporation's sFlow: A Method for
        Monitoring Traffic in Switched and Routed Networks";
    
        revision "2020-06-26" {
          description "Initial revision";
          reference
            "0.1.0";
    
        }
    
        oc-ext:openconfig-version "0.1.0";
    
        grouping sflow-interfaces-config {
          description
            "Configuration data for sFlow data on interfaces.";
          leaf name {
            type oc-if:base-interface-ref;
            description
              "Reference to the interface for sFlow configuration and
            state.";
          }
    
          leaf enabled {
            type boolean;
            description
              "Enables or disables sFlow on the interface.  If sFlow is
            globally disabled, this leaf is ignored.  If sFlow
            is globally enabled, this leaf may be used to disable it
            for a specific interface.";
          }
    
          leaf sampling-rate {
            type uint32;
            description
              "If sFlow is enabled on the interface, this leaf may be
            used to override the global sampling rate for a specific
            interface.  The sampling rate semantics are the same as the
            system-wide leaf.";
          }
        }  // grouping sflow-interfaces-config
    
        grouping sflow-interfaces-state {
          description
            "Operational state data for sFlow data on interfaces";
          leaf packets-sampled {
            type oc-yang:counter64;
            description
              "Total number of packets sampled from the interface.";
          }
        }  // grouping sflow-interfaces-state
    
        grouping sflow-interfaces-top {
          description
            "Top-level grouping for sFlow data on an interface.";
          container interfaces {
            description
              "Enclosing container for list of sFlow interfaces.";
            list interface {
              key "name";
              description
                "List of interfaces with sFlow data.";
              leaf name {
                type leafref {
                  path "../config/name";
                }
                description
                  "Reference to list key.";
              }
    
              container config {
                description
                  "Configuration data for sFlow data on interfaces.";
                uses sflow-interfaces-config;
              }  // container config
    
              container state {
                config false;
                description
                  "Operational state data for sFlow data on interfaces.";
                uses sflow-interfaces-config;
    
                uses sflow-interfaces-state;
              }  // container state
            }  // list interface
          }  // container interfaces
        }  // grouping sflow-interfaces-top
    
        grouping sflow-collectors-config {
          description
            "Configuration data for sFlow collectors.";
          leaf address {
            type oc-inet:ip-address;
            description
              "IP address of the sFlow collector.";
          }
    
          leaf port {
            type oc-inet:port-number;
            default '6343';
            description
              "UDP port number for the sFlow collector.";
          }
    
          leaf network-instance {
            type oc-netinst:network-instance-ref;
            description
              "Reference to the network instance used to reach the
            sFlow collector.  If uspecified, the collector destination
            is reachable in the default network instance.";
          }
        }  // grouping sflow-collectors-config
    
        grouping sflow-collectors-state {
          description
            "Operational state data for sFlow collectors.";
          leaf packets-sent {
            type oc-yang:counter64;
            description
              "The total number of packets sampled and sent to the
            collector.";
          }
        }  // grouping sflow-collectors-state
    
        grouping sflow-collectors-top {
          description
            "Top-level grouping for data related to sFlow collectors.";
          container collectors {
            description
              "Enclosing container for list of sFlow collectors.";
            list collector {
              key "address port";
              description
                "List of sFlow collectors to send sampling data.  Packet
              samples are sent to all collectors specified.";
              leaf address {
                type leafref {
                  path "../config/address";
                }
                description
                  "Reference to address list key.";
              }
    
              leaf port {
                type leafref {
                  path "../config/port";
                }
                description
                  "Reference to port list key.";
              }
    
              container config {
                description
                  "Configuration data for sFlow collectors.";
                uses sflow-collectors-config;
              }  // container config
    
              container state {
                config false;
                description
                  "Operational state data for sFlow collectors.";
                uses sflow-collectors-config;
    
                uses sflow-collectors-state;
              }  // container state
            }  // list collector
          }  // container collectors
        }  // grouping sflow-collectors-top
    
        grouping sflow-global-config {
          description
            "Configuration data for global sflow";
          leaf enabled {
            type boolean;
            default 'false';
            description
              "Enables or disables sFlow sampling for the device.";
          }
    
          leaf source-address {
            type oc-inet:ip-address;
            description
              "Sets the source IP address for sFlow datagrams sent to
            sFlow collectors.";
          }
    
          leaf sampling-rate {
            type uint32;
            description
              "Sets the global packet sampling rate.  The rate is
            is expressed as an integer N, where the intended sampling
            rate is 1/N packets.  An implementation may implement the
            sampling rate as a statistical average, rather than a strict
            periodic sampling.
    
            The allowable sampling rate range is generally a
            property of the system, e.g., determined by the
            capability of the hardware.";
          }
    
          leaf sample-size {
            type uint16;
            units "bytes";
            default '128';
            description
              "Sets the maximum number of bytes to be copied from a
            sampled packet.";
            reference
              "RFC 3176 - InMon Corporation's sFlow: A Method for
              Monitoring Traffic in Switched and Routed Networks";
    
          }
        }  // grouping sflow-global-config
    
        grouping sflow-global-state {
          description
            "Operational state data for global sFlow.";
        }  // grouping sflow-global-state
    
        grouping sflow-global-top {
          description
            "Top-level grouping for global sFlow";
          container sflow {
            description
              "Top-level container for sFlow data.";
            container config {
              description
                "Configuration data for global sFlow.";
              uses sflow-global-config;
            }  // container config
    
            container state {
              config false;
              description
                "Operational state data for global sFlow.";
              uses sflow-global-config;
    
              uses sflow-global-state;
            }  // container state
    
            uses sflow-collectors-top;
    
            uses sflow-interfaces-top;
          }  // container sflow
        }  // grouping sflow-global-top
    
        grouping sampling-top {
          description
            "Top-level grouping for traffic sampling data.";
          container sampling {
            description
              "Top-level container for data related to traffic sampling
            protocols.";
            uses sflow-global-top;
          }  // container sampling
        }  // grouping sampling-top
    
        uses sampling-top;
      }  // module openconfig-sampling-sflow
    

© 2023 YumaWorks, Inc. All rights reserved.