diff --git a/release/models/hashing/.spec.yml b/release/models/hashing/.spec.yml new file mode 100644 index 000000000..9342d21f3 --- /dev/null +++ b/release/models/hashing/.spec.yml @@ -0,0 +1,6 @@ +- name: openconfig-hashing + docs: + - yang/hashing/openconfig-hashing.yang + build: + - yang/hashing/openconfig-hashing.yang + run-ci: true diff --git a/release/models/hashing/openconfig-hashing.yang b/release/models/hashing/openconfig-hashing.yang new file mode 100644 index 000000000..2a7f7604a --- /dev/null +++ b/release/models/hashing/openconfig-hashing.yang @@ -0,0 +1,238 @@ +module openconfig-hashing { + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/hashing"; + + prefix "oc-hashing"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Model for managing hashing policies that would be referenced by the + interfaces model."; + + + oc-ext:openconfig-version "0.1.0"; + + revision "2023-08-08" { + description "Initial hashing model."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + typedef hash-field-type-ipv4 { + type enumeration { + enum NONE { + description "Do not use any IPv4 fields in the + calculation of the hash."; + } + enum SRC_ADDRESS { + description "Use only the IPv4 source address in the + calculation of the hash."; + } + enum DST_ADDRESS { + description "Use only the IPv4 destination address in the + calculation of the hash."; + } + enum BOTH { + description "Use both the IPv4 source and + destination addresses in the calculation of the + hash."; + } + enum TARGET_DEFINED { + description "Use the default fields that are used by + the device for calculating the hash."; + } + } + description "The IPv4 fields that should be used to + compute the hash."; + } + + typedef hash-field-type-ipv6 { + type enumeration { + enum NONE { + description "Do not use any IPv6 fields in the + calculation of the hash."; + } + enum SRC_ADDRESS { + description "Use only the IPv6 source address in the + calculation of the hash."; + } + enum DST_ADDRESS { + description "Use only the IPv6 destination address in the + calculation of the hash."; + } + enum BOTH { + description "Use both the IPv6 source and + destination addresses in the calculation of the + hash."; + } + enum TARGET_DEFINED { + description "Use the default fields that are used by + the device for calculating the hash."; + } + enum FLOW_LABEL { + description "Use the flow label in the IPv6 header + to calculate the hash."; + } + } + description "The IPv6 fields that should be used to + compute the hash."; + } + + typedef hash-field-type-transport { + type enumeration { + enum NONE { + description "Do not use any transport fields in the + calculation of the hash."; + } + enum SRC_PORT { + description "Use only the source port from the + transport header in the calculation of the hash."; + } + enum DST_PORT { + description "Use only the destination port from the + transport header in the calculation of the hash."; + } + enum BOTH { + description "Use both the source and + destination ports from the transport header in + the calculation of the hash."; + } + enum TARGET_DEFINED { + description "Use the default fields that are used by + the device for calculating the hash."; + } + } + description "The trasport layer fields that should be used to + compute the hash."; + } + + grouping hashing-inputs { + description + "Top level container for inputs to be used for hashing policies."; + + leaf ipv4 { + type hash-field-type-ipv4; + description "The IPv4 fields that should be used to + compute the hash."; + } + leaf ipv6 { + type hash-field-type-ipv6; + description "The IPv6 fields that should be used to + compute the hash."; + } + leaf transport-ports { + type hash-field-type-transport; + description "The transport layer fields that should be used to + compute the hash."; + } + } + + grouping hashing-policy-config { + description + "Configuration data for hashing policies."; + + leaf name { + type string; + description + "The name of the hashing policy. + + When a configured user-controlled policy is created by the + system, it is instantiated with the same name in the + /policies/policy[name]/state list."; + } + + leaf algorithm { + type string; + description + "The algorithm used when calculating a hash based on packet headers"; + } + + leaf offset { + type uint64; + description + "The number of bits to rotate the output of the hash algorithm by + in order to get the final computed hash value"; + } + + leaf seed { + type uint64; + description + "The seed used to initialize the hash algorithm"; + } + + } + + grouping hashing-top { + description + "Top level grouping for hashing configuration and operational state + data."; + + container policies { + description + "Top level container for hashing, including configuration and + state data."; + + list policy { + key "name"; + + description + "The list of named policies to be used on the device."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "References the name of the hashing policy."; + } + container config { + description + "Configurable items at the global hash policy level."; + + uses hashing-policy-config; + } + container state { + config false; + description + "Operational state data at the global hash policy + level."; + + uses hashing-policy-config; + } + container hash-field-modes { + description + "Container for specifying inputs to be used when + calculating the hash."; + container config { + description + "Configurable items at the hashing inputs level."; + uses hashing-inputs; + } + container state { + config false; + description "Operational state data at the hashing + inputs level."; + uses hashing-inputs; + } + } + } + } + } + + uses hashing-top; +} diff --git a/release/models/interfaces/openconfig-interfaces.yang b/release/models/interfaces/openconfig-interfaces.yang index 9589c2cb2..e20f86b7e 100644 --- a/release/models/interfaces/openconfig-interfaces.yang +++ b/release/models/interfaces/openconfig-interfaces.yang @@ -13,6 +13,7 @@ module openconfig-interfaces { import openconfig-types { prefix oc-types; } import openconfig-extensions { prefix oc-ext; } import openconfig-transport-types { prefix oc-opt-types; } + import openconfig-hashing { prefix oc-hashing; } // meta organization "OpenConfig working group"; @@ -51,7 +52,12 @@ module openconfig-interfaces { Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info)."; - oc-ext:openconfig-version "3.5.0"; + oc-ext:openconfig-version "3.6.0"; + + revision "2023-08-28" { + description "Add leaf for referencing a hashing policy."; + reference "3.6.0"; + } revision "2023-07-14" { description @@ -432,6 +438,14 @@ module openconfig-interfaces { the specified mode."; } + leaf hashing-policy { + type leafref { + path "/oc-hashing:policies/oc-hashing:policy/oc-hashing:name"; + } + description "The hashing policy to be used when hashing packets coming + in on the interface."; + } + uses interface-common-config; } diff --git a/release/models/system/openconfig-system.yang b/release/models/system/openconfig-system.yang index aa9589c02..a2a78b078 100644 --- a/release/models/system/openconfig-system.yang +++ b/release/models/system/openconfig-system.yang @@ -21,6 +21,7 @@ module openconfig-system { import openconfig-messages { prefix oc-messages; } import openconfig-license { prefix oc-license; } import openconfig-network-instance { prefix oc-ni; } + import openconfig-hashing { prefix oc-hashing; } // meta organization "OpenConfig working group"; @@ -47,7 +48,12 @@ module openconfig-system { Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info)."; - oc-ext:openconfig-version "0.17.1"; + oc-ext:openconfig-version "0.17.2"; + + revision "2023-08-28" { + description "Add leaf for referencing a hashing policy."; + reference "0.17.2"; + } revision "2023-06-16" { description @@ -310,6 +316,13 @@ module openconfig-system { information such as the current system date and time, uptime, last login timestamp, etc."; } + + leaf hashing-policy { + type leafref { + path "/oc-hashing:policies/oc-hashing:policy/oc-hashing:name"; + } + description "The system default hashing policy to be used when hashing packets."; + } } grouping mount-point-state { @@ -1280,4 +1293,4 @@ module openconfig-system { // data definition statements uses system-top; -} \ No newline at end of file +}