From 2d3d35c1726c62b0ab8f512e3cfcbe022dfe80c6 Mon Sep 17 00:00:00 2001 From: tangjjia Date: Wed, 23 Oct 2024 06:37:50 +0000 Subject: [PATCH 1/3] Fixed some syntax errors, including enumeration and field numbering --- .../an-onit.proto | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Low Latency Measurement/Outband Network Information Telemetry/an-onit.proto b/Low Latency Measurement/Outband Network Information Telemetry/an-onit.proto index ebd4331..744ef21 100644 --- a/Low Latency Measurement/Outband Network Information Telemetry/an-onit.proto +++ b/Low Latency Measurement/Outband Network Information Telemetry/an-onit.proto @@ -17,6 +17,7 @@ message Onit { // Indicates the measure mode of an onit flow enum MeasureMode { + INVALID_ENUM_VALUE_MeasureMode = 0; MeasureModeE2e = 1; MeasureModeTrace = 2; }; @@ -53,22 +54,22 @@ message Onit { uint32 frame_length = 10 [json_name = "frame-size"]; // Number of packets in a sample interval - uint64 packet_count = 9 [json_name = "packet-count"]; + uint64 packet_count = 11 [json_name = "packet-count"]; // Number of bytes in a sample interval - uint64 byte_count = 10 [json_name = "byte-count"]; + uint64 byte_count = 12 [json_name = "byte-count"]; // Indicates the min delay of an onit flow - uint32 min_delay = 11 [json_name = "min-delay"]; + uint32 min_delay = 13 [json_name = "min-delay"]; // Indicates the max delay of an onit flow - uint32 max_delay = 12 [json_name = "max-delay"]; + uint32 max_delay = 14 [json_name = "max-delay"]; // Indicates the average delay of an onit flow - uint32 avg_delay = 13 [json_name = "avg-delay"]; + uint32 avg_delay = 15 [json_name = "avg-delay"]; // Indicates the name of an Ethernet port or gpon port - string if_name = 14 [json_name = "if-name"]; + string if_name = 16 [json_name = "if-name"]; } repeated FlowStatistic flow_statistic = 1 [json_name = "flow-statistic"]; } -- GitLab From e382c79f7dd65dd723d905bdb1d49dd81c9e33b2 Mon Sep 17 00:00:00 2001 From: tangjjia Date: Mon, 4 Nov 2024 02:56:05 +0000 Subject: [PATCH 2/3] Update 3 files - /Low Latency Measurement/Inband Network Information Telemetry/an-init.proto - /Low Latency Measurement/Inband Network Information Telemetry/an-init-common.yang - /Low Latency Measurement/Inband Network Information Telemetry/an-init.yang --- .../an-init-common.yang | 499 ++++++++++++++++++ .../an-init.proto | 117 ++++ .../an-init.yang | 42 ++ 3 files changed, 658 insertions(+) create mode 100644 Low Latency Measurement/Inband Network Information Telemetry/an-init-common.yang create mode 100644 Low Latency Measurement/Inband Network Information Telemetry/an-init.proto create mode 100644 Low Latency Measurement/Inband Network Information Telemetry/an-init.yang diff --git a/Low Latency Measurement/Inband Network Information Telemetry/an-init-common.yang b/Low Latency Measurement/Inband Network Information Telemetry/an-init-common.yang new file mode 100644 index 0000000..c054862 --- /dev/null +++ b/Low Latency Measurement/Inband Network Information Telemetry/an-init-common.yang @@ -0,0 +1,499 @@ +module an-init-common { + yang-version 1.1; + namespace "urn:an:yang:an-init-common"; + prefix init-common; + + import ietf-yang-types { + prefix yang; + } + import ietf-interfaces { + prefix if; + } + import an-init { + prefix an-init; + } + import ietf-inet-types { + prefix inet; + } + import iana-if-type { + prefix ianaift; + } + import bbf-xpon-if-type { + prefix bbf-xponift; + } + import bbf-dot1q-types { + prefix bbf-dot1qt; + } + import bbf-frame-classification { + prefix bbf-classif; + } + import an-onu-uni { + prefix an-onu-uni; + } + + organization + "ETSI"; + + contact + "Editor: Liang Zhenming, China Telecom + + + Editor: Tang Jian, China Telecom + + + Editor: Chen Ying, Huawei + + + Editor: Huang He, Huawei + + + Editor: Huang Bin, Huawei + + + Leader: Yang Ziyao, China Telecom + "; + + revision 2024-10-09 { + description + "Init revision."; + } + + typedef flow-type { + type enumeration { + enum "unidirection" { + value 2; + description + "An unidirection iNIT flow."; + } + enum "bidirection" { + value 1; + description + "A bidirection iNIT flow."; + } + } + description + "Flow type."; + } + typedef measure-mode { + type enumeration { + enum "e2e" { + value 1; + description + "E2E measure mode."; + } + enum "trace" { + value 2; + description + "Trace measure mode."; + } + } + description + "Measure mode."; + } + typedef flow-direction { + type enumeration { + enum "ingress" { + value 1; + description + "Ingress of an iNIT flow."; + } + enum "transit-input" { + value 2; + description + "Transit input of an iNIT flow."; + } + enum "transit-output" { + value 3; + description + "Transit output of an iNIT flow."; + } + enum "egress" { + value 4; + description + "Egress of an iNIT flow."; + } + } + description + "Flow direction."; + } + + typedef port-direction { + type enumeration { + enum "inbound" { + value 1; + description + "Inbound of an port."; + } + enum "outbound" { + value 2; + description + "Outbound of an port."; + } + } + description + "Port direction."; + } + + typedef port-role-type { + type enumeration { + enum "ingress-egress" { + value 1; + description + "Ingress/egress role."; + } + enum "transit" { + value 2; + description + "Transit role."; + } + } + description + "The port role type of iNIT."; + } + + typedef clock-mode { + type enumeration { + enum "unsyn" { + value 1; + description + "Clock unsynchronized mode."; + } + enum "syn" { + value 2; + description + "Clock synchronized mode."; + } + } + description + "Clock mode."; + } + + augment "/an-init:init" { + description + "The iNIT augment."; + container init-common { + description + "Configure iNIT function."; + container global { + description + "Configure global parameter of iNIT."; + leaf node-id { + type uint32 { + range "1..1048575"; + } + description + "Node ID of iNIT."; + } + leaf dynamic-flow-aging-multiplier { + type uint16 { + range "2..100"; + } + default 10; + units "times"; + description + "Multiplier of an dynamic iNIT flow age interval. If the instance interval calculation + result is less than 10 minutes, the 10 minutes shall prevail."; + } + leaf clock-mode { + type clock-mode; + default "unsyn"; + description + "Clock mode of an iNIT flow."; + } + } + container static-instances { + description + "List of static instances of iNIT."; + list static-instance { + key "instance-id"; + description + "Configure static instance of iNIT."; + leaf instance-id { + type uint32 { + range "1..1048575"; + } + must "(../../../global/node-id)"; + description + "Instance id of iNIT."; + } + leaf interval { + type uint16 { + range "1|10|30|60|300|600"; + } + units "seconds"; + default "30"; + description + "Interval of an iNIT flow."; + } + leaf measure-mode { + type measure-mode; + default "e2e"; + description + "Measure mode of an iNIT flow."; + } + leaf delay-per-packet-enable { + type boolean; + default "false"; + description + "Enable/disable delay per-packet function of an iNIT flow."; + } + container flow { + description + "Configure iNIT flow."; + leaf flow-type { + type flow-type; + mandatory true; + description + "Flow type of an iNIT flow."; + } + leaf enabled { + type boolean; + default "true"; + description + "Enable an iNIT flow."; + } + choice flow-filter { + mandatory true; + description + "Configure the filter of a flow."; + case filter-condition { + container mac-address { + leaf filter-match { + type boolean; + default "false"; + description + "This is logical operator for a filter. + When true, it indicates the filter looks for a match with + a pattern defined by the filter-field. When false, it looks + for a 'no match' with the pattern defined by the filter + field."; + } + container source-mac-address { + description + "Filter containing source MAC address."; + leaf mac-address-value { + type yang:mac-address; + description + "The value with which a comparison shall be made after + performing the bit-wise AND operation on the to be + evaluated MAC address."; + } + leaf mac-address-mask { + type yang:mac-address; + default "FF:FF:FF:FF:FF:FF"; + description + "A mask to be applied on the to be evaluated MAC address. + The mask is applied as a bit-wise AND operation."; + } + } + container destination-mac-address { + description + "Filter containing destination MAC address."; + leaf mac-address-value { + type yang:mac-address; + description + "The value with which a comparison shall be made after + performing the bit-wise AND operation on the to be + evaluated MAC address."; + } + leaf mac-address-mask { + type yang:mac-address; + default "FF:FF:FF:FF:FF:FF"; + description + "A mask to be applied on the to be evaluated MAC address. + The mask is applied as a bit-wise AND operation."; + } + } + } + + container ip-address { + must "(destination-ip or destination-ipv6 or source-ip or source-ipv6)"; + leaf filter-match { + type boolean; + default "true"; + description + "This is logical operator for a filter. + When true, it indicates the filter looks for a match with + a pattern defined by the filter-field. When false, it looks + for a 'no match' with the pattern defined by the filter field."; + } + + choice ip-address-type { + mandatory true; + description + "Configure the address of a flow."; + case ipv4-type { + description + "IPv4 condition."; + leaf source-ip { + type inet:ipv4-address-no-zone; + description + "Source IPv4 address of an iNIT flow."; + } + leaf destination-ip { + type inet:ipv4-address-no-zone; + must "../destination-ip != ../source-ip"; + mandatory true; + description + "Destination IPv4 address of an iNIT flow."; + } + leaf source-mask { + when "../source-ip"; + type uint8 { + range "1..32"; + } + default "32"; + description + "Source IPv4 address mask of an iNIT flow."; + } + leaf destination-mask { + type uint8 { + range "1..32"; + } + default "32"; + description + "Destination IPv4 address mask of an iNIT flow."; + } + } + case ipv6-type { + description + "IPv6 condition."; + leaf source-ipv6 { + type inet:ipv6-address-no-zone; + mandatory true; + description + "Source IPv6 address of an iNIT flow."; + } + leaf destination-ipv6 { + type inet:ipv6-address-no-zone; + must "../destination-ipv6 != ../source-ipv6"; + mandatory true; + description + "Destination IPv6 address of an iNIT flow."; + } + leaf source-ipv6-mask { + type uint8 { + range "32..128"; + } + default "128"; + description + "Source IPv6 address mask of an iNIT flow."; + } + leaf destination-ipv6-mask { + type uint8 { + range "32..128"; + } + default "128"; + description + "Destination IPv6 address mask of an iNIT flow."; + } + } + } + leaf protocol { + type uint8 { + range "0..254"; + } + description + "Protocol of an iNIT flow."; + } + leaf source-port { + type uint16 { + range "1..65535"; + } + must "../protocol=6 or ../protocol=17 or ../protocol=132"; + description + "Source port of an iNIT flow."; + } + leaf destination-port { + type uint16 { + range "1..65535"; + } + must "../protocol =6 or ../protocol=17 or ../protocol=132"; + description + "Destination port of an iNIT flow."; + } + leaf dscp { + type uint16 { + range "0..63"; + } + description + "DSCP of an iNIT flow."; + } + } + list vlan-tag { + key "index"; + min-elements 1; + max-elements 2; + description + "Vlan tags of the measurement frame, index 0 + indicates the outermost tag."; + leaf index { + type bbf-classif:tag-index; + must '(count(../../vlan-tag[index = 0]) > 0)' { + error-message + "An inner tag can only exist if an outer tag is also + specified."; + description + "Only allow a push of an inner tag if an outer tag is + also being pushed."; + } + description + "The index into the tag stack, outermost tag first."; + } + leaf vlan-id { + type bbf-dot1qt:vlan-id; + mandatory true; + description + "Vlan id in the tag."; + } + leaf pbit { + type bbf-dot1qt:pbit; + default "0"; + description + "Pbit in the tag."; + } + } + } + } + leaf ifname { + type if:interface-ref; + must "derived-from-or-self(/if:interfaces/if:interface[if:name = current()]/if:type,'ianaift:ethernetCsmacd') or " + + "derived-from-or-self(/if:interfaces/if:interface[if:name = current()]/if:type,'bbf-xponift:channel-group') or " + + "derived-from-or-self(/if:interfaces/if:interface[if:name = current()]/if:type,'bbf-xponift:ani') or " + + "derived-from-or-self(/if:interfaces/if:interface[if:name = current()]/if:type,'an-onu-uni:onu-urefpoint')"{ + error-message + "must reference an ethernetCsmacd interface or gpon interface."; + } + description + "Name of an Ethernet port or gpon port."; + } + leaf direction { + type port-direction; + default inbound; + description + "Inbound/outbound of an Ethernet port or gpon port."; + } + } + } + } + } + } + augment "/if:interfaces/if:interface" { + if-feature an-init:an-init; + when "derived-from-or-self(if:type, 'ianaift:ethernetCsmacd') or " + + "derived-from-or-self(if:type, 'bbf-xponift:channel-group') or " + + "derived-from-or-self(if:type, 'bbf-xponift:ani')"; + description + "The iNIT role type augment to the interface."; + container init-roles { + description + "Configure the iNIT role type applying to the interface."; + leaf role-type { + type port-role-type; + default "ingress-egress"; + description + "Specify the role type"; + } + } + } +} \ No newline at end of file diff --git a/Low Latency Measurement/Inband Network Information Telemetry/an-init.proto b/Low Latency Measurement/Inband Network Information Telemetry/an-init.proto new file mode 100644 index 0000000..30c6d06 --- /dev/null +++ b/Low Latency Measurement/Inband Network Information Telemetry/an-init.proto @@ -0,0 +1,117 @@ +syntax = "proto3"; + +package an_init; + +message Init { + message FlowStatistics { + message FlowStatistic { + // Indicates the global instance ID, it consists of node ID and instance ID + // [63.............40] [39..................20] [19..................0] + // reserved bit[63~40] [nodeId:20bit,bit[39~20]] [instanceId:20bit,bit[19~0]] + uint64 flow_id = 1; + + // Indicates the measurement period + uint32 interval = 2; + + // Indicates the measure mode of an iNIT flow + enum MeasureMode { + INVALID_ENUM_VALUE_MeasureMode = 0; + MeasureModeE2e = 1; + MeasureModeTrace = 2; + }; + MeasureMode measure_mode = 3; + + // Indicates the direction of an ethernet port or gpon port + // 1:Indicates the ingress direction of the test start or end node + // 2:Indicates the ingress direction of the intermediate node + // 3:Indicates the egress direction of the intermediate node + // 4:Indicates the egress direction of the test start or end node + enum Direction { + INVALID_ENUM_VALUE_Direction = 0; + Direction_INGRESS = 1; + Direction_TRANSITX_INPUT = 2; + Direction_TRANSITX_OUTPUT = 3; + Direction_EGRESS = 4; + }; + Direction direction = 4; + + // Indicates the source MAC + string source_mac = 5; + + // Indicates the source MAC mask + uint32 source_mac_mask = 6; + + // Indicates the destination MAC + string destination_mac = 7; + + // Indicates the destination MAC mask + uint32 destination_mac_mask = 8; + + // Indicates the type of ip address, IPV4 or IPV6 + // If the value is 0, the source_ip、destination_ip、source_mask and destination_mask are parsed based on the IPv4 address. + // If the value is 1, the source_ip、destination_ip、source_mask and destination_mask are parsed based on the IPv6 address. + enum AddressFamily { + INVALID_ENUM_VALUE_AddressFamily = 0; + AddressFamily_IPV4 = 1; + AddressFamily_IPV6 = 2; + }; + AddressFamily address_family = 9; + + // Indicates the source ip + string source_ip = 10; + + // Indicates the destination ip + string destination_ip = 11; + + // Indicates the source ip mask + uint32 source_mask = 12; + + // Indicates the destination ip mask + uint32 destination_mask = 13; + + // Indicates the source port of an iNIT flow + uint32 source_port = 14; + + // Indicates the destination port of an iNIT flow + uint32 destination_port = 15; + + // Indicates the protocol of an iNIT flow,Parse based on the protocol field in the IP header. + uint64 protocol = 16; + + // Indicates the DSCP of an iNIT flow + uint32 dscp = 17; + + // Indicates the ID of the current measurement period, The same ID can be used to associate data reported by different nodes. + uint64 period_id = 18; + + // Number of packets in a measurement period + uint64 packet_count = 19; + + // Number of bytes in a measurement period + uint64 byte_count = 20; + + // Indicates the timestamp of an iNIT flow, unit: second + uint32 timestamp_second = 21; + + // Indicates the timestamp of an iNIT flow, unit: nanosecond + uint32 timestamp_nanosecond = 22; + + // Indicates the number of out-of-order statistics + uint64 disorder_count = 23; + + // Indicates the min delay of an iNIT flow, unit: ns + uint32 min_delay = 24; + + // Indicates the max delay of an iNIT flow, unit: ns + uint32 max_delay = 25; + + // Indicates the average delay of an iNIT flow, unit: ns + uint32 avg_delay = 26; + + // Indicates the name of an Ethernet port or gpon port + string if_name = 27; + } + repeated FlowStatistic flow_statistic = 1; + } + FlowStatistics flow_statistics = 1; +} \ No newline at end of file diff --git a/Low Latency Measurement/Inband Network Information Telemetry/an-init.yang b/Low Latency Measurement/Inband Network Information Telemetry/an-init.yang new file mode 100644 index 0000000..e2248f3 --- /dev/null +++ b/Low Latency Measurement/Inband Network Information Telemetry/an-init.yang @@ -0,0 +1,42 @@ +module an-init { + namespace "urn:an:yang:an-init"; + prefix an-init; + + organization + "ETSI"; + + contact + "Editor: Liang Zhenming, China Telecom + + + Editor: Yang Ziyao, China Telecom + + + Editor: Tang Jian, China Telecom + + + Leader: Zhang Dezhi, China Telecom + "; + + revision 2024-10-09{ + description + "Init revision."; + } + + feature an-init { + description + "Device support an-init."; + } + + container init { + if-feature an-init; + leaf enabled { + type boolean; + default "true"; + description + "Enable iNIT."; + } + description + "Inband network information telemetry."; + } +} \ No newline at end of file -- GitLab From 6cc24a49e32c6aeeb2842da7d11936a0ceb937f4 Mon Sep 17 00:00:00 2001 From: tangjjia Date: Tue, 12 Nov 2024 03:32:02 +0000 Subject: [PATCH 3/3] Update file an-onit.proto --- .../an-onit.proto | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Low Latency Measurement/Outband Network Information Telemetry/an-onit.proto b/Low Latency Measurement/Outband Network Information Telemetry/an-onit.proto index 744ef21..c25294d 100644 --- a/Low Latency Measurement/Outband Network Information Telemetry/an-onit.proto +++ b/Low Latency Measurement/Outband Network Information Telemetry/an-onit.proto @@ -10,10 +10,10 @@ message Onit { // Indicates the global instance ID, it consists of node ID and instance ID // [63.............40] [39..................20] [19..................0] // reversed bit[63~40] [nodeId:20bit,bit[39~20]] [instanceId:20bit,bit[19~0]] - uint64 flow_id = 1 [json_name = "flow-id"]; + uint64 flow_id = 1; // Sample interval - uint32 interval = 2 [json_name = "interval"]; + uint32 interval = 2; // Indicates the measure mode of an onit flow enum MeasureMode { @@ -21,7 +21,8 @@ message Onit { MeasureModeE2e = 1; MeasureModeTrace = 2; }; - MeasureMode measure_mode = 3 [json_name = "measure-mode"]; + MeasureMode measure_mode = 3; + // Indicates the direction of an ethernet port or gpon port // 1:Indicates the inbound direction of the test start or end node // 2:Indicates the ingress direction of the intermediate node @@ -34,45 +35,46 @@ message Onit { Direction_TRANSITX_OUTPUT = 3; Direction_EGRESS = 4; }; - Direction direction = 4 [json_name = "direction"]; + Direction direction = 4; + // Source MAC - string source_mac = 5 [json_name = "source-mac"]; + string source_mac = 5; // Destination MAC - string destination_mac = 6 [json_name = "destination-mac"]; + string destination_mac = 6; // Vlan tag 0 - uint32 vlan_tag_0 = 7 [json_name = "vlan-tag-0"]; + uint32 vlan_tag_0 = 7; // Vlan tag 1 - uint32 vlan_tag_1 = 8 [json_name = "vlan-tag-1"]; + uint32 vlan_tag_1 = 8; // Rate of the measurement flow, unit in frames per second - uint32 rate = 9 [json_name = "rate"]; + uint32 rate = 9; // Size of the measurement frame, unit in bytes - uint32 frame_length = 10 [json_name = "frame-size"]; + uint32 frame_length = 10; // Number of packets in a sample interval - uint64 packet_count = 11 [json_name = "packet-count"]; + uint64 packet_count = 11; // Number of bytes in a sample interval - uint64 byte_count = 12 [json_name = "byte-count"]; + uint64 byte_count = 12; // Indicates the min delay of an onit flow - uint32 min_delay = 13 [json_name = "min-delay"]; + uint32 min_delay = 13; // Indicates the max delay of an onit flow - uint32 max_delay = 14 [json_name = "max-delay"]; + uint32 max_delay = 14; // Indicates the average delay of an onit flow - uint32 avg_delay = 15 [json_name = "avg-delay"]; + uint32 avg_delay = 15; // Indicates the name of an Ethernet port or gpon port - string if_name = 16 [json_name = "if-name"]; + string if_name = 16; } - repeated FlowStatistic flow_statistic = 1 [json_name = "flow-statistic"]; + repeated FlowStatistic flow_statistic = 1; } - FlowStatistics flow_statistics = 1 [json_name = "flow-statistics"]; + FlowStatistics flow_statistics = 1; } -- GitLab