module ietf-twamp-light { namespace "urn:ietf:params:xml:ns:yang:ietf-twamp-light"; //namespace need to be assigned by IANA prefix "ietf-twamp-light"; import ietf-inet-types { prefix inet; } import ietf-yang-types { prefix yang; } organization "IETF IPPM (IP Performance Metrics) Working Group"; contact "draft-mirsky-ippm-twamp-light-yang@tools.ietf.org"; description "TWAMP Light Data Model"; revision "2016-06-17" { description "01 version. RFC5357 is covered, including Appendix I and the Errata"; reference "draft-mirsky-ippm-twamp-light-yang"; } feature session-sender-light { description "This feature relates to the device functions as the TWAMP Light Session-Sender"; } feature session-reflector-light { description "This feature relates to the device functions as the TWAMP Light Session-Reflector"; } typedef enable { type boolean; description "enable"; } grouping maintenance-statistics { description "Maintenance statistics grouping"; leaf sent-packets { type uint32; description "Packets sent"; } leaf rcv-packets { type uint32; description "Packets received"; } leaf sent-packets-error { type uint32; description "Packets sent error"; } leaf rcv-packets-error { type uint32; description "Packets received error"; } leaf last-sent-seq { type uint32; description "Last sent sequence number"; } leaf last-rcv-seq { type uint32; description "Last received sequence number"; } } grouping delay-statistics { description "delay statistics grouping"; container delay { description "Packets transmitted delay"; leaf min { type yang:gauge32; units microseconds; description "Min of Packets transmitted delay"; } leaf max { type yang:gauge32; units microseconds; description "Max of Packets transmitted delay"; } leaf avg { type yang:gauge32; units microseconds; description "Avg of Packets transmitted delay"; } } container delay-variation { description "Packets transmitted delay variation"; leaf min { type uint32; units microseconds; description "Min of Packets transmitted delay variation"; } leaf max { type uint32; units microseconds; description "Max of Packets transmitted delay variation"; } leaf avg { type uint32; units microseconds; description "Avg of Packets transmitted delay variation"; } } } grouping session-light-parameters { description "Parameters common among Session-Sender and Session-Reflector"; leaf sender-ip { type inet:ip-address; mandatory true; description "Sender IP address"; } leaf sender-udp-port { type inet:port-number { range "49152..65535"; } mandatory true; description "Sender UDP port number"; } leaf reflector-ip { type inet:ip-address; mandatory true; description "Reflector IP address"; } leaf reflector-udp-port { type inet:port-number{ range "49152..65535"; } mandatory true; description "Reflector UDP port number"; } leaf dscp { type inet:dscp; default "0"; description "The DSCP value to be placed in the header of TWAMP UDP test packets generated by the Session-Sender. Whether Session-Reflector uses this value depends upon its local configuration"; } } /*Configuration Data*/ container twamp-light { description "Top level container for TWAMP-Light configuration"; container twamp-light-session-sender { if-feature session-sender-light; description "TWAMP-Light Session-Sender container"; leaf sender-light-enable { type enable; default "true"; description "Whether this network element is enabled to act as TWAMP-Light Sender"; } list test-session { key "session-id"; unique "sender-ip sender-udp-port reflector-ip" +" reflector-udp-port dscp"; description "This structure is a container of test session managed objects"; leaf session-id { type uint32; description "Session ID"; } leaf test-session-enable { type enable; default "true"; description "Whether this TWAMP Test session is enabled"; } leaf number-of-packets { type uint32; description "The overall number of UDP test packets to be transmitted by the sender for this test session"; } leaf packet-padding-size { type uint32; default 27; description "Size of the Packet Padding. Suggested to run Path MTU Discovery to avoid packet fragmentation in IPv4 and packet blackholing in IPv6"; } leaf session-authentication-mode { type enumeration { enum unauthenticated { description "Unauthenticated TWAMP-Light test session"; } enum authenticated { description "Authenticated TWAMP-Light test session"; } enum encrypted { description "Encrypted TWAMP-Light test session"; } } default unauthenticated; description "Authentication mode of the TWAMP-Light test session"; } leaf interval { type uint32; description "Time interval between transmission of two consecutive packets in the test session"; } uses session-light-parameters; } } container twamp-light-session-reflector { if-feature session-reflector-light; description "TWAMP-Light Session-Reflector container"; leaf reflector-light-enable { type enable; default "true"; description "Whether this network element is enabled to act as TWAMP-Light Reflector"; } leaf ref-wait { type uint32 { range 1..604800; } units seconds; default 900; description "REFWAIT(TWAMP test session timeout in seconds), the default value is 900"; } leaf reflector-light-mode-state { type enumeration { enum stateful { description "When the Session-Reflector Light is stateful, i.e. is aware of test session state"; } enum stateless { description "When the Session-Reflector is stateless and uses sequence number of the received TWAMP-Test packet as its own"; } } default stateless; description "The state of the mode of the TWAMP-Light Session-Reflector"; } leaf dscp-handling-mode { type enumeration { enum copy-received-value { description "Use DSCP value copied from received TWAMP test packet of the test session"; } enum use-configured-value { description "Use DSCP value configured for this test session on the Session-Reflector"; } } default copy-received-value; description "Session-Reflector handling of DSCP: - use value copied from received TWAMP-Test packet; - use value explicitly configured"; } list test-session { key "session-id"; unique "sender-ip sender-udp-port reflector-ip" +" reflector-udp-port dscp"; description "This structure is a container of test session managed objects"; leaf session-id { type uint32; description "Session ID"; } uses session-light-parameters; } } } /*Operational state data nodes*/ container twamp-light-state{ config "false"; description "Top level container for TWAMP-Light state data"; container twamp-light-session-sender-state { if-feature session-sender-light; description "Session-Sender container for state data"; list test-session-state{ key "session-id"; description "This structure is a container of test session managed objects"; leaf session-id { type uint32; description "Session ID"; } leaf sender-session-state { type enumeration { enum active { description "Test session is active"; } enum ready { description "Test session is idle"; } } description "State of the particular TWAMP-Light test session at the sender"; } container current-stats { description "This container contains the results for the current Measurement Interval in a Measurement session "; leaf start-time { type yang:date-and-time; mandatory true; description "The time that the current Measurement Interval started"; } leaf number-of-packets { type uint32; description "The overall number of UDP test packets to be transmitted by the sender for this test session"; } leaf packet-padding-size { type uint32; default 27; description "Size of the Packet Padding. Suggested to run Path MTU Discovery to avoid packet fragmentation in IPv4 and packet backholing in IPv6"; } leaf interval { type uint32; description "Time interval between transmission of two consecutive packets in the test session"; } leaf duplicate-packets { type uint32; description "Duplicate packets"; } leaf reordered-packets { type uint32; description "Reordered packets"; } leaf loss-packets { type uint32; description "Loss packets"; } uses session-light-parameters; uses maintenance-statistics; container two-way-delay{ description "two way delay result of the test session"; uses delay-statistics; } container one-way-delay-far-end{ description "one way delay far end of the test session"; uses delay-statistics; } container one-way-delay-near-end{ description "one way delay near end of the test session"; uses delay-statistics; } } list history-stats { key id; description "This container contains the results for the history Measurement Interval in a Measurement session "; leaf id { type uint32; description "The identifier for the Measurement Interval within this session"; } leaf end-time { type yang:date-and-time; mandatory true; description "The time that the Measurement Interval ended"; } leaf number-of-packets { type uint32; description "The overall number of UDP test packets to be transmitted by the sender for this test session"; } leaf packet-padding-size { type uint32; default 27; description "Size of the Packet Padding. Suggested to run Path MTU Discovery to avoid packet fragmentation in IPv4 and packet blackholing in IPv6"; } leaf interval { type uint32; description "Time interval between transmission of two consecutive packets in the test session"; } leaf duplicate-packets { type uint32; description "Duplicate packets"; } leaf reordered-packets { type uint32; description "Reordered packets"; } leaf loss-packets { type uint32; description "Loss packets"; } uses session-light-parameters; uses maintenance-statistics; container two-way-delay{ description "two way delay result of the test session"; uses delay-statistics; } container one-way-delay-far-end{ description "one way delay far end of the test session"; uses delay-statistics; } container one-way-delay-near-end{ description "one way delay near end of the test session"; uses delay-statistics; } } } } container twamp-light-session-reflector-state { if-feature session-reflector-light; description "TWAMP-Light Session-Reflector container for state data"; leaf reflector-light-admin-status { type boolean; mandatory "true"; description "Whether this network element is enabled to act as TWAMP-Light Reflector"; } list test-session-state { key "session-id"; description "This structure is a container of test session managed objects"; leaf session-id { type uint32; description "Session ID"; } uses maintenance-statistics; uses session-light-parameters; container one-way-delay { description "one way delay of the test session"; uses delay-statistics; } } } } rpc twamp-sender-start { description "start the configured sender session"; input { leaf session-id { type uint32; mandatory true; description "The session to be started"; } } } rpc twamp-sender-stop { description "stop the configured sender session"; input { leaf session-id { type uint32; mandatory true; description "The session to be stopped"; } } } }