huawei-segment-routing

Segment routing.

  • Version: 2021-05-17

    huawei-segment-routing@2021-05-17


    
      module huawei-segment-routing {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-segment-routing";
    
        prefix sr;
    
        import huawei-routing-policy {
          prefix rtp;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-network-instance {
          prefix ni;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
        import ietf-yang-types {
          prefix yang;
        }
    
        include huawei-segment-routing-type;
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
         Bantian, Longgang
         Shenzhen 518129
         People's Republic of China
         Website: http://www.huawei.com
         Email: support@huawei.com";
    
        description "Segment routing.";
    
        revision "2021-05-17" {
          description
            "Add container traffic-statistics.";
          reference
            "Huawei private.";
    
        }
    
        revision "2021-01-20" {
          description "Add Dependency.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-13" {
          description
            "Modify the format specification.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-09" {
          description "Modify the description.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-03" {
          description "Modify the description.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-02-04" {
          description "Modify the description.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-12-23" {
          description
            "Reconstructing Yang file by yin mechanism.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-11-15" {
          description
            "Reconstructing Yang file by yin mechanism.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-09-21" {
          description
            "Reconstructing Yang file by yin mechanism.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-04-04" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "segr";
    
        rpc reset-traffic-statistics {
          description
            "Reset SR LSP traffic statistics.";
          input {
            leaf ip-address {
              type inet:ipv4-address-no-zone;
              description
                "The prefix IP address.";
            }
    
            leaf mask-length {
              type uint8 {
                range "32";
              }
              description
                "Specifies a mask length, the value is 32.";
            }
          }
        }  // rpc reset-traffic-statistics
    
        rpc get-srlb-by-range {
          description
            "Statistics of segment routing local block. The range of local labels reserved by the local device for segment routing.";
          input {
            leaf range {
              type uint32 {
                range "2..4294967295";
              }
              description
                "Total number of SIDs available.";
            }
          }
    
          output {
            container local-block-ranges {
              description
                "List of the available range of segment routing local block.";
              list local-block-range {
                key "begin-value end-value";
                description
                  "The available range of segment routing local block.";
                leaf begin-value {
                  type uint32 {
                    range "2..4294967295";
                  }
                  description
                    "Minimum SID available.";
                }
    
                leaf end-value {
                  type uint32 {
                    range "2..4294967295";
                  }
                  description
                    "Maximum SID available.";
                }
    
                leaf range {
                  type uint32 {
                    range "2..4294967295";
                  }
                  description
                    "Total number of SIDs available.";
                }
              }  // list local-block-range
            }  // container local-block-ranges
          }
        }  // rpc get-srlb-by-range
    
        rpc get-srgb-by-range {
          description
            "Statistics of segment routing dynamic global block. The range of dynamic global labels reserved for segment routing.";
          input {
            leaf range {
              type uint32 {
                range "2..4294967295";
              }
              description
                "Total number of SIDs available.";
            }
          }
    
          output {
            container global-block-ranges {
              description
                "List of the range of dynamic global labels reserved for segment routing.";
              list global-block-range {
                key "begin-value end-value";
                description
                  "The range of dynamic global labels reserved for segment routing.";
                leaf begin-value {
                  type uint32 {
                    range "2..4294967295";
                  }
                  description
                    "The begin value of dynamic global block.";
                }
    
                leaf end-value {
                  type uint32 {
                    range "2..4294967295";
                  }
                  description
                    "The end value of dynamic global block.";
                }
    
                leaf range {
                  type uint32 {
                    range "2..4294967295";
                  }
                  description
                    "The value range of dynamic global block.";
                }
              }  // list global-block-range
            }  // container global-block-ranges
          }
        }  // rpc get-srgb-by-range
    
        rpc get-sr-states {
          description
            "Segment routing status information based on a specified address prefix.";
          input {
            leaf ip-address {
              type inet:ipv4-address-no-zone;
              mandatory true;
              description
                "The prefix IP address.";
            }
    
            leaf mask-length {
              type uint8 {
                range "1..32";
              }
              mandatory true;
              description
                "The length of prefix mask.";
            }
    
            leaf flex-algo-id {
              type uint8 {
                range "128..255";
              }
              description
                "Flexible algorithm identifier.";
            }
          }
    
          output {
            container sr-states {
              description
                "List of segment routing status information based on a specified address prefix.";
              list sr-state {
                key "ip-address mask-length flex-algo-id protocol";
                description
                  "Statistics of label for transmission.";
                leaf ip-address {
                  type inet:ipv4-address-no-zone;
                  description
                    "The prefix IP address.";
                }
    
                leaf mask-length {
                  type uint8 {
                    range "1..32";
                  }
                  description
                    "The length of prefix mask.";
                }
    
                leaf flex-algo-id {
                  type uint8 {
                    range "0|128..255";
                  }
                  description
                    "Flexible algorithm identifier.";
                }
    
                leaf protocol {
                  type string {
                    length "1..20";
                  }
                  description "Protocol.";
                }
    
                leaf process-id {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description "Process ID.";
                }
    
                leaf prefix-id {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description "Prefix SID.";
                }
    
                leaf route-active {
                  type string {
                    length "1..20";
                  }
                  description
                    "Whether a route is active.";
                }
    
                leaf eligible-within-process {
                  type string {
                    length "1..20";
                  }
                  description
                    "Whether a SID is preferentially selected within a process.";
                }
    
                leaf eligible-between-processes {
                  type string {
                    length "1..20";
                  }
                  description
                    "Whether the Segment Routing next hop is preferentially selected within a process or between protocols.";
                }
    
                leaf nexthop-exist {
                  type string {
                    length "1..20";
                  }
                  description
                    "Whether a Segment Routing next hop exists.";
                }
    
                leaf prefix-sid-within-min-srgb-range {
                  type string {
                    length "1..20";
                  }
                  description
                    "Whether a prefix SID is within the smallest SRGB scope. The smallest SRGB scope is determined among all SRGB scopes on all nodes on a whole path including the root node.";
                }
    
                leaf prefix-sid-favor-state {
                  type string {
                    length "1..20";
                  }
                  description
                    "Whether the prefix SID is preferred. If the same prefix and different SIDs are set on different nodes, a process preferentially selects an active SID based on a specified rule.";
                }
              }  // list sr-state
            }  // container sr-states
          }
        }  // rpc get-sr-states
    
        augment /ni:network-instance/ni:instances/ni:instance {
          description
            "Segment routing augment to L3VPN.";
          container segment-routing {
            when "../ni:name='_public_'";
            description
              "Configure segment routing.";
            leaf enable {
              type boolean;
              default "false";
              description
                "Enable/disable segment routing.";
            }
    
            leaf tunnel-prefer {
              when "../enable='true'";
              type enumeration {
                enum "ldp" {
                  value 1;
                  description "LDP tunnel.";
                }
                enum "sr-be" {
                  value 2;
                  description "SR BE tunnel.";
                }
              }
              default "ldp";
              description
                "Prefer segment routing tunnel.";
            }
    
            container srlbs {
              when "../enable='true'";
              description
                "List of segment routing local block.";
              list srlb {
                key "begin end";
                max-elements 1;
                description
                  "Configure segment routing local block. Currently only one configuration is supported.";
                leaf begin {
                  type uint32 {
                    range "16..1048575";
                  }
                  description
                    "SRLB begin value. The value range is determined by the PAF file of the corresponding device.
                 Special explanation:
                 Range: The range comes from PAF.";
                }
    
                leaf end {
                  type uint32 {
                    range "16..1048575";
                  }
                  description
                    "SRLB begin value. The value range is determined by the PAF file of the corresponding device.
                 Special explanation:
                 Range: The range comes from PAF.";
                }
    
                leaf ignore-conflict {
                  ext:operation-exclude "update";
                  type boolean;
                  default "false";
                  description
                    "Enable/disable flag indicating that a label conflict is ignored.";
                }
              }  // list srlb
            }  // container srlbs
    
            container bfds {
              when "../enable='true'";
              description
                "List of SRBFDS configuration.";
              list bfd {
                key "type mode-type";
                max-elements 1;
                description
                  "Configure SRBFDS configuration.";
                leaf type {
                  type bfd-type;
                  description "Sets a BFD type.";
                }
    
                leaf mode-type {
                  type enumeration {
                    enum "tunnel" {
                      value 1;
                      description
                        "The type of session mode is tunnel.";
                    }
                  }
                  description
                    "Sets a session mode.";
                }
    
                leaf ip-prefix {
                  type leafref {
                    path "/rtp:routing-policy/rtp:ipv4-prefix-filters/rtp:ipv4-prefix-filter/rtp:name";
                  }
                  description
                    "Sets a policy name.";
                }
    
                leaf min-rx {
                  type uint32 {
                    range "3..20000";
                  }
                  units "ms";
                  default "10";
                  description
                    "Sets a minimum receive interval. Different products have different value ranges.";
                }
    
                leaf min-tx {
                  type uint32 {
                    range "3..20000";
                  }
                  units "ms";
                  default "10";
                  description
                    "Sets a minimum transmit interval. Different products have different value ranges.";
                }
    
                leaf detect-multiplier {
                  type uint32 {
                    range "3..50";
                  }
                  default "3";
                  description
                    "Sets a detect multiplier.";
                }
    
                leaf effect-sr-lsp {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable effect SR BE tunnel.";
                }
    
                leaf nil-fec {
                  when "../type='bfd'";
                  type boolean;
                  default "false";
                  description
                    "Enable/disable use nil FEC.";
                }
              }  // list bfd
            }  // container bfds
    
            container traffic-stats {
              when "../enable='true'";
              description
                "Configure the stats of SR traffic.";
              leaf mode {
                type enumeration {
                  enum "none" {
                    value 0;
                    description
                      "SRBE traffic statistics are not enabled.";
                  }
                  enum "host" {
                    value 1;
                    description
                      "SRBE traffic statistics host mode.";
                  }
                  enum "ip-prefix" {
                    value 2;
                    description
                      "SRBE traffic statistics host IP prefix mode.";
                  }
                }
                must
                  "../mode!='ip-prefix' or ../prefix-name";
                default "none";
                description
                  "The stats mode of SR traffic.";
              }
    
              leaf prefix-name {
                when "../mode='ip-prefix'";
                type leafref {
                  path "/rtp:routing-policy/rtp:ipv4-prefix-filters/rtp:ipv4-prefix-filter/rtp:name";
                }
                description
                  "The name of prefix.";
              }
            }  // container traffic-stats
    
            container adjacency-sid {
              when "../enable='true'";
              description
                "Configure Segment Routing IPv4 static adjacency label.";
              container globals {
                description
                  "List of Segment Routing global linkage label.";
                list global {
                  key "local-ip-address remote-ip-address absolute-sid";
                  description
                    "Configure Segment Routing global linkage label.";
                  leaf local-ip-address {
                    type inet:ipv4-address-no-zone;
                    description
                      "Specifies the ip address of the local interface.";
                  }
    
                  leaf remote-ip-address {
                    type inet:ipv4-address-no-zone;
                    must
                      "../local-ip-address!=../remote-ip-address";
                    description
                      "Remote ip address.";
                  }
    
                  leaf absolute-sid {
                    type uint32 {
                      range "1..4294967295";
                    }
                    description
                      "Segment ID. The value range is determined by the PAF. The yang node is static-label-blocks of huawei-segment-routing.";
                  }
                }  // list global
              }  // container globals
            }  // container adjacency-sid
    
            container bindings {
              when "../enable='true'";
              description "Configure bindings.";
              container prefix-sid-mappings {
                description
                  "List of address prefix mapping SID information.";
                list prefix-sid-mapping {
                  must
                    "start-sid + range <= 65535";
                  key "ip-address mask-length algorithm";
                  description
                    "Configure address prefix mapping SID information.";
                  leaf ip-address {
                    type inet:ipv4-address-no-zone;
                    description
                      "Address prefix.";
                  }
    
                  leaf mask-length {
                    type uint8 {
                      range "32";
                    }
                    description
                      "Mask length of address, only the 32 bit mask length is supported currently.";
                  }
    
                  leaf algorithm {
                    type uint32 {
                      range "0";
                    }
                    description
                      "Prefix SID algorithm.";
                  }
    
                  leaf start-sid {
                    ext:operation-exclude "update";
                    type uint32 {
                      range "0..65534";
                    }
                    mandatory true;
                    description
                      "Start of SID index range.";
                  }
    
                  leaf range {
                    ext:operation-exclude "update";
                    type uint16 {
                      range "1..65535";
                    }
                    default "1";
                    description
                      "Number of allocated SIDs.";
                  }
    
                  leaf attach-flag {
                    ext:operation-exclude "update";
                    type boolean;
                    default "false";
                    description
                      "Enable/disable the attach flag.";
                  }
                }  // list prefix-sid-mapping
              }  // container prefix-sid-mappings
            }  // container bindings
    
            container flex-algo-sbfds {
              when "../sr:enable='true'";
              description
                "Configure sr flexible algorithm seamless bfd.";
              leaf flex-algo-id {
                type pub-type:id-range {
                  pattern
                    '((12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])?(-(12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5]))?(,((12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])(-(12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5]))?))*)|((([\+|\-](12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5]))|([\+|\-]\((12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])-(12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])\)))?(,(([\+|\-](12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5]))|([\+|\-]\((12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])-(12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])\))))*)';
                }
                description
                  "Flexible algorithm identifier.";
              }
            }  // container flex-algo-sbfds
    
            container flex-algo-traffic-statis {
              when "../sr:enable='true'";
              description
                "Configure sr flexible algorithm traffic flow statistics.";
              leaf flex-algo-id {
                type pub-type:id-range {
                  pattern
                    '((12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])?(-(12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5]))?(,((12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])(-(12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5]))?))*)|((([\+|\-](12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5]))|([\+|\-]\((12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])-(12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])\)))?(,(([\+|\-](12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5]))|([\+|\-]\((12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])-(12[8-9]|1[3-9][0-9]|2[0-4][0-9]|25[0-5])\))))*)';
                }
                description
                  "Flexible algorithm identifier.";
              }
            }  // container flex-algo-traffic-statis
    
            container static-label-blocks {
              config false;
              description
                "List of segment routing global block.";
              list static-label-block {
                key "lower-sid upper-sid";
                config false;
                description
                  "Statistics of segment routing global block. The range of global labels reserved by the local device for segment routing.";
                leaf lower-sid {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description
                    "Minimum SID available.";
                }
    
                leaf upper-sid {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description
                    "Maximum SID available.";
                }
    
                leaf range {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description
                    "Total number of SIDs available.";
                }
              }  // list static-label-block
            }  // container static-label-blocks
    
            container ipv4-state {
              config false;
              description "Statistics of IPv4.";
              container prefix-mpls-forwardings {
                description
                  "List of label for transmission.";
                list prefix-mpls-forwarding {
                  key "ip-address mask-length";
                  description
                    "Statistics of label for transmission.";
                  leaf ip-address {
                    type inet:ipv4-address-no-zone;
                    description
                      "The prefix IP address.";
                  }
    
                  leaf mask-length {
                    type uint8 {
                      range "1..32";
                    }
                    description
                      "The length of prefix mask.";
                  }
    
                  leaf flex-algo-id {
                    ext:support-filter "true";
                    type uint8 {
                      range "0|128..255";
                    }
                    description
                      "Flexible algorithm identifier.";
                  }
    
                  leaf in-label {
                    type uint32 {
                      range "1..4294967295";
                    }
                    description "In label.";
                  }
    
                  leaf out-label {
                    type string {
                      length "1..20";
                    }
                    description "Out label.";
                  }
    
                  leaf if-name {
                    type string {
                      length "1..64";
                    }
                    description
                      "Local interface.";
                  }
    
                  leaf next-hop {
                    type inet:ipv4-address-no-zone;
                    description
                      "IP address of next hop.";
                  }
    
                  leaf lsp-xc-role {
                    type string {
                      length "1..50";
                    }
                    description "Label type.";
                  }
    
                  leaf mpls-mtu {
                    type string {
                      length "1..50";
                    }
                    units "Byte";
                    description
                      "MPLS maximum transmission unit (MTU).";
                  }
    
                  leaf mtu {
                    type uint32 {
                      range "1..4294967295";
                    }
                    units "Byte";
                    description "MTU.";
                  }
    
                  leaf state {
                    type string {
                      length "1..50";
                    }
                    description "Lable state.";
                  }
                }  // list prefix-mpls-forwarding
              }  // container prefix-mpls-forwardings
    
              container bfd-states {
                config false;
                description
                  "List of queries BFD session.";
                list bfd-state {
                  key "type mode-type ip-address mask-length";
                  config false;
                  description
                    "Statistics of queries BFD session.";
                  leaf type {
                    type bfd-type;
                    description "BFD type.";
                  }
    
                  leaf mode-type {
                    type enumeration {
                      enum "tunnel" {
                        value 1;
                        description
                          "The type of session mode is tunnel.";
                      }
                    }
                    description "Session mode.";
                  }
    
                  leaf ip-address {
                    type inet:ipv4-address-no-zone;
                    description
                      "Destination IP address.";
                  }
    
                  leaf mask-length {
                    type uint8 {
                      range "1..32";
                    }
                    description
                      "IP address mask length.";
                  }
    
                  leaf state {
                    type string {
                      length "1..64";
                    }
                    description "Session state.";
                  }
    
                  leaf discriminator {
                    type uint32 {
                      range "0..4294967295";
                    }
                    description
                      "Local discriminator.";
                  }
    
                  leaf source {
                    type inet:ipv4-address-no-zone;
                    description
                      "Source IP address.";
                  }
                }  // list bfd-state
              }  // container bfd-states
    
              container adjacency-mpls-forwardings {
                config false;
                description
                  "List of label for segment routing adjacency.";
                list adjacency-mpls-forwarding {
                  key "label";
                  description
                    "Statistics of label for segment routing adjacency.";
                  leaf label {
                    type uint32 {
                      range "1..4294967295";
                    }
                    description
                      "SID specified in the IPv4 adjacency command.";
                  }
    
                  leaf if-name {
                    type string {
                      length "1..50";
                    }
                    description
                      "Local interface.";
                  }
    
                  leaf next-hop {
                    type inet:ipv4-address-no-zone;
                    description
                      "IP address of the remote interface specified in the IPv4 adjacency command.";
                  }
    
                  leaf type {
                    type string {
                      length "1..50";
                    }
                    description
                      "Connection type.";
                  }
    
                  leaf mpls-mtu {
                    type string {
                      length "1..50";
                    }
                    units "Byte";
                    description
                      "MPLS maximum transmission unit (MTU).";
                  }
    
                  leaf mtu {
                    type uint32 {
                      range "1..4294967295";
                    }
                    units "Byte";
                    description
                      "Maximum transmission unit (MTU).";
                  }
                }  // list adjacency-mpls-forwarding
              }  // container adjacency-mpls-forwardings
            }  // container ipv4-state
    
            container traffic-statistics {
              config false;
              description
                "List of SR LSP traffic statistics.";
              list traffic-statistic {
                key "ip-address mask-length lsp-type in-label out-label flex-algo-id";
                description
                  "Statistics of traffic of SR LSP.";
                leaf ip-address {
                  type inet:ipv4-address-no-zone;
                  description
                    "Specifies an interface IP address.";
                }
    
                leaf mask-length {
                  type uint32 {
                    range "0..32";
                  }
                  description
                    "Specifies a mask length.";
                }
    
                leaf lsp-type {
                  type segr-lsp-type;
                  description "LSR type.";
                }
    
                leaf in-label {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description "In label.";
                }
    
                leaf out-label {
                  type string {
                    length "1..20";
                  }
                  description "Out label.";
                }
    
                leaf flex-algo-id {
                  type uint8 {
                    range "0|128..255";
                  }
                  description
                    "Flexible algorithm identifier.";
                }
    
                leaf out-interface {
                  type string {
                    length "1..64";
                  }
                  description
                    "Outbound interface name.";
                }
    
                leaf next-hop {
                  type inet:ipv4-address-no-zone;
                  description
                    "IP address of next hop.";
                }
    
                leaf current-time {
                  type yang:date-and-time;
                  description "Current time.";
                }
    
                leaf flow-period {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description
                    "Traffic statistics period.";
                }
    
                leaf last-period-bit-rate {
                  type uint64;
                  units "bit/s";
                  description
                    "Out Bites Rate of the last period.";
                }
    
                leaf last-period-packet-rate {
                  type uint64;
                  units "pps";
                  description
                    "Out Packet Rate of the last period.";
                }
    
                leaf query-interval {
                  type uint64;
                  description "Query interval.";
                }
    
                leaf interval-bit-rate {
                  type uint64;
                  units "bit/s";
                  description
                    "Realtime period output rate.";
                }
    
                leaf interval-packet-rate {
                  type uint64;
                  units "pps";
                  description
                    "Realtime period output packet rate.";
                }
    
                leaf output-bytes {
                  type uint64;
                  description
                    "Numbers of sent bytes.";
                }
    
                leaf output-packets {
                  type uint64;
                  description
                    "Numbers of sent packets.";
                }
              }  // list traffic-statistic
            }  // container traffic-statistics
          }  // container segment-routing
        }
      }  // module huawei-segment-routing
    

© 2023 YumaWorks, Inc. All rights reserved.