QoS Configuration Commands I Table of Contents Table of Contents Chapter 1 QoS Configuration Commands....................................................................................................1 1.1 QoS Configuration Commands........................................................................................................1 1.1.1 cos default...............................................................................................................................1 1.1.2 cos map...................................................................................................................................2 1.1.3 dscp map.................................................................................................................................3 1.1.4 scheduler weight bandwidth.................................................................................................4 1.1.5 scheduler policy......................................................................................................................4 1.1.6 policy-map...............................................................................................................................5 1.1.7 classify.....................................................................................................................................6 1.1.8 action........................................................................................................................................8 1.1.9 qos policy.................................................................................................................................9 1.1.10 show policy-map................................................................................................................10 1.1.11 trust.......................................................................................................................................11 II QoS Configuration Commands Chapter 1 QoS Configuration Commands 1.1 QoS Configuration Commands QoS configuration commands include:  cos default  cos map  dscp map  scheduler weight bandwidth  scheduler policy  policy-map  classify  action  qos policy  show policy-map  trust 1.1.1 cos default Syntax To configure the default COS value, run cos default cos. cos default cos no cos default Parameters Parameters Description cos The COS value ranges between 0 and 7. Default Value The default COS value is 0. 1 QoS Configuration Commands Usage Guidelines This command is run in layer-2 interface configuration mode or in global configuration mode. If this command is run in global configuration mode, default CoS in all ports are affected. If this command is run on a layer-2 interface, the CoS on this interface will be affected. Example The following example shows how to set the CoS value of the untagged frame received by interface g0/1 to 4. Switch_config#inter g0/1 Switch_config_g0/1#cos default 4 1.1.2 cos map Syntax To set the CoS priority queues, use the cos map command. cos map quid cos1..cosn no cos map Parameters Parameters Description quid Stands for the ID of the CoS priority queue, 1 to 8. cos1..cosn CoS value defined by IEEE802.1p, ranging between 0 and 7 Default Value CoS Value S Priority Queue 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 2 QoS Configuration Commands Usage Guidelines This command is run in layer-2 interface configuration mode or in global configuration mode. If this command is run in global configuration mode, CoS priority queues in all ports are affected. If this command is run on a layer-2 interface, the CoS priority queues on this interface will be affected. Example The following example shows how to map CoS 0-2 to CoS priority queue 1 and CoS 3 to CoS priority queue 2. Switch_config # cos map 1 0 1 2 Switch_config # cos map 2 3 1.1.3 dscp map Syntax To set the CoS priority queues according to dscp, use the cos map command. dscp map word { cos cos-value } no dscp map Parameters Parameters Description word Dscp range table, for instance, (1,3,5,7),(1, 3-5,7),(1-7). cos cos-value The priority cos of Dscp mapping, 0-7. Default Value None Usage Guidelines This command is run in global configuration mode. Example The following example shows how to map dscp 0-2 to Cos priority queue. Switch_config#dscp map 0-2 cos 1 3 QoS Configuration Commands 1.1.4 scheduler weight bandwidth Syntax To set the bandwidth of the CoS priority queue, run the following command. scheduler weight bandwidth weight1...weightn no scheduler weight bandwidth Parameters Parameters Description weight1…weight8 Values of eight CoS priority queues WRR/WFQ, ranging between 0 and 127. Default Value The weight value of each CoS priority queue is same. All weight values of eight CoS priority queues are 1. Usage Guidelines This command is run in layer-2 interface configuration mode or in global configuration mode. If this command is run, the bandwidth of all priority queues on all interfaces are affected. Before the command is run, only the bandwidth of the priority queue will be affected. This command validates only when the queue schedule mode is set to WRR/WFQ. This command decides the bandwidth weight value of the CoS priority queue when the WRR/WFQ schedule policy is used. The weight of the queue after the third queue can be configured to 0. Once the weight of a queue is configured to 0, the queue after that is compelled to 0, then the hybrid mode will be applied. Example The following example shows how to set the weight values of eight CoS priority queues to 1, 2, 3, 4, 5, 6, 7 and 8 respectively. Switch_config # scheduler weight bandwidth 1 2 3 4 5 6 7 8 1.1.5 scheduler policy Syntax To set CoS priority queue debug policy, use the scheduler policy command. 4 QoS Configuration Commands scheduler policy { sp | wrr | wfq | fcfs } no scheduler policy Parameters Parameters Description sp Uses the SP schedule policy. wrr Uses the WRR schedule policy. wfq Uses the WFQ schedule policy. fcfs Uses the FCFS schedule policy. Default Value The SP schedule policy is used by default. Usage Guidelines This command can be used in layer-2 interface configuration mode or in global configuration mode. If this command is run, the port queue schedule policy on all interfaces are affected. Before the command is run, only the belonging port queue schedule policy will be affected. No fcfs command for the interface. After this command is configured, the schedule mode of the interface is set to the designated value. Example The following example shows how to send transmission schedule mode to WRR. Switch_config # scheduler policy wrr 1.1.6 policy-map Syntax To set the QoS policy map, run policy-map name. policy-map name no policy-map name 5 QoS Configuration Commands Parameters Parameters Description name Name of the QoS policy map, consisting of 1 to 20 characters. Default Value None Usage Guidelines Global Configuration mode After the command is entered, the system enters the QoS policy mapping configuration mode. In this mode, the following commands are used:  classify: Used to set the QoS flow.  description: Used to describe the QoS policy map.  exit: Used to exit from the QoS policy mapping configuration mode.  no: Used to cancel the previously-entered command.  action: Used to define the QoS action. Example The following example shows how to set the QoS policy map. Switch_config # policy-map myqos 1.1.7 classify Syntax To configurethe matchup data flow of the QoSpolicy map, run the following command. To return to the default setting, use the no form of this command. classify {any | cos cos | icos icos | vlan vlanid | ivlan ivlanid | ethernet-type ethernet-type | precedence precedence-value | dscp dscp-value | tos tos-value | diffserv diffserv-value | ip ip-access-list | ipv6 ipv6-access-list | mac mac-access-list } no classify { cos | icos | vlan | ivlan | ethernet-type | precedence | dscp | tos | diffserv | ip | ipv6 | mac } Parameters Description any Matches up with any packet. 6 QoS Configuration Commands cos cos Configures the matching COS value; the valid range is 0 to 7 icos icos Configures the matching interior tag COS value; the valid range is 0 to 7. vlan vlanid Configures the matching VLAN; the valid range is 1 to 4094 ivlan ivlanid Configures interior tag vlan id. 1-4094. ethernet-type Configures the packet type, 0x0600-0xFFFF ethernet-type precedence The priority field in tos of ip packet (5-7 of tos), 0-7. precedence-value dscp dscp-value Dscp field in tos of ip packet (2-7 of tos), 0~63. tos tos-value tos in the ip packet represents delay, throughput, reliability and cost field (1-4 of tos), 0~15. diffserv diffserv-value All tos field in Ip packet: 8, 0-255. ip ip-access-list Configures the name of the matched IP access list.. The name has 1 to -20 characters. ipv6 ipv6-access-list Configures the name of the matched IPV6 access list. The name has 1 to 20 characters. mac mac-access-list Configures the name of the matched MAC access list. The name has 1 to 20 characters. Default Value Any packet is matched by default. Usage Guidelines QoS policy map configuration mode All data flows in a QoS policy map must have the same mask value. The port number in the IP access list must be a definite value, not a value range. The IP access list and the MAC access list which are used to match up with the data flows can be configured no more than 16 regulations, or the configuration will fail. When the action in the regulation is permit, the regulation is used to differentiate the data flows; when the action in the regulation is deny, the regulation has no function. When the QinQ mode is enabled, that is, when the dot1q-tunnel command is configured, the ivlan and icos commands need be configured when the vlan or the cos value of the source packet is matched. Example Switch-policy-map#classify vlan 4 7 QoS Configuration Commands 1.1.8 action Syntax To configure the data flow policy of a QoS policy map, run the following commands. action{bandwidth max-band | cos cos | drop | dscp dscp-value | precedence precedence-value | forward | icos icos | ivlanID { add addivlanid | ivlanid}| monitor session-value | quequ quequ-value | redirect interface-id | stat-packet | stat-byte | vlanID { add addvlanid | vlanid} | copy-to-cpu} no action {bandwidth | cos | drop | dscp | precedence | forward | | icos | ivlanID | monitor | quequ | redirect | stat-packet | stat-byte | vlanID | copy-to-cpu} Parameters Parameters Description bandwidth max-band Maximum bandwidth to a class, the range is 1 to 163840. Unit: 64Kbps. cos cos Sets the matched COS field to cos-value 0-7. drop Drops the matched packets. dscp dscp-value Sets the matched DSCP field to dscp-value 0~63. precedence The priority field in tos of ip packet (5~7 of tos). 0-7. precedence-value forward Conducts no operations to the matched packets. icos icos Sets the matched COS field to cos-value 0-7. ivlan {add ivlanid | Sets replacing or adding interior vlanid; the range is 1-4094. ivlanid} monitor session-value Sends the packets to monitor interface; the range is 1-4. quequ quequ-value Sets the queue mapping value 1-8. redirect interface-id Redirects the egress port of the matched flow. stat-packet Calculates the number of packets. stat-byte Calculates the number of bytes. vlanID { add vlanid | Sets replacing or adding exterior vlanid; the range is 1-4094. vlanid } copy-to-cpu Sets forwarding the packet to CPU. Default Value None 8 QoS Configuration Commands Usage Guidelines QoS policy map configuration mode After enabling dot1q function, vlan and cos on the downlink port takes effect only when ivlan and icos are configured. When Monitor is applied to the egress, an independent policymap must be configured. Otherwise, the result may turn to abnormal. In igress direction, the action of vlan and ivlan conflicts with dscp, precedence, bandwidth, cir, mirror, stat or redirect. They cannot be configured simultaneously. In igress direction, the action of cos and ivlan conflicts with dscp, precedence, bandwidth, cir, mirror, stat or redirect. They cannot be configured simultaneously. In egress direction, the action of cos and ivlan conflicts with dscp, precedence, bandwidth, cir, mirror, stat or redirect. They cannot be configured simultaneously. Example Switch-policy-map#action redirect g0/1 1.1.9 qos policy Syntax To configure the QoS policy of a port, run the following command. [no] qos policy name { ingress} Parameters Parameters Description name Stands for the name of QoS policy mapping. ingress Functions on the ingress port. Default Value None Usage Guidelines This command can be used in layer-2 interface configuration mode or in global configuration mode. The flow of most actions in the igress direction can be correctly matched up when they are known unicasts. 9 QoS Configuration Commands Example The following example shows how to configure the pmap QoS policy on interface g0/1. Switch_config#inter g0/1 Switch_config_g0/1# qos policy pmap ingress 1.1.10 show policy-map Syntax To display all or some designated QoS policy maps, run the following command. show policy-map {policy-map-name | interface [interface-id] | global } Parameters Parameters Description policy-map-name Stands for the name of a QoS policy map. interface [interface-id] Stands for the policy of interface application global Stands for the policy of global configuration Default Value None Usage Guidelines None Example The following example shows how to display all QoS policy maps. Switch_config#show policy-map policy-map 1 classify any action redirect g0/1 policy-map 11 classify any action Switch_config# 10 QoS Configuration Commands 1.1.11 trust Syntax To show how to set the trust mode, run the following command. [no]qos trust { cos | dscp | untrust } Parameters Parameters Description cos Stands for the trust mode. dscp The trust mode. untrust The untrust mode. Default Value None Usage Guidelines The command is applicable in the global configuration mode. Example The following example shows how to set the trust mode cos. Switch_config#qos trust cos 11