diff --git a/mdd/python/translation/openconfig_xe/xe_main.py b/mdd/python/translation/openconfig_xe/xe_main.py index e0ba3be8..0eaf14e0 100644 --- a/mdd/python/translation/openconfig_xe/xe_main.py +++ b/mdd/python/translation/openconfig_xe/xe_main.py @@ -8,7 +8,7 @@ from translation.openconfig_xe.xe_routing_policy import xe_routing_policy_program_service from translation.openconfig_xe.xe_system import xe_system_program_service from translation.openconfig_xe.xe_stp import xe_stp_program_service - +from translation.openconfig_xe.xe_qos import xe_qos_program_service def check_xe_features(oc_self, nso_props) -> None: """ @@ -39,3 +39,7 @@ def check_xe_features(oc_self, nso_props) -> None: # OpenConfig System xe_system_program_service(oc_self, nso_props) + + # OpenConfig QoS + if nso_props.service.oc_qos__qos: + xe_qos_program_service(oc_self, nso_props) diff --git a/mdd/python/translation/openconfig_xe/xe_qos.py b/mdd/python/translation/openconfig_xe/xe_qos.py new file mode 100644 index 00000000..1f435e3d --- /dev/null +++ b/mdd/python/translation/openconfig_xe/xe_qos.py @@ -0,0 +1,280 @@ +# -*- mode: python; python-indent: 4 -*- +from translation.openconfig_xe.common import xe_system_get_interface_ip_address +from translation.common import get_interface_type_and_number + +dscp_dict = {8:'cs1', 10:'af11', 12:'af12', 14:'af13', 16:'cs2', 18:'af21', 20:'af22', + 22:'af23', 24:'cs3', 26:'af31', 28:'af32', 30:'af33', 32:'cs4', 34:'af41', + 36:'af42', 38:'af43', 40:'cs5', 46:'ef', 48:'cs6', 56:'cs7', 0:'default'} + +def xe_qos_program_service(self, nso_props) -> None: + """ + Program service + """ + + device_cdb = nso_props.root.devices.device[nso_props.device_name].config + + # Forwarding-groups + """ + Configure forwarding-groups + """ + for fg in nso_props.service.oc_qos__qos.forwarding_groups.forwarding_group: + if device_cdb.ios__policy_map.exists(fg.name): + del device_cdb.ios__policy_map[fg.name] + device_cdb.ios__policy_map.create(fg.name) + + # Class-map + """ + Configure classifiers + """ + list_cmap = [] + for c_map in nso_props.service.oc_qos__qos.classifiers.classifier: + pmap_cmap = {} + # Configure class-map + if device_cdb.ios__class_map.exists(c_map.name) and c_map.name != 'class-default': + del device_cdb.ios__class_map[c_map.name] + elif c_map.name == 'class-default': + for t_map in c_map.terms.term: + pmap_cmap[t_map.actions.config.target_group] = c_map.name + else: + device_cdb.ios__class_map.create(c_map.name) + for t_map in c_map.terms.term: + pmap_cmap[t_map.actions.config.target_group] = c_map.name + # Configure "match ip dscp" + if t_map.conditions.ipv4.config.protocol == 4: + # Configure multiple dscp statements + if t_map.conditions.ipv4.config.dscp_set: + for new_ip_dscp in t_map.conditions.ipv4.config.dscp_set: + new_ip_dscp = modify_dscp(new_ip_dscp) + device_cdb.ios__class_map[c_map.name].prematch = 'match-all' + device_cdb.ios__class_map[c_map.name].match.ip.dscp.create(new_ip_dscp) + # Configure single dscp statements + elif t_map.conditions.ipv4.config.dscp: + new_ip_dscp = modify_dscp(t_map.conditions.ipv4.config.dscp) + device_cdb.ios__class_map[c_map.name].prematch = 'match-all' + device_cdb.ios__class_map[c_map.name].match.ip.dscp.create( + new_ip_dscp) + # Configure "match dscp" + else: + # Configure multiple dscp statements + if t_map.conditions.ipv4.config.dscp_set: + for new_dscp in t_map.conditions.ipv4.config.dscp_set: + new_dscp = modify_dscp(new_dscp) + device_cdb.ios__class_map[c_map.name].prematch = 'match-all' + device_cdb.ios__class_map[c_map.name].match.dscp.create(new_dscp) + # Configure single dscp statements + elif t_map.conditions.ipv4.config.dscp: + new_dscp = modify_dscp(t_map.conditions.ipv4.config.dscp) + device_cdb.ios__class_map[c_map.name].prematch = 'match-all' + device_cdb.ios__class_map[c_map.name].match.dscp.create( + new_dscp) + list_cmap.append(pmap_cmap) + + # Schedulers + """ + Configure schedulers + """ + for sched_pol in nso_props.service.oc_qos__qos.scheduler_policies.scheduler_policy: + for sequence in sched_pol.schedulers.scheduler: + # Configure policy-map + p_map = device_cdb.ios__policy_map.create(sequence.output.config.output_fwd_group) + for dict_pmap_cmap in list_cmap: + if p_map.name in dict_pmap_cmap.keys() and dict_pmap_cmap[p_map.name] in sched_pol.name: + c_map = dict_pmap_cmap[p_map.name] + # Configure policy-map class-map + device_cdb.ios__policy_map[p_map.name].ios__class.create(c_map) + if sequence.config.type == 'oc-qos-types:ONE_RATE_TWO_COLOR': + if sequence.one_rate_two_color.config.queuing_behavior == 'SHAPE': + conf_shape_params(device_cdb, sequence, c_map, p_map.name) + elif sequence.one_rate_two_color.config.queuing_behavior == 'POLICE': + conf_police_params(device_cdb, sequence, c_map, p_map.name) + elif sequence.config.type == 'oc-qos-types:TWO_RATE_THREE_COLOR': + conf_police_params(device_cdb, sequence, c_map, p_map.name) + + # Interfaces + """ + Configure interfaces + """ + for interface in nso_props.service.oc_qos__qos.interfaces.interface: + if interface.output.scheduler_policy.config.name == sched_pol.name: + conf_out_service_policy(device_cdb, interface, sequence) + elif interface.input.scheduler_policy.config.name == sched_pol.name: + conf_in_service_policy(device_cdb, interface, sequence) + +def conf_shape_params(device_cdb, sequence, c_map, p_map): + + # Configure class priority + if sequence.config.priority == 'STRICT': + class_priority = device_cdb.ios__policy_map[p_map].ios__class[c_map].priority + if sequence.one_rate_two_color.config.cir_pct: + class_priority.create() + class_priority.percent = sequence.one_rate_two_color.config.cir_pct + elif sequence.one_rate_two_color.config.cir: + class_priority.create() + class_priority.kilo_bits = int(sequence.one_rate_two_color.config.cir / 1000) + if sequence.one_rate_two_color.config.bc: + class_priority.burst = sequence.one_rate_two_color.config.bc + # Configure class bandwidth + else: + class_bandwidth = device_cdb.ios__policy_map[p_map].ios__class[c_map].bandwidth + if sequence.one_rate_two_color.config.cir_pct: + class_bandwidth.percent = sequence.one_rate_two_color.config.cir_pct + elif sequence.one_rate_two_color.config.cir: + class_bandwidth.bits = sequence.one_rate_two_color.config.cir + elif sequence.one_rate_two_color.config.cir_pct_remaining: + class_bandwidth.remaining.percent.percent = sequence.one_rate_two_color.config.cir_pct_remaining + +def conf_police_params(device_cdb, sequence, c_map, p_map): + + # Configure policing one-rate-two-color + if sequence.one_rate_two_color: + # Configure cir percentage + if sequence.one_rate_two_color.config.cir_pct: + police_cir_percent = device_cdb.ios__policy_map[p_map].ios__class[c_map].police_cir_percent.police.cir.percent + police_cir_percent.percentage = sequence.one_rate_two_color.config.cir_pct + if sequence.one_rate_two_color.config.bc: + # TODO convert bytes to ms + police_cir_percent.bc = sequence.one_rate_two_color.config.bc + police_cir_percent.bc_ms.ms.create() + # Configure conform action + if sequence.one_rate_two_color.conform_action.config.set_dscp: + dscp = modify_dscp(sequence.one_rate_two_color.conform_action.config.set_dscp) + police_cir_percent.actions.conform_set_dscp_transmit.conform_action.set_dscp_transmit = dscp + # Configure exceed action + if sequence.one_rate_two_color.exceed_action: + if sequence.one_rate_two_color.exceed_action.config.set_dscp: + dscp = modify_dscp(sequence.one_rate_two_color.exceed_action.config.set_dscp) + police_cir_percent.actions.exceed_set_dscp_transmit.exceed_action.set_dscp_transmit = dscp + elif sequence.one_rate_two_color.exceed_action.config.drop: + police_cir_percent.actions.exceed_drop.exceed_action.drop.create() + # Configure cir + elif sequence.one_rate_two_color.config.cir: + police_cir = device_cdb.ios__policy_map[p_map].ios__class[c_map].police_policy_map.police + police_cir.cir = sequence.one_rate_two_color.config.cir + if sequence.one_rate_two_color.config.bc: + police_cir.bc = sequence.one_rate_two_color.config.bc + # Configure conform action + if sequence.one_rate_two_color.conform_action.config.set_dscp: + dscp = modify_dscp(sequence.one_rate_two_color.conform_action.config.set_dscp) + police_cir.actions.conform_set_dscp_transmit.conform_action.set_dscp_transmit = dscp + # Configure exceed action + if sequence.one_rate_two_color.exceed_action: + if sequence.one_rate_two_color.exceed_action.config.set_dscp: + dscp = modify_dscp(sequence.one_rate_two_color.exceed_action.config.set_dscp) + police_cir.actions.exceed_set_dscp_transmit.exceed_action.set_dscp_transmit = dscp + elif sequence.one_rate_two_color.exceed_action.config.drop: + police_cir.actions.exceed_drop.exceed_action.drop.create() + # Configure policing two-rate-three-color + if sequence.two_rate_three_color: + # Configure cir percentage + if sequence.two_rate_three_color.config.cir_pct: + police_cir_percent = device_cdb.ios__policy_map[p_map].ios__class[c_map].police_cir_percent.police.cir.percent + police_cir_percent.percentage = sequence.two_rate_three_color.config.cir_pct + if sequence.two_rate_three_color.config.bc: + # TODO convert bytes to ms + police_cir_percent.bc = sequence.two_rate_three_color.config.bc + police_cir_percent.bc_ms.ms.create() + if sequence.two_rate_three_color.config.pir_pct: + police_cir_percent.pir.percent = sequence.two_rate_three_color.config.pir_pct + if sequence.two_rate_three_color.config.be: + # TODO convert bytes to ms + police_cir_percent.pir_be.be = sequence.two_rate_three_color.config.be + police_cir_percent.pir_be_ms.ms.create() + # Configure conform action + if sequence.two_rate_three_color.conform_action.config.set_dscp: + dscp = modify_dscp(sequence.two_rate_three_color.conform_action.config.set_dscp) + police_cir_percent.actions.conform_set_dscp_transmit.conform_action.set_dscp_transmit = dscp + # Configure exceed action + if sequence.two_rate_three_color.exceed_action: + if sequence.two_rate_three_color.exceed_action.config.set_dscp: + dscp = modify_dscp(sequence.two_rate_three_color.exceed_action.config.set_dscp) + police_cir_percent.actions.exceed_set_dscp_transmit.exceed_action.set_dscp_transmit = dscp + elif sequence.two_rate_three_color.exceed_action.config.drop: + police_cir_percent.actions.exceed_drop.exceed_action.drop.create() + # Configure violate action + if sequence.two_rate_three_color.violate_action: + if sequence.two_rate_three_color.violate_action.config.set_dscp: + dscp = modify_dscp(sequence.two_rate_three_color.violate_action.config.set_dscp) + police_cir_percent.actions.violate_set_dscp_transmit.violate_action.set_dscp_transmit = dscp + elif sequence.two_rate_three_color.violate_action.config.drop: + police_cir_percent.actions.violate_drop.violate_action.drop.create() + # Configure cir + elif sequence.two_rate_three_color.config.cir: + police_cir = device_cdb.ios__policy_map[p_map].ios__class[c_map].police_policy_map.police + police_cir.cir = sequence.two_rate_three_color.config.cir + if sequence.two_rate_three_color.config.bc: + police_cir.bc = sequence.two_rate_three_color.config.bc + if sequence.two_rate_three_color.config.pir: + police_cir.pir = sequence.two_rate_three_color.config.pir + if sequence.two_rate_three_color.config.be: + police_cir.pir_be.be = sequence.two_rate_three_color.config.be + # Configure conform action + if sequence.two_rate_three_color.conform_action.config.set_dscp: + dscp = modify_dscp(sequence.two_rate_three_color.conform_action.config.set_dscp) + police_cir.actions.conform_set_dscp_transmit.conform_action.set_dscp_transmit = dscp + # Configure exceed action + if sequence.two_rate_three_color.exceed_action: + if sequence.two_rate_three_color.exceed_action.config.set_dscp: + dscp = modify_dscp(sequence.two_rate_three_color.exceed_action.config.set_dscp) + police_cir.actions.exceed_set_dscp_transmit.exceed_action.set_dscp_transmit = dscp + elif sequence.two_rate_three_color.exceed_action.config.drop: + police_cir.actions.exceed_drop.exceed_action.drop.create() + # Configure violate action + if sequence.two_rate_three_color.violate_action: + if sequence.two_rate_three_color.violate_action.config.set_dscp: + dscp = modify_dscp(sequence.two_rate_three_color.violate_action.config.set_dscp) + police_cir.actions.violate_set_dscp_transmit.violate_action.set_dscp_transmit = dscp + elif sequence.two_rate_three_color.exceed_action.config.drop: + police_cir.actions.violate_drop.violate_action.drop.create() + +def conf_out_service_policy(device_cdb, interface, sequence): + + interface_type, interface_number = get_interface_type_and_number(interface.config.interface_id) + + # Configure service-policy output + device_int = device_cdb.ios__interface + if interface_type == 'GigabitEthernet': + device_int.GigabitEthernet.create(interface_number) + device_int.GigabitEthernet[interface_number].service_policy.output = sequence.output.config.output_fwd_group + elif interface_type == 'Port_channel': + device_int.Port_channel.create(interface_number) + device_int.Port_channel[interface_number].service_policy.output = sequence.output.config.output_fwd_group + elif interface_type == 'Loopback': + device_int.Loopback.create(interface_number) + if sequence.one_rate_two_color.config.queuing_behavior == 'POLICE' or sequence.two_rate_three_color: + device_int.Loopback[interface_number].service_policy.output = sequence.output.config.output_fwd_group + elif interface_type == 'Tunnel': + device_int.Tunnel.create(interface_number) + device_int.Tunnel[interface_number].service_policy.output = sequence.output.config.output_fwd_group + else: + raise ValueError( + f'Interface type {interface_type} not supported by this NSO_OC_Services implementation. Please file an issue at https://github.com/model-driven-devops/nso-oc-services') + +def conf_in_service_policy(device_cdb, interface, sequence): + + interface_type, interface_number = get_interface_type_and_number(interface.config.interface_id) + + # Configure service-policy-input + device_int = device_cdb.ios__interface + if interface_type == 'GigabitEthernet': + device_int.GigabitEthernet.create(interface_number) + if sequence.one_rate_two_color.config.queuing_behavior == 'POLICE' or sequence.two_rate_three_color: + device_int.GigabitEthernet[interface_number].service_policy.input = sequence.output.config.output_fwd_group + elif interface_type == 'Port_channel': + device_int.Port_channel.create(interface_number) + device_int.Port_channel[interface_number].service_policy.input = sequence.output.config.output_fwd_group + elif interface_type == 'Loopback': + device_int.Loopback.create(interface_number) + if sequence.one_rate_two_color.config.queuing_behavior == 'POLICE' or sequence.two_rate_three_color: + device_int.Loopback[interface_number].service_policy.input = sequence.output.config.output_fwd_group + elif interface_type == 'Tunnel': + device_int.Tunnel.create(interface_number) + if sequence.one_rate_two_color.config.queuing_behavior == 'POLICE' or sequence.two_rate_three_color: + device_int.Tunnel[interface_number].service_policy.input = sequence.output.config.output_fwd_group + else: + raise ValueError( + f'Interface type {interface_type} not supported by this NSO_OC_Services implementation. Please file an issue at https://github.com/model-driven-devops/nso-oc-services') + +def modify_dscp(dscp): + if (dscp % 2) != 0: + return dscp + return dscp_dict.get(dscp, 'default') \ No newline at end of file diff --git a/mdd/src/Makefile b/mdd/src/Makefile index fabb486f..fd5f552e 100644 --- a/mdd/src/Makefile +++ b/mdd/src/Makefile @@ -21,7 +21,8 @@ OC_MODELS = $(filter-out %aaa-tacacs.yang %aaa-radius.yang %grpc.yang, $(wildcar $(filter-out %if-8021X.yang %if-ethernet-ext.yang %if-ip-ext.yang %if-sdn-ext.yang, $(wildcard yang/openconfig/interfaces/*.yang)) \ $(wildcard yang/openconfig/vlan/*.yang) \ $(wildcard yang/openconfig/stp/*.yang) \ - $(wildcard yang/openconfig/multicast/*.yang) \ + $(filter-out %openconfig-qos-interfaces.yang %openconfig-qos-elements.yang, $(wildcard yang/openconfig/qos/*.yang)) \ + $(wildcard yang/openconfig/multicast/*.yang) \ $(filter-out %system-ext-sub-nat.yang, $(wildcard yang/extensions/*.yang)) # Not used diff --git a/mdd/src/yang/openconfig/qos/openconfig-qos-elements.yang b/mdd/src/yang/openconfig/qos/openconfig-qos-elements.yang index 08fe2c95..fb42137c 100644 --- a/mdd/src/yang/openconfig/qos/openconfig-qos-elements.yang +++ b/mdd/src/yang/openconfig/qos/openconfig-qos-elements.yang @@ -17,7 +17,7 @@ submodule openconfig-qos-elements { contact "OpenConfig working group - www.openconfig.net"; + netopenconfig@googlegroups.com"; description "This submodule defines configuration and operational state @@ -36,44 +36,7 @@ submodule openconfig-qos-elements { packets for transmission, including policer and shaper functions"; - oc-ext:openconfig-version "0.8.0"; - - revision "2023-02-17" { - description - "Add queue identifier."; - reference "0.8.0"; - } - - revision "2023-02-08" { - description - "Remove incorrect output placement of interface-ref"; - reference "0.7.0"; - } - - revision "2023-01-28" { - description - "Split groupings in interfaces for better leaf reuse."; - reference "0.6.1"; - } - - revision "2022-09-13" { - description - "Add queue octet drop counter."; - reference "0.6.0"; - } - - revision "2021-08-28" { - description - "Revision updating memory management profile WRED and RED configuration."; - reference "0.5.0"; - } - - revision "2021-04-28" { - description - "Revision updating buffer management and queue management - configuration."; - reference "0.3.0"; - } + oc-ext:openconfig-version "0.2.3"; revision "2019-11-28" { description @@ -372,33 +335,7 @@ submodule openconfig-qos-elements { path "../../../../queues/queue/config/name"; } description - "Output queue for packets in this forwarding group. - This leaf applies to both multicast and unicast - packets. Where a user or system requires separate - queueing for multicast and unicast the unicast-output-queue - and multicast-output-queue leaves should be specified."; - } - - leaf unicast-output-queue { - type leafref { - path "../../../../queues/queue/config/name"; - } - description - "Output queue for unicast packets within this - forwarding group. Where an operator or system does - not require separate queueing for multicast and - unicast this leaf is not specified."; - } - - leaf multicast-output-queue { - type leafref { - path "../../../../queues/queue/config/name"; - } - description - "Output queue for multicast packets within this - forwarding group. Where an operator or system does - not require separate queueing for multicast and - unicast this leaf is not specified."; + "Queue for packets in this forwarding group."; } } @@ -456,7 +393,7 @@ submodule openconfig-qos-elements { leaf enable-ecn { type boolean; - default false; + //default false; description "When set to true, the device should mark packets that are ECN-capable rather than dropping them. The receiver is @@ -579,11 +516,13 @@ submodule openconfig-qos-elements { description "User-defined name of the queue"; } - leaf queue-id { - type uint8; + + leaf queue-type { + type identityref { + base oc-qos-types:QOS_QUEUE_TYPE; + } description - "An optional identifier which may be required by some hardware to map - the named queue to a hardware queue"; + "Sets the type of the queue"; } } @@ -628,6 +567,21 @@ submodule openconfig-qos-elements { uses qos-queue-config; uses qos-queue-state; } + + uses qos-queue-red-top { + when "./config/queue-type = 'oc-qos-types:RED'" { + description + "RED configuration is valid when the queue-type + is set accordingly."; + } + } + uses qos-queue-wred-top { + when "./config/queue-type = 'oc-qos-types:WRED'" { + description + "WRED configuration is valid when the queue-type + is set accordingly."; + } + } } } } @@ -660,11 +614,6 @@ submodule openconfig-qos-elements { } leaf child-scheduler { - when "../output-type = 'SCHEDULER'" { - description - "The child-scheduler leaf is valid only when - the output type of the scheduler is a child scheduler"; - } // TODO: consider whether both child (output) and parent // (input) references are needed; consider whether child // reference should separate in-profile and out-of-profile @@ -675,6 +624,11 @@ submodule openconfig-qos-elements { path "../../../../../../../scheduler-policies/scheduler-policy/" + "config/name"; } + when "../output-type = 'SCHEDULER'" { + description + "The child-scheduler leaf is valid only when + the output type of the scheduler is a child scheduler"; + } description "When the scheduler output type is a child scheduler, this leaf provides a reference to the downstream @@ -682,16 +636,16 @@ submodule openconfig-qos-elements { } leaf output-fwd-group { + type leafref { + path "../../../../../../../forwarding-groups/forwarding-group" + + "/config/name"; + } when "../output-type = 'FWD_GROUP'" { description "The output-fwd-group leaf is valid only when the output type of the scheduler is a forwarding group"; } - type leafref { - path "../../../../../../../forwarding-groups/forwarding-group" + - "/config/name"; - } - description + description "When the scheduler output type is a forwarding group, this leaf provides a reference to the forwarding group."; } @@ -760,16 +714,16 @@ submodule openconfig-qos-elements { } leaf queue { - when "../input-type = 'QUEUE'" { - description - "The queue leaf is valid only when - the input type of the scheduler is a queue"; - } type leafref { // current loc: /qos/scheduler-policies/scheduler-policy/schedulers/ // scheduler/inputs/input/config/queue path "../../../../../../../../queues/queue/name"; } + when "../input-type = 'QUEUE'" { + description + "The queue leaf is valid only when + the input type of the scheduler is a queue"; + } description "Reference to a queue that is an input source for the scheduler"; diff --git a/mdd/src/yang/openconfig/qos/openconfig-qos-interfaces.yang b/mdd/src/yang/openconfig/qos/openconfig-qos-interfaces.yang index e6bc4ea4..821e8962 100644 --- a/mdd/src/yang/openconfig/qos/openconfig-qos-interfaces.yang +++ b/mdd/src/yang/openconfig/qos/openconfig-qos-interfaces.yang @@ -17,57 +17,14 @@ submodule openconfig-qos-interfaces { contact "OpenConfig working group - www.openconfig.net"; + netopenconfig@googlegroups.com"; description "This submodule defines data related to quality-of-service configuration and operational state associated with interfaces."; - oc-ext:openconfig-version "0.8.0"; - - revision "2023-02-17" { - description - "Add queue identifier."; - reference "0.8.0"; - } - - revision "2023-02-08" { - description - "Remove incorrect output placement of interface-ref"; - reference "0.7.0"; - } - - revision "2023-01-28" { - description - "Split groupings in interfaces for better leaf reuse."; - reference "0.6.1"; - } - - revision "2022-09-13" { - description - "Add queue octet drop counter."; - reference "0.6.0"; - } - - revision "2021-08-28" { - description - "Revision updating memory management profile WRED and RED configuration."; - reference "0.5.0"; - } - - revision "2021-04-28" { - description - "Updating memory management profile to queue management profile."; - reference "0.4.0"; - } - - revision "2021-04-28" { - description - "Revision updating buffer management and queue management - configuration."; - reference "0.3.0"; - } + oc-ext:openconfig-version "0.2.3"; revision "2019-11-28" { description @@ -99,9 +56,9 @@ submodule openconfig-qos-interfaces { reference "0.1.0"; } - grouping qos-interface-classifier-match-state { + grouping qos-interface-classifier-match-config { description - "Operational state data for match terms in the classifier + "Configuration data for match terms in the classifier associated with an interface"; leaf id { @@ -117,13 +74,12 @@ submodule openconfig-qos-interfaces { description "Reference to match terms in the classifier"; } - - uses qos-interface-classifier-match-counters-state; } - grouping qos-interface-classifier-match-counters-state { + grouping qos-interface-classifier-match-state { description - "Grouping for counters relating to QoS classifier match terms."; + "Operational state data for match terms in the classifier + associated with an interface"; leaf matched-packets { type oc-yang:counter64; @@ -153,25 +109,33 @@ submodule openconfig-qos-interfaces { list term { key "id"; - config false; description "List of match terms in the classifier associated with the interface"; leaf id { type leafref { - path "../state/id"; + path "../config/id"; } description "Reference to match term id list key"; } + container config { + description + "Configuration data for match terms in the classifier + associated with an interface"; + + uses qos-interface-classifier-match-config; + } + container state { config false; description "Operational state data for match terms in the classifier associated with an interface"; + uses qos-interface-classifier-match-config; uses qos-interface-classifier-match-state; } } @@ -237,27 +201,19 @@ submodule openconfig-qos-interfaces { leaf type { type enumeration { enum IPV4 { - value 4; description - "Classifier matches IPv4 Unicast packets."; + "Classifier matches IPv4 packets."; + value 4; } enum IPV6 { - value 6; description - "Classifier matches IPv6 Unicast packets."; + "Classifier matches IPv6 packets."; + value 6; } enum MPLS { description "Classifier matches MPLS packets."; } - enum IPV4_MULTICAST { - description - "Classifier matches IPv4 Multicast packets."; - } - enum IPV6_MULTICAST { - description - "Classifier matches IPv6 Multicast packets."; - } } description "Type of packets matched by the classifier."; @@ -266,8 +222,8 @@ submodule openconfig-qos-interfaces { grouping qos-interface-queue-config { description - "Configuration data for queues associated with the - interface, this is re-used across input/output queues."; + "Configuration data for the queue associated with the + interface"; leaf name { // TODO(robjs): Previously we proposed that the queue name here is @@ -286,33 +242,6 @@ submodule openconfig-qos-interfaces { } } - grouping qos-interface-queue-root-config { - description - "Configuration parameters for per-queue per-interface, applying - only to the root."; - - leaf queue-management-profile { - type leafref { - // we are at /qos/interfaces/interface/{input,output}/queues/queue/config/queue-management-profile - path "../../../../../../../queue-management-profiles/" + - "queue-management-profile/config/name"; - } - description - "The queue management profile that is to be used for the queue - on the interface. - - For example, the system may use a profile which specifies that - WRED curves are used for setting an ECN mark in the IP header - instead of dropping a packet in order to signal impending - congestion and for determining when there is sufficient - congestion to tail drop packets. - - A single profile is available per queue - which applies to all packets - that are enqueued to the specified queue, whether they are unicast or - multicast."; - } - } - grouping qos-interface-queue-state { description "Operational state data for the queue associated with the @@ -350,12 +279,6 @@ submodule openconfig-qos-interfaces { description "Number of packets dropped by the queue due to overrun"; } - - leaf dropped-octets { - type oc-yang:counter64; - description - "Number of octets dropped by the queue due to overrun"; - } } grouping qos-interface-queue-top { @@ -405,56 +328,6 @@ submodule openconfig-qos-interfaces { } } - grouping qos-interface-queue-root-top { - description - "Top-level grouping for the queue associated with the - interface - used only for /qos/interfaces/interface rather - than in multiple contexts."; - - container queues { - description - "Surrounding container for a list of queues that are - instantiated on an interface."; - - list queue { - key "name"; - - description - "Top-level container for the queue associated with this - interface"; - - leaf name { - type leafref { - path "../config/name"; - } - description - "Reference to the name of the queue - instantiated on the interface."; - } - - container config { - description - "Configuration data for the queue associated with the - interface"; - - uses qos-interface-queue-config; - uses qos-interface-queue-root-config; - } - - container state { - config false; - description - "Operational state data for the queue associated with the - interface"; - - uses qos-interface-queue-config; - uses qos-interface-queue-root-config; - uses qos-interface-queue-state; - } - } - } - } - grouping qos-interface-voqs-top { description "Structural grouping of virtual-output-queue operational state @@ -675,75 +548,6 @@ submodule openconfig-qos-interfaces { grouping qos-interface-input-config { description "Configuration data for QoS on ingress interface"; - - leaf buffer-allocation-profile { - type leafref { - // we are at - // /qos/interfaces/interface/input/config/buffer-allocation-profile - path "../../../../../buffer-allocation-profiles/" + - "buffer-allocation-profile/config/name"; - } - description - "The buffer allocation profile that is to be used for the interface. - This profile specifies how memory that is available to the interface - should be allocated amongst the queues that are instantiated on the - interface. - - This reference specifies the policy that should be used for memory - allocated to the input (rx) queueing. - - This leaf is used in deployment cases where the operator or system - requires common allocation profiles covering unicast and multicast - packets."; - } - - leaf multicast-buffer-allocation-profile { - type leafref { - // we are at - // /qos/interfaces/interface/input/config/multicast-buffer-allocation-profile - path "../../../../../buffer-allocation-profiles/" + - "buffer-allocation-profile/config/name"; - } - description - "The buffer allocation profile that is to be used for the interface. - This profile specifies how memory that is available to the interface - should be allocated amongst the queues that are instantiated on the - interface. - - This reference specifies the policy that should be used for memory - allocated to the output (tx) queueing. - - This buffer allocation profile applies to only multicast packets on - the interface - if specified, the unicast-buffer-allocation-profile - governs the allocation profile used for memory dedicated to unicast. - If a system does not support, or an operator does not require separate - buffer-allocation-profiles, this is specified by use of the - buffer-allocation-profile leaf."; - } - - leaf unicast-buffer-allocation-profile { - type leafref { - // we are at - // /qos/interfaces/interface/input/config/unicast-buffer-allocation-profile - path "../../../../../buffer-allocation-profiles/" + - "buffer-allocation-profile/config/name"; - } - description - "The buffer allocation profile that is to be used for the interface. - This profile specifies how memory that is available to the interface - should be allocated amongst the queues that are instantiated on the - interface. - - This reference specifies the policy that should be used for memory - allocated to the output (tx) queueing. - - This buffer allocation profile applies to only unicast packets on - the interface - if specified, the multicast-buffer-allocation-profile - governs the allocation profile used for memory dedicated to multicast. - If a system does not support, or an operator does not require separate - buffer-allocation-profiles, this is specified by use of the - buffer-allocation-profile leaf."; - } } grouping qos-interface-input-state { @@ -777,7 +581,7 @@ submodule openconfig-qos-interfaces { } uses qos-interface-classifier-top; - uses qos-interface-queue-root-top; + uses qos-interface-queue-top; uses qos-interface-scheduler-top; uses qos-interface-voqs-top; } @@ -786,75 +590,6 @@ submodule openconfig-qos-interfaces { grouping qos-interface-output-config { description "Configuration data for QoS on the egress interface"; - - leaf buffer-allocation-profile { - type leafref { - // we are at - // /qos/interfaces/interface/output/config/buffer-allocation-profile - path "../../../../../buffer-allocation-profiles/" + - "buffer-allocation-profile/config/name"; - } - description - "The buffer allocation profile that is to be used for the interface. - This profile specifies how memory that is available to the interface - should be allocated amongst the queues that are instantiated on the - interface. - - This reference specifies the policy that should be used for memory - allocated to the output (tx) queueing. - - This leaf is used in deployment cases where the operator or system - requires common allocation profiles covering unicast and multicast - packets."; - } - - leaf multicast-buffer-allocation-profile { - type leafref { - // we are at - // /qos/interfaces/interface/output/config/buffer-allocation-profile - path "../../../../../buffer-allocation-profiles/" + - "buffer-allocation-profile/config/name"; - } - description - "The buffer allocation profile that is to be used for the interface. - This profile specifies how memory that is available to the interface - should be allocated amongst the queues that are instantiated on the - interface. - - This reference specifies the policy that should be used for memory - allocated to the output (tx) queueing. - - This buffer allocation profile applies to only multicast packets on - the interface - if specified, the unicast-buffer-allocation-profile - governs the allocation profile used for memory dedicated to unicast. - If a system does not support, or an operator does not require separate - buffer-allocation-profiles, this is specified by use of the - buffer-allocation-profile leaf."; - } - - leaf unicast-buffer-allocation-profile { - type leafref { - // we are at - // /qos/interfaces/interface/output/config/buffer-allocation-profile - path "../../../../../buffer-allocation-profiles/" + - "buffer-allocation-profile/config/name"; - } - description - "The buffer allocation profile that is to be used for the interface. - This profile specifies how memory that is available to the interface - should be allocated amongst the queues that are instantiated on the - interface. - - This reference specifies the policy that should be used for memory - allocated to the output (tx) queueing. - - This buffer allocation profile applies to only unicast packets on - the interface - if specified, the multicast-buffer-allocation-profile - governs the allocation profile used for memory dedicated to multicast. - If a system does not support, or an operator does not require separate - buffer-allocation-profiles, this is specified by use of the - buffer-allocation-profile leaf."; - } } grouping qos-interface-output-state { @@ -887,8 +622,9 @@ submodule openconfig-qos-interfaces { uses qos-interface-output-state; } + uses oc-if:interface-ref; uses qos-interface-classifier-top; - uses qos-interface-queue-root-top; + uses qos-interface-queue-top; uses qos-interface-scheduler-top; } } @@ -934,8 +670,9 @@ submodule openconfig-qos-interfaces { uses oc-if:interface-ref; uses qos-interface-input-top; uses qos-interface-output-top; + } } } -} \ No newline at end of file +} diff --git a/mdd/src/yang/openconfig/qos/openconfig-qos-types.yang b/mdd/src/yang/openconfig/qos/openconfig-qos-types.yang index c178af89..c6ebde43 100644 --- a/mdd/src/yang/openconfig/qos/openconfig-qos-types.yang +++ b/mdd/src/yang/openconfig/qos/openconfig-qos-types.yang @@ -156,4 +156,4 @@ module openconfig-qos-types { // notification statements -} \ No newline at end of file +} diff --git a/mdd/src/yang/openconfig/qos/openconfig-qos.yang b/mdd/src/yang/openconfig/qos/openconfig-qos.yang index e472a95d..0bbdd7c3 100644 --- a/mdd/src/yang/openconfig/qos/openconfig-qos.yang +++ b/mdd/src/yang/openconfig/qos/openconfig-qos.yang @@ -28,51 +28,7 @@ module openconfig-qos { "This module defines configuration and operational state data related to network quality-of-service."; - oc-ext:openconfig-version "0.8.0"; - - revision "2023-02-17" { - description - "Add queue identifier."; - reference "0.8.0"; - } - - revision "2023-02-08" { - description - "Remove incorrect output placement of interface-ref"; - reference "0.7.0"; - } - - revision "2023-01-28" { - description - "Split groupings in interfaces for better leaf reuse."; - reference "0.6.1"; - } - - revision "2022-09-13" { - description - "Add queue octet drop counter."; - reference "0.6.0"; - } - - revision "2021-08-28" { - description - "Revision using latest revision of openconfig-qos-mem-mgmt submodule."; - reference "0.5.0"; - } - - revision "2021-06-28" { - description - "Revision to include buffer-allocation-profile-q-config - parameters in openconfig-qos-mem-mgmt submodule."; - reference "0.4.0"; - } - - revision "2021-04-28" { - description - "Revision updating buffer management and queue management - configuration."; - reference "0.3.0"; - } + oc-ext:openconfig-version "0.2.3"; revision "2019-11-28" { description @@ -143,7 +99,6 @@ module openconfig-qos { uses qos-forwarding-group-top; uses qos-queue-top; uses qos-scheduler-top; - uses qos-buffer-profile-top; } } diff --git a/test/tests/xe/xe_qos.yml b/test/tests/xe/xe_qos.yml new file mode 100644 index 00000000..f7b88d16 --- /dev/null +++ b/test/tests/xe/xe_qos.yml @@ -0,0 +1,792 @@ +--- +- hosts: nso + connection: local + gather_facts: no + roles: + - nso-rollback-save + run_once: true + vars: + rollback_file: "{{ lookup('env', 'PWD') }}/rollback.yaml" + +- name: test QOS + hosts: "{{ lookup('env', 'TEST_DEVICE_XEROUTER') | default('xe1', True) }}" + gather_facts: no + connection: network_cli + vars: + device: "{{ lookup('env', 'TEST_DEVICE_XEROUTER') | default('xe1', True) }}" + ansible_network_os: 'cisco.ios.ios' + tasks: + - name: test qos_policy_maps + tags: + - qos_policy_maps + import_role: + name: nso-openconfig-test + vars: + content: | + mdd:openconfig: + openconfig-qos:qos: + openconfig-qos:forwarding-groups: + openconfig-qos:forwarding-group: + - openconfig-qos:name: 'pm-ip-dscp-11' + openconfig-qos:config: + openconfig-qos:name: 'pm-ip-dscp-11' + - openconfig-qos:name: 'pm-ip-dscp-af11' + openconfig-qos:config: + openconfig-qos:name: 'pm-ip-dscp-af11' + - openconfig-qos:name: 'pm-dscp-13-15' + openconfig-qos:config: + openconfig-qos:name: 'pm-dscp-13-15' + - openconfig-qos:name: 'pm-dscp-af12-af13' + openconfig-qos:config: + openconfig-qos:name: 'pm-dscp-af12-af13' + - openconfig-qos:name: 'pm-dscp-19' + openconfig-qos:config: + openconfig-qos:name: 'pm-dscp-19' + - openconfig-qos:name: 'pm-dscp-21' + openconfig-qos:config: + openconfig-qos:name: 'pm-dscp-21' + - openconfig-qos:name: 'pm-dscp-23' + openconfig-qos:config: + openconfig-qos:name: 'pm-dscp-23' + - openconfig-qos:name: 'pm-dscp-25' + openconfig-qos:config: + openconfig-qos:name: 'pm-dscp-25' + - openconfig-qos:name: 'pm-dscp-31' + openconfig-qos:config: + openconfig-qos:name: 'pm-dscp-31' + - openconfig-qos:name: 'pm-class-default-01' + openconfig-qos:config: + openconfig-qos:name: 'pm-class-default-01' + - openconfig-qos:name: 'pm-class-default-02' + openconfig-qos:config: + openconfig-qos:name: 'pm-class-default-02' + openconfig-qos:classifiers: + openconfig-qos:classifier: + - openconfig-qos:name: 'class-default' + openconfig-qos:config: + openconfig-qos:name: 'class-default' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-default-01' + openconfig-qos:config: + openconfig-qos:id: 'term-default-01' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '1' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-class-default-01' + - openconfig-qos:id: 'term-default-02' + openconfig-qos:config: + openconfig-qos:id: 'term-default-02' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '1' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-class-default-02' + - openconfig-qos:id: 'term-default-03' + openconfig-qos:config: + openconfig-qos:id: 'term-default-03' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '1' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-ip-dscp-af11' + - openconfig-qos:name: 'cm-ip-dscp-11' + openconfig-qos:config: + openconfig-qos:name: 'cm-ip-dscp-11' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-ip-dscp-11' + openconfig-qos:config: + openconfig-qos:id: 'term-ip-dscp-11' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '11' + openconfig-qos:protocol: 4 # IPv4 + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-ip-dscp-11' + - openconfig-qos:name: 'cm-ip-dscp-af11' + openconfig-qos:config: + openconfig-qos:name: 'cm-ip-dscp-af11' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-ip-dscp-af11' + openconfig-qos:config: + openconfig-qos:id: 'term-ip-dscp-af11' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '10' + openconfig-qos:protocol: 4 # IPv4 + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-ip-dscp-af11' + - openconfig-qos:id: 'term-ip-dscp-11' + openconfig-qos:config: + openconfig-qos:id: 'term-ip-dscp-11' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '10' + openconfig-qos:protocol: 4 # IPv4 + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-ip-dscp-11' + - openconfig-qos:name: 'cm-dscp-13-15' + openconfig-qos:config: + openconfig-qos:name: 'cm-dscp-13-15' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-dscp-13-15' + openconfig-qos:config: + openconfig-qos:id: 'term-dscp-13-15' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp-set: + - '13' + - '15' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-dscp-13-15' + - openconfig-qos:id: 'term-dscp-af12-af13' + openconfig-qos:config: + openconfig-qos:id: 'term-dscp-af12-af13' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp-set: + - '13' + - '15' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-dscp-af12-af13' + - openconfig-qos:name: 'cm-dscp-af12-af13' + openconfig-qos:config: + openconfig-qos:name: 'cm-dscp-af12-af13' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-dscp-af12-af13' + openconfig-qos:config: + openconfig-qos:id: 'term-dscp-af12-af13' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp-set: + - '12' + - '14' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-dscp-af12-af13' + - openconfig-qos:name: 'cm-dscp-19' + openconfig-qos:config: + openconfig-qos:name: 'cm-dscp-19' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-dscp-19' + openconfig-qos:config: + openconfig-qos:id: 'term-dscp-19' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '19' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-dscp-19' + - openconfig-qos:name: 'cm-dscp-21' + openconfig-qos:config: + openconfig-qos:name: 'cm-dscp-21' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-dscp-21' + openconfig-qos:config: + openconfig-qos:id: 'term-dscp-21' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '21' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-dscp-21' + - openconfig-qos:name: 'cm-dscp-23' + openconfig-qos:config: + openconfig-qos:name: 'cm-dscp-23' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-dscp-23' + openconfig-qos:config: + openconfig-qos:id: 'term-dscp-23' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '23' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-dscp-23' + - openconfig-qos:name: 'cm-dscp-25' + openconfig-qos:config: + openconfig-qos:name: 'cm-dscp-25' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-dscp-25' + openconfig-qos:config: + openconfig-qos:id: 'term-dscp-25' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '25' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-dscp-25' + - openconfig-qos:name: 'cm-dscp-31' + openconfig-qos:config: + openconfig-qos:name: 'cm-dscp-31' + openconfig-qos:type: 'IPV4' + openconfig-qos:terms: + openconfig-qos:term: + - openconfig-qos:id: 'term-dscp-31' + openconfig-qos:config: + openconfig-qos:id: 'term-dscp-31' + openconfig-qos:conditions: + openconfig-qos:ipv4: + openconfig-qos:config: + openconfig-qos:dscp: '34' + openconfig-qos:actions: + openconfig-qos:config: + openconfig-qos:target-group: 'pm-dscp-31' + openconfig-qos:scheduler-policies: + openconfig-qos:scheduler-policy: + - openconfig-qos:name: 'sched-01-cm-ip-dscp-11' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-ip-dscp-11' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:priority: 'STRICT' + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-ip-dscp-11' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir-pct: 10 # Percentage + openconfig-qos:queuing-behavior: 'SHAPE' + - openconfig-qos:name: 'sched-01-cm-ip-dscp-af11' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-ip-dscp-af11' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:priority: 'STRICT' + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-ip-dscp-af11' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir: 200000 # Unit bits + openconfig-qos:bc: 1000 # Unit bytes + openconfig-qos:queuing-behavior: 'SHAPE' + - openconfig-qos:name: 'sched-02-cm-ip-dscp-af11' + openconfig-qos:config: + openconfig-qos:name: 'sched-02-cm-ip-dscp-af11' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:priority: 'STRICT' + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-ip-dscp-11' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir: 100000 # Unit bits + openconfig-qos:bc: 500 # Unit bytes + openconfig-qos:queuing-behavior: 'SHAPE' + - openconfig-qos:name: 'sched-01-cm-dscp-13-15' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-13-15' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-dscp-13-15' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir-pct: 20 # Percentage + openconfig-qos:queuing-behavior: 'SHAPE' + - openconfig-qos:name: 'sched-02-cm-dscp-13-15' + openconfig-qos:config: + openconfig-qos:name: 'sched-02-cm-dscp-13-15' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-dscp-af12-af13' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir: 300000 # Unit bps + openconfig-qos:queuing-behavior: 'SHAPE' + - openconfig-qos:name: 'sched-01-cm-dscp-af12-af13' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-af12-af13' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-dscp-af12-af13' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir: 200000 # Unit bps + openconfig-qos:queuing-behavior: 'SHAPE' + - openconfig-qos:name: 'sched-01-cm-dscp-19' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-19' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-dscp-19' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir: 100000 # Unit bps + openconfig-qos:bc: 10000 # Unit bytes + openconfig-qos:queuing-behavior: 'POLICE' + openconfig-qos:conform-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 21 + openconfig-qos:exceed-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 21 + - openconfig-qos:name: 'sched-01-cm-dscp-21' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-21' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-dscp-21' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir-pct: 50 # Percentage + openconfig-qos:bc: 1000 # Unit bytes + openconfig-qos:queuing-behavior: 'POLICE' + openconfig-qos:conform-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 23 + openconfig-qos:exceed-action: + openconfig-qos:config: + openconfig-qos:drop: True + - openconfig-qos:name: 'sched-01-cm-dscp-23' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-23' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:type: 'TWO_RATE_THREE_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-dscp-23' + openconfig-qos:two-rate-three-color: + openconfig-qos:config: + openconfig-qos:cir: 100000 # Unit bps + openconfig-qos:bc: 1000 # Unit bytes + openconfig-qos:pir: 200000 # Unit bps + openconfig-qos:be: 1000 # Unit bytes + openconfig-qos:conform-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 25 + openconfig-qos:exceed-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 27 + openconfig-qos:violate-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 29 + - openconfig-qos:name: 'sched-01-cm-dscp-25' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-25' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:type: 'TWO_RATE_THREE_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-dscp-25' + openconfig-qos:two-rate-three-color: + openconfig-qos:config: + openconfig-qos:cir-pct: 20 # Percentage + openconfig-qos:bc: 100 # Unit bytes + openconfig-qos:pir-pct: 30 # Percentage + openconfig-qos:be: 200 # Unit bytes + openconfig-qos:conform-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 27 + openconfig-qos:exceed-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 29 + openconfig-qos:violate-action: + openconfig-qos:config: + openconfig-qos:drop: True + - openconfig-qos:name: 'sched-01-cm-dscp-31' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-31' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:type: 'TWO_RATE_THREE_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-dscp-31' + openconfig-qos:two-rate-three-color: + openconfig-qos:config: + openconfig-qos:cir: 200000 # Unit bps + openconfig-qos:bc: 20000 # Unit bytes + openconfig-qos:conform-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 46 + openconfig-qos:exceed-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 36 + openconfig-qos:violate-action: + openconfig-qos:config: + openconfig-qos:set-dscp: 38 + - openconfig-qos:name: 'sched-01-class-default' + openconfig-qos:config: + openconfig-qos:name: 'sched-01-class-default' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:priority: 'STRICT' + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-class-default-01' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir-pct: 20 # Percentage + openconfig-qos:queuing-behavior: 'SHAPE' + - openconfig-qos:name: 'sched-02-class-default' + openconfig-qos:config: + openconfig-qos:name: 'sched-02-class-default' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:priority: 'STRICT' + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-class-default-02' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir-pct: 30 # Percentage + openconfig-qos:queuing-behavior: 'SHAPE' + - openconfig-qos:name: 'sched-03-class-default' + openconfig-qos:config: + openconfig-qos:name: 'sched-03-class-default' + openconfig-qos:schedulers: + openconfig-qos:scheduler: + - openconfig-qos:sequence: 10 + openconfig-qos:config: + openconfig-qos:sequence: 10 + openconfig-qos:priority: 'STRICT' + openconfig-qos:type: 'ONE_RATE_TWO_COLOR' + openconfig-qos:output: + openconfig-qos:config: + openconfig-qos:output-type: 'FWD_GROUP' + openconfig-qos:output-fwd-group: 'pm-ip-dscp-af11' + openconfig-qos:one-rate-two-color: + openconfig-qos:config: + openconfig-qos:cir: 200000 # Unit bits + openconfig-qos:bc: 1500 # Unit bytes + openconfig-qos:queuing-behavior: 'SHAPE' + openconfig-qos:interfaces: + openconfig-qos:interface: + - openconfig-qos:interface-id: 'GigabitEthernet6' + openconfig-qos:config: + openconfig-qos:interface-id: 'GigabitEthernet6' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-19' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-21' + - openconfig-qos:interface-id: 'GigabitEthernet7' + openconfig-qos:config: + openconfig-qos:interface-id: 'GigabitEthernet7' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-23' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-25' + - openconfig-qos:interface-id: 'GigabitEthernet8' + openconfig-qos:config: + openconfig-qos:interface-id: 'GigabitEthernet8' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-ip-dscp-af11' + - openconfig-qos:interface-id: 'Loopback100' + openconfig-qos:config: + openconfig-qos:interface-id: 'Loopback100' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-19' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-21' + - openconfig-qos:interface-id: 'Loopback101' + openconfig-qos:config: + openconfig-qos:interface-id: 'Loopback101' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-23' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-25' + - openconfig-qos:interface-id: 'Port-channel10' + openconfig-qos:config: + openconfig-qos:interface-id: 'Port-channel10' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-19' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-21' + - openconfig-qos:interface-id: 'Port-channel11' + openconfig-qos:config: + openconfig-qos:interface-id: 'Port-channel11' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-23' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-25' + - openconfig-qos:interface-id: 'Port-channel12' + openconfig-qos:config: + openconfig-qos:interface-id: 'Port-channel12' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-ip-dscp-11' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-ip-dscp-af11' + - openconfig-qos:interface-id: 'Tunnel100' + openconfig-qos:config: + openconfig-qos:interface-id: 'Tunnel100' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-19' + - openconfig-qos:interface-id: 'Tunnel101' + openconfig-qos:config: + openconfig-qos:interface-id: 'Tunnel101' + openconfig-qos:input: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-23' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-dscp-31' + - openconfig-qos:interface-id: 'Tunnel102' + openconfig-qos:config: + openconfig-qos:interface-id: 'Tunnel102' + openconfig-qos:output: + openconfig-qos:scheduler-policy: + openconfig-qos:config: + openconfig-qos:name: 'sched-01-cm-ip-dscp-af11' + + api_method: PUT + rollback: false + assertion_ignore_errors: false + assertions: + - "'+class-map match-all cm-ip-dscp-11:' in changes" + - "'+ match ip dscp 11:' in changes" + - "'+class-map match-all cm-ip-dscp-af11:' in changes" + - "'+ match ip dscp af11:' in changes" + - "'+class-map match-all cm-dscp-13-15:' in changes" + - "'+ match dscp 13 15:' in changes" + - "'+class-map match-all cm-dscp-af12-af13:' in changes" + - "'+ match dscp af12 af13:' in changes" + - "'+class-map match-all cm-dscp-19:' in changes" + - "'+ match dscp 19:' in changes" + - "'+class-map match-all cm-dscp-21:' in changes" + - "'+ match dscp 21:' in changes" + - "'+class-map match-all cm-dscp-23:' in changes" + - "'+ match dscp 23:' in changes" + - "'+class-map match-all cm-dscp-25:' in changes" + - "'+ match dscp 25:' in changes" + - "'+class-map match-all cm-dscp-31:' in changes" + - "'+ match dscp af41:' in changes" + - "'+policy-map pm-class-default-01:' in changes" + - "'+ class class-default:' in changes" + - "'+ priority percent 20:' in changes" + - "'+policy-map pm-class-default-02:' in changes" + - "'+ class class-default:' in changes" + - "'+ priority percent 30:' in changes" + - "'+policy-map pm-ip-dscp-11:' in changes" + - "'+ class cm-ip-dscp-11:' in changes" + - "'+ priority percent 10:' in changes" + - "'+ class cm-ip-dscp-af11:' in changes" + - "'+ priority 100 500:' in changes" + - "'+policy-map pm-ip-dscp-af11:' in changes" + - "'+ class class-default:' in changes" + - "'+ priority 200 1500:' in changes" + - "'+ class cm-ip-dscp-af11:' in changes" + - "'+ priority 200 1000:' in changes" + - "'+policy-map pm-dscp-13-15:' in changes" + - "'+ class cm-dscp-13-15:' in changes" + - "'+ bandwidth percent 20:' in changes" + - "'+policy-map pm-dscp-af12-af13:' in changes" + - "'+ class cm-dscp-af12-af13:' in changes" + - "'+ bandwidth 200000:' in changes" + - "'+ class cm-dscp-13-15:' in changes" + - "'+ bandwidth 300000:' in changes" + - "'+policy-map pm-dscp-19:' in changes" + - "'+ class cm-dscp-19:' in changes" + - "'+ police cir 100000 bc 10000:' in changes" + - "'+ conform-action set-dscp-transmit 21:' in changes" + - "'+ exceed-action set-dscp-transmit 21:' in changes" + - "'+policy-map pm-dscp-21:' in changes" + - "'+ class cm-dscp-21:' in changes" + - "'+ police cir percent 50 bc 1000 ms:' in changes" + - "'+ conform-action set-dscp-transmit 23:' in changes" + - "'+ exceed-action drop:' in changes" + - "'+policy-map pm-dscp-23:' in changes" + - "'+ class cm-dscp-23:' in changes" + - "'+ police cir 100000 bc 1000 pir 200000 be 1000:' in changes" + - "'+ conform-action set-dscp-transmit 25:' in changes" + - "'+ exceed-action set-dscp-transmit 27:' in changes" + - "'+ violate-action set-dscp-transmit 29:' in changes" + - "'+policy-map pm-dscp-25:' in changes" + - "'+ class cm-dscp-25:' in changes" + - "'+ police cir percent 20 bc 100 ms pir percent 30 be 200 ms:' in changes" + - "'+ conform-action set-dscp-transmit 27:' in changes" + - "'+ exceed-action set-dscp-transmit 29:' in changes" + - "'+ violate-action drop:' in changes" + - "'+policy-map pm-dscp-31:' in changes" + - "'+ class cm-dscp-31:' in changes" + - "'+ police cir 200000 bc 20000:' in changes" + - "'+ conform-action set-dscp-transmit ef:' in changes" + - "'+ exceed-action set-dscp-transmit af42:' in changes" + - "'+ violate-action set-dscp-transmit af43:' in changes" + - "' interface GigabitEthernet6:' in changes" + - "'+ service-policy input pm-dscp-19:' in changes" + - "'+ service-policy output pm-dscp-21:' in changes" + - "' interface GigabitEthernet7:' in changes" + - "'+ service-policy input pm-dscp-23:' in changes" + - "'+ service-policy output pm-dscp-25:' in changes" + - "' interface GigabitEthernet8:' in changes" + - "'+ service-policy output pm-ip-dscp-af11:' in changes" + - "'+interface Loopback100:' in changes" + - "'+ service-policy input pm-dscp-19:' in changes" + - "'+ service-policy output pm-dscp-21:' in changes" + - "'+interface Loopback101:' in changes" + - "'+ service-policy input pm-dscp-23:' in changes" + - "'+ service-policy output pm-dscp-25:' in changes" + - "'+interface Port-channel10:' in changes" + - "'+ service-policy input pm-dscp-19:' in changes" + - "'+ service-policy output pm-dscp-21:' in changes" + - "'+interface Port-channel11:' in changes" + - "'+ service-policy input pm-dscp-23:' in changes" + - "'+ service-policy output pm-dscp-25:' in changes" + - "'+interface Port-channel12:' in changes" + - "'+ service-policy input pm-ip-dscp-11:' in changes" + - "'+ service-policy output pm-ip-dscp-af11:' in changes" + - "'+interface Tunnel100:' in changes" + - "'+ service-policy input pm-dscp-19:' in changes" + - "'+interface Tunnel101:' in changes" + - "'+ service-policy input pm-dscp-23:' in changes" + - "'+ service-policy output pm-dscp-31:' in changes" + - "'+interface Tunnel102:' in changes" + - "'+ service-policy output pm-ip-dscp-af11:' in changes" + +- hosts: nso + connection: local + gather_facts: no + roles: + - nso-rollback-load + run_once: true + vars: + rollback_file: "{{ lookup('env', 'PWD') }}/rollback.yaml"