Chapter 21: QoS Configuration Guide300 SmartSwitch Router User Reference ManualFor example, setting the ToS field to 0010 specifies that a packet will be routed on the mostreliable paths. Setting the ToS field to 1000 specifies that a packet will be routed on thepaths with the least delay. (Refer to RFC 1349 for the specification of the ToS field value.)With the ToS rewrite command, you can access the value in the ToS octet (which includesboth the Precedence and ToS fields) in each packet. The upper-layer application can thendecide how to handle the packet, based on either the Precedence or the ToS field or bothfields. For example, you can configure a router to forward packets using different paths,based on the ToS octet. You can also change the path for specific applications and users bychanging the Precedence and/or ToS fields.Note: In RFC 2574, the IETF redefined the ToS octet as the “DiffServ” byte. You will stillbe able to use the ToS rewrite feature to implement DiffServ when this standard isdeployed.Configuring ToS Rewrite for IP PacketsThe ToS rewrite for IP packets is set with the qos set command in Configure mode. Youcan define the QoS policy based on any of the following IP fields: source IP address,destination IP address, source port, destination port, ToS, port, or interface.When an IP packet is received, the ToS field of the packet is ANDed with the and the resulting value is compared with the ANDed value of and of theQoS policy. If the values are equal, the values of the and rewrite> parameters will be written into the packet.The and parameters use values ranging from 0 to 255. They are used inconjunction with each other to define which bit in the field of the packet issignificant. The value ranges from 0 to 7 and is the value that isrewritten in the ToS Precedence field (the first three bits of the ToS octet). The value ranges from 0 to 31 and is the value that is rewritten in the ToS field (the last five bitsof the ToS octet, which includes both the ToS field and the MBZ bit).The ToS byte rewrite is part of the QoS priority classifier group. The entire ToS byte can berewritten or only the precedence part of the ToS byte can be rewritten. If you specify avalue for , then only the upper three bits of the ToS byte arechanged. If you set to any and specify a value for ,then the upper three bits remain unchanged and the lower five bits are rewritten. If youspecify values for both and , then the upper three bitsMBZToSPrecedence7 6 5 4 3 2 1 0<tos-precedence-rewrite> <tos-rewrite>0-7 0-31