Configuration Guide
QoS Configuration Guide
44 min
introduction introduction qos (quality of service) is a technique used to solve problems such as network latency and blocking as a security mechanism in a network, qos can provide better service capability and improved quality of service for specified network communications under normal circumstances, qos is not required if the network is only used for specific untime limited applications, such as web applications, or e mail settings but for critical applications and multimedia applications it is essential that qos ensures that critical traffic is not delayed or dropped when the network is overloaded or congested, and that the network operates efficiently concepts and principles concepts and principles queue and priority mapping queue and priority mapping different messages use different qos priorities, for example, 802 1p for vlan messages, dscp for ip messages, tc for ipv6 messages, exp for mpls messages in order to ensure the quality of service of different messages, when the message comes into the switch, the qos priority carried by the message needs to be mapped to the internal service class (also called scheduling priority phb) and discard priority (also called color) of the switch inside the switch, congestion management is carried out according to the class of service of the message and congestion avoidance according to the color of the message; when the message leaves the switch, the internal class of service and color need to be mapped to qos priority so that subsequent network devices can provide the appropriate quality of service according to the qos priority generally, the phb ranges from 0 to 7, or is indicated by be, af1, af2, af3, af4, cs6, cs7 respectively, and color is available in green, yellow and red two types of message fields related to qos priority are listed below priority in layer 2 vlan frames priority in layer 2 vlan frames the priority in a layer 2 frame is specific to vlan frames, as ordinary layer 2 frames do not carry a priority field the priority in a vlan frame is what is commonly referred to as the 802 1p priority (defined by the ieee 802 1p protocol), and is located in the "pri" subfield of the "802 1q tag" field in the vlan frame, as shown in the figure below the pri field is 3 bits long and can represent 8 transmission priorities, with values of 7, 6, , 1, 0 in descending order of priority the different priority levels identify the different levels of quality of service required priority in layer 3 ip messages priority in layer 3 ip messages the layer 2 vlan frame priority described above is relatively simple, but in layer 3 ip messages the description of priority is much more complex, and two different types of priority and different methods of identification have emerged at different times tos tos in the early rfc 791 standard, ip packets relied on the tos (type of service) field to identify the data priority value, which is a field (1 byte in total) in the ip header of an ip packet that specifies the priority of the ip packet, and the switch preferentially forwards packets with a high tos value it contains a byte (8 bits) and consists of three parts three bits from 0 to 2 to define the ip priority of the packet (ip precedence), tos and the last bit fixed to 0, as shown in the figure dscp dscp in the later new rfc 2474 standard, the tos field in the original ip packet header was redefined and renamed the ds (differentiated services) field, which is also a total of one byte (8 bits) in general, bits 0 to 5 (six bits in total) are used to indicate the dscp (differentiated services code point) priority, with values ranging from 0 to 63, which identifies a total of 64 priority values (the higher the value, the higher the priority), and the last two bits are reserved to display the ecn (explicit congestion notification) flow shape flow shape congestion in the network may be caused when the rate at which messages are sent is greater than the rate at which they are received, or when the interface rate of a downstream device is less than the interface rate of an upstream device if the size of the service traffic sent by users is not limited, the constant burst of service data from a large number of users will make the network more congested in order to make the limited network resources more efficient for the users, it is necessary to limit the service traffic of the users flow shaping provides the possibility to control the maximum output communication rate to ensure that communication meets the configured maximum transmission rate specification traffic shaping is usually done using buffers and token buckets when messages are sent at too fast a rate, they are first cached in the buffers and these buffered messages are then sent evenly under the control of the token buckets when the interface rate of the downstream device is less than the port rate of the upstream device or when burst traffic occurs, traffic congestion may occur at the incoming port of the downstream device in this case, the user can configure traffic shaping on the outgoing port of the upstream device to cut the upstream irregular traffic and output a flatter traffic, thus solving the congestion problem of the downstream device there are two types of flow shaping interface traffic shaping interface traffic shaping interface traffic shaping, also known as interface rate limiting lr (line rate), limits the total rate of all messages (including emergency messages) sent by the interface and is traffic shaping for the entire outgoing interface, regardless of priority queue traffic shaping queue traffic shaping queue traffic shaping, also known as shaping, allows traffic to be shaped for a particular queue on the outgoing interface, with differentiated priority each of the two traffic shaping methods has its own advantages and can be applied for different demand scenarios users can choose according to their scenarios and needs congestion management and congestion avoidance congestion management and congestion avoidance the quality of service problems faced by traditional networks are mainly caused by congestion, which refers to problems that occur when multiple users compete for the same resources (bandwidth, buffers, etc ) on a shared network congestion management congestion management is a traffic control mechanism to meet the high qos service of delay sensitive services by adjusting the scheduling order of messages when the network is intermittently congested and the delay sensitive services require a higher quality qos service than other services this is handled by using queuing techniques, where all messages from a port are placed into multiple queues and processed according to queue priority queue refers to the logic of sorting messages in the cache when the rate of traffic exceeds the interface bandwidth or the bandwidth set for that traffic, the messages are temporarily stored in the cache in a queue the processing order and discard principle for message forwarding is determined by the queue scheduling algorithm this series of switches supports pq, dwrr and hybrid scheduling modes, which are described below pq dispatch pq dispatch pq (priority queuing) scheduling, also known as sp (strict priority), refers to the scheduling of queues in strict order of priority only after all messages in the high priority queue have been scheduled will the lower priority queue have a chance to be scheduled pq scheduling is used to place delay sensitive critical services into a high priority queue and non critical services into a low priority queue, thus ensuring that critical services are sent first disadvantage of pq scheduling when congestion occurs, messages in the lower priority queues will not get a chance to be scheduled if the higher priority queues are occupied for a long time dwrr dispatch dwrr dispatch understanding dwr (deficit weighted round robin) scheduling begins with wrr (weighted round robin) scheduling, which rotates between queues to ensure that each queue receives a certain amount of service time using the example of a port with 8 output queues, wrr can configure a weighting value for each queue (w7, w6, w5, w4, w3, w2, w1, w0 in that order), with the weighting value indicating the weight of the acquired resources example a 100m port is configured with a weighting value of 50, 50, 30, 30, 10, 10, 10, 10, 10 (corresponding to w7, w6, w5, w4, w3, w2, w1, w0 in that order) for its wrr queue scheduling algorithm, which ensures that the lowest priority queue gets at least 5mbit/s of bandwidth, avoiding the disadvantage that messages in the low priority queue may go unserved for a long time when pq scheduling is used disadvantages of wrr scheduling wrr scheduling is based on the number of messages, so there is no fixed bandwidth per queue, and the actual bandwidth obtained by a larger message is greater than that obtained by a smaller message for the same scheduling opportunity and it is bandwidth that users are generally concerned about when the average message length of each queue is equal or known, the user can obtain the desired bandwidth by configuring the wrr weight; however, when the average message length of the queue varies, the user cannot obtain the desired bandwidth by configuring the wrr weight another disadvantage is that low latency demand services (e g voice) are not scheduled in a timely manner dwrr, or differential weighted polling, is implemented on the same principle as wrr scheduling, but dwrr is able to schedule messages according to their length, avoiding the disadvantage that wrr scheduling cannot allocate bandwidth resources in proportion to the configuration dwrr also has the disadvantage that delay sensitive services (such as voice) are not scheduled in a timely manner hybrid scheduling hybrid scheduling pq scheduling and dwrr scheduling have their own advantages and disadvantages when pq scheduling is used alone, messages in the low priority queue may not be scheduled for a long time, while when dwrr scheduling is used alone, low latency demand services are not scheduled timely the "pq+dwrr" scheduling method combines the advantages of both scheduling methods and overcomes the disadvantages of each users can place important protocol messages and delay sensitive service messages into the queue using pq scheduling and assign a designated bandwidth to this queue, while other messages are placed into each queue using dwrr scheduling according to their respective priorities, and each queue is scheduled cyclically according to its weight note by standard, the queue priority of all dwrrs should be less than the priority of all pq queues congestion avoidance congestion avoidance is a traffic control mechanism that relieves network overload by monitoring the usage of network resources (such as queues or memory buffers) and actively discarding messages when congestion occurs or tends to increase, by adjusting the traffic flow of the network there are currently two discard strategies tail drop and wred tail discard tail discard the traditional packet drop policy uses tail drop and treats all messages equally, regardless of their levels of service in this case, during congestion, data messages at the tail of the queue are dropped until the congestion is lifted however, this drop policy does not reflect priority wred wred in times of network congestion, we always want to discard the lower priority packets first and ensure that the higher priority packets are sent weighted random early detection (wred) is a weight based random early detection that relies on the priority of the traffic to assign a corresponding drop probability wred can drop packets based on their dscp or ip priority, with lower priority data always dropping before higher priority data, thus ensuring delivery of important data the implementation of congestion management in sonic relies heavily on an extension to wred, the ecn (explicit congestion notification) mechanism ecn was originally defined in rfc 3168 for the tcp/ip protocol and is implemented by embedding a congestion indicator in the ip header and a congestion acknowledgement in the tcp header ecn compatible switches and routers mark network packets when congestion is detected, rather than just dropping them the specific fields of the ecn take up 2 bits in the ip header, the ect bit (ecn capable transport) and the ce bit (congestion experienced) the ect and ce bits can form a combination of 4 ecn fields 00 to 11 00 00 indicates that the message does not use the ecn 01 and 10 01 and 10 are called ect(1) and ect(0) respectively, and are set by the data sender to indicate that the endpoint of the transport protocol is capable of using ecn the router treats both field combinations identically for more information on these two field combinations, see rfc 3168 11 11 indicates congestion this series of switches supports the configuration of wred for a particular queue or queues, with the possibility of setting the operating mode (drop/ecn) and the upper and lower thresholds, as follows if the number of packets in the queue is below the minimum threshold, both modes forward packets normally with no behavioral difference if the number of packets in the queue is between the minimum and maximum thresholds, drop mode discards packets based on the wred drop probability, while ecn mode marks the packets if the number of packets in the queue exceeds the maximum threshold, all packets will be dropped or marked pfc pfc understanding pfc begins with an introduction to the concept of flow control traffic conditioning is a basic ethernet function that prevents frame loss in the event of port congestion a common implementation on a general switching chip is flow control based on pause frames the following is a simple application scenario as shown in the diagram above, ports a and b of the switch receive packets and port c forwards them if the sum of the incoming packet rates of ports a and b is greater than the bandwidth of port c, then some of the messages will be cached in the buffer inside the switch when the occupancy rate of buffer reaches the high water line xoff, ports a and b will send out pause frames with time parameter not 0 to notify the other side to pause for a period of time before sending; when the occupancy rate of buffer drops below the low water line xon, ports a and b will send out pause frames with time parameter 0 to notify the other side that they can continue to send packets, and the other side will send packets immediately after receiving packets as soon as they are received the above descriptions are based on the premise that both the message ingress (a and b) and its counterpart devices support flow control and enable it pfc (priority based flow control) is a priority based flow control and is based on the same principle as flow control this series of switches uses pfc for flow control purposes, supporting global enable/disable pfc and specifying a queue or queues to enable/disable pfc this series of switches supports setting up to two lossless queues, the default lossless queue is 3 and 4, so queues 3 and 4 have pfc enabled by default qos configuration qos configuration table 1 overview of qos configuration tasks table 1 overview of qos configuration tasks configuration tasks description basic qos configuration configure qos priority mapping optional qos function configuration configure qos scheduling optional configure traffic shaping optional configure pfc optional configure pfcwd optional configure wred optional configure storm control optional configure qos priority mapping configure qos priority mapping the following two types of mapping are currently supported table 2 supported mapping table types table 2 supported mapping table types mapping table type meaning description dot1p to tc 802 1p priority to tc mapping dot1p takes the values 0 to 7 dscp to tc dscp to tc mapping dscp takes the values 0 to 63 notes dscp and dot1p priority mapping cannot be configured at the same time tc takes values from 0 to 7, out of range it may not be able to forward messages or be able to default to queue0 forwarding, this behaviour varies from chip to chip the behaviour of innovium chips is forwarding priority configuration at the traffic ingress, role at the traffic egress configure dscp to cos mapping configure dscp to cos mapping table 3 configure dscp to cos mapping table 3 configure dscp to cos mapping operation commands description enter global configuration view configure terminal create a diffserv map map and enter its configuration view diffserv map type ip dscp diffserv map name diffserv map name name of diffserv map configure dscp to cos mapping ip dscp value cos cos value value dscp value, range 0 63 cos value cos value, range 0 7 default { cos value |copy} cos value indicates that all packets are mapped to the corresponding cos value default copy indicates to use the default dscp mapping of the system exit diffserv map view exit create a policy map and enter its configuration view policy map policy map name configure dscp to tc mapping set cos dscp diffserv diffserv map name exit policy map view exit enter interface configuration view interface ethernet interface name bind policies to interfaces service policy policy map name bind the interface will make the policy effective, the policy configuration cannot be modified at this time configure dot1p to cos mapping configure dot1p to cos mapping table 4 configure dot1p to cos mapping table 4 configure dot1p to cos mapping operation commands description enter global configuration view configure terminal create a diffserv map map and enter its configuration view diffserv map type ip 8021p diffserv map name diffserv map name name of diffserv map configure dot1p to cos mapping 8021p value cos cos value value dot1p value, range 0 7 cos value cos value, range 0 7 default value all unconfigured packets are marked with the cos value value cos value (0 7) exit diffserv map view exit create a policy map and enter its configuration view policy map policy map name policy map name the name of the policy map configure dot1p to tc mapping set cos 8021p diffserv diffserv map name exit policy map view exit enter interface configuration view interface ethernet interface name bind policies to interfaces service policy policy map name bind the interface will make the policy effective, the policy configuration cannot be modified at this time configure qos schedule policy configure qos schedule policy notes a queue cannot be configured with both dwrr mode and sp mode scheduling policies qos scheduling policy should be configured on the egress port of the traffic configure sp schedule configure sp schedule table 5 configure sp schedule table 5 configure sp schedule purpose commands description enter global configuration view configure terminal create a policy map and enter its configuration view policy map policy map name policy map name name of policy map configure sp mode policy queue scheduler priority queue queue id queue id range from 0 to 7 exit policy map view exit enter interface configuration view interface ethernet interface name bind policy to interface service policy policy map name binding the interface will make the policy effective, the policy configuration cannot be modified at this time configure dwrr schedule configure dwrr schedule table 6 configure dwrr schedule table 6 configure dwrr schedule purpose commands description enter global configuration view configure terminal create a policy map and enter its configuration view policy map policy map name configuring dwrr mode policy queue scheduler queue limit percent queue weight queue queue id queue weight scheduling weight of dwrr, range from 0 to 100 queue id range from 0 to 7 exit policy map view exit enter interface configuration view interface ethernet interface name bind policy to interface service policy policy map name binding the interface will make the policy effective, the policy configuration cannot be modified at this time, it needs to be modified after unbinding configure traffic shape configure traffic shape note traffic shaping policy is currently only supported on egress port of the traffic configure port speed limit configure port speed limit table 7 configure port speed limit table 7 configure port speed limit purpose commands description enter global configuration view configure terminal create a policy map and enter its configuration view policy map policy map name configure port speed limit policy port shape target bit rate \[ burst size ] target bit rate peak speed limit value (byte/s) burst size peak burst value (byte) enter interface configuration view interface ethernet interface name bind policy to interface service policy policy map name binding the interface will make the policy effective, the policy configuration cannot be modified at this time configure queue speed limit configure queue speed limit table 8 configure queue speed limit table 8 configure queue speed limit purpose commands description enter global configuration view configure terminal create a class map and enter its configuration view class map class map name specify the queue for speed limit match cos queue the value of queue is 0 7, use space to separate multiple queues exit class map configuration view exit create a policy map and enter its configuration view policy map policy map name bind the class map and enter the policy class map configuration view class class map name this command is executed in policy map view configure queue speed limit policy queue shape target bit rate \[ burst size ] the configured queue determined by class map target bit rat specifies the peak speed limit value in bits/s burst size specifies the burst value in bits exit class view under policy map exit exit policy map configuration view exit enter ethernet interface view interface ethernet interface name bind policy to interface service policy policy map name binding the interface will make the policy effective, the policy configuration cannot be modified at this time, it needs to be modified after unbinding configure pfc configure pfc the port can receive pfc pause frames regardless of whether the port is configured with the pfc function or not however, the received pfc pause frames are only processed when the pfc function is on therefore, it is necessary to ensure that the pfc function is on at both the local end and the other end in order for the pfc function to take effect in order to avoid packet loss due to congestion during transmission, please configure the same pfc function on all ports through which the message flows the ingress buffer of the switch chip is shared by all ports, but can be allocated in flow control scenarios when not configured by the user, the default trigger threshold and stop threshold values for backpressure frames in the ingress direction is present in the interface configuration the default setting can be viewed by the show buffer profile command the default parameter set works better in a general networking environment in order to control the pfc function flexibly and use the interface storage space reasonably, the switch provides pfc waterline configuration and supports user defined configuration of the pfc buffer profile, including enable queue, configure buffer size, trigger high and low thresholds for pause frames note pfc is configured at ingress port of the traffic global enable/disable pfc global enable/disable pfc notes by default, queues 3 and 4 of all ports are lossless queues with pfc enabled, and the rest of the queues are pfc disabled currently, the queue enable/disable pfc control object is all interfaces, and there is no interface switch for the time being supports up to two queues to enable pfc table 9 global enable pfc table 9 global enable pfc purpose commands description enter global configuration view configure terminal enable pfc priority flow control enable ingress queue ingress queue indicates a queue, range 0 7 you can specify a queue (eg 1) or specify some queues (eg 1 4) save the configuration and reload to take effect writereload table 10 global disable pfc table 10 global disable pfc purpose commands description enter global configuration view configure terminal disable pfc no priority flow control enable ingress queue id ingress queue indicates a queue, range 0 7 you can specify a queue (eg 1) or specify some queues (eg 1 4), save the configuration and reload to take effect writereload configure the pfc lossless buffer configure the pfc lossless buffer the cell size varies from model to model on cx308p 48y n v2 and cx532p n v2, cell size=128 bytes when a queue on the switch is congested and the occupancy of the ingress buffer reaches the waterline, it will start to send backpressure frames; when the sender receives the backpressure frames and reduces the sending traffic, the occupancy of the ingress buffer on the switch will decrease and stop sending backpressure frames when the occupancy is below the waterline; the formula of pfc waterline is limit=guaranteed buffers+dynamic factor (in static mode, dynamic factor is different) when using self defined lossless buffers, it is recommended to configure static mode on other models, cell size=224 bytes when a queue on the switch is congested and the occupancy of the ingress buffer reaches xoff, it starts to send backpressure frames; when the sender receives abackpressure frames and reduces the sending traffic, the occupancy of the ingress buffer of the switch will decrease and stop sending backpressure frames when the occupancy reaches xon when the user does not configure it, default trigger thresholds and stop thresholds for backpressure frames in the inbound direction exist in the interface configuration when using self defined lossless buffers, it is recommended to configure static mode the parameters of dynamic lossless buffer are related to the interface rate, cable length, etc , and the following are the recommended configuration values table 11 recommended values table 11 recommended values rate cable length size xon xoff dynamic threshold xon offset 25000 5m 1518 0 15680 1 13440 50000 5m 1518 0 21248 1 13440 100000 5m 1518 0 34624 1 13440 400000 5m 1518 0 117536 1 13440 25000 40m 1518 0 16928 1 13440 50000 40m 1518 0 23392 1 13440 100000 40m 1518 0 38816 1 13440 400000 40m 1518 0 135520 1 13440 25000 100m 1518 0 18848 1 13440 50000 100m 1518 0 27264 1 13440 100000 100m 1518 0 46496 1 13440 400000 100m 1518 0 166688 1 13440 25000 300m 1518 0 25184 1 13440 50000 300m 1518 0 40128 1 13440 100000 300m 1518 0 72384 1 13440 400000 300m 1518 0 268640 1 13440 note the sum of the lossless buffers allocated to each queue should be no greater than the lossless pool size table 12 configure the pfc lossless buffer table 12 configure the pfc lossless buffer purpose commands description enter global configuration view configure terminal create a buffer profile and enter its configuration view buffer profile profile name profile name pfc profile name configure the pfc lossless buffer mode lossless { static static th | dynamic dynamic th } size size for other models mode lossless { static static th | dynamic dynamic th } size size xoff xoff xon offset xon offset \[ xon xon ] for cx308p 48y n v2 and cx532p n v2 static th static th denotes the static threshold value, the unit is byte, the value range is 0 47218432 dynamic th dynamic th denotes the dynamic threshold coefficient, the value range is \[ 4,3]; dynamic th = 2dynamic th remaining available buffer e g , if dynamic th is set to 1, then the dynamic threshold is 2 times of the remaining available buffer, i e , the actual threshold is 2/3 of the total available buffer the recommended value for cx308p 48y nf and cx532p nf models is 3, and for other models is 1 size indicates the reservation size in bytes, and the recommended configuration value is 1518 xoff xoff indicates the pfc backpressure frame trigger buffer threshold value, and it is recommended to configure it as an integer multiple of the cell size in bytes xoff is related to the cable length, interface rate and other parameters, and you can refer to the recommended values for configuration xoff must be greater than the xon value xon offset indicates the pfc backpressure frame stop buffer threshold value, which is recommended to be an integer multiple of the cell size, and the unit is byte the recommended configuration value is 13440 xon xon should be an integer multiple of cell size, unit is byte, it is recommended to configure 0 the actual xon takes the larger value of xon and xon offset, so generally do not need to configure xon interface binding pfc configuration interface binding pfc configuration table 13 interface binding pfc configuration table 13 interface binding pfc configuration purpose commands description enter global configuration view configure terminal create a class map and enter its configuration view class map class map name specify the queue for which pfc is enabled match cos queue the value of queue is 0 7, use space to separate multiple queues exit class map configuration view exit enter policy map view policy map policy map name bind the class map and enter its configuration view class class map name bind pg buffer profile in queue ingress direction priority group buffer buffer profile name exiting the class view under policy map exit exit policy map view exit enter interface configuration view interface ethernet interface name apply the policy to the interface service policy policy map name after the policy is bound to interface , dynamic modification of the policy configuration is not allowed configure pfcwd configure pfcwd pfc is required to be enabled before enabling pfcwd table 14 configure pfcwd table 14 configure pfcwd purpose commands description enter the global configuration view configure terminal enable pfcwd pfcwd enable { all | interface name } detection time d time \[ action pfcwd action | restoration time r time ] all all interfaces d time detection time, range is \[100,5000] pfcwd action execute action, optional parameters are (drop, forward, alert) r time recovery time, in the range of \[100,60000] (optional) set the pfcwd polling interval pfcwd interval poll interval poll interval polling interval, in ms, range \[100,3000] (optional) enable pfcwd in default setting pfcwd start default configure wred configure wred notes wred should be configured on the traffic egress ecn marking function only works for tcp and udp messages configure wred dropp profile configure wred dropp profile table 15 configure wred drop profile table 15 configure wred drop profile purpose commands description enter global configuration view configure terminal create wred profil and enter its configuration view wred profile name profile name wred profile name configure the wred profile mode drop gmin min th gmax max th gprobability probability \[ ymin min th ymax max th yprobability probability | rmin min th rmax max th rprobability probability ] min th min th sets the lower absolute limit of wred drop in bytes that is, when the message length in the queue reaches this value, wred drop starts the configurable minimum value of min threshold is 15kb the recommended configuration value is 15360 max th max th sets the upper absolute value of wred drop in bytes that is, when the message length in the queue reaches this value, it starts to drop all newly received messages; for cx308p 48y n devices, the value range is min th 25165824; for other models of devices, the value range is min th 10243072 the recommended configuration values for the different rate interfaces are as follows 25g(bps) 192000(bytes) 100g(bps) 768000(bytes) 200g(bps) 768000(bytes) 400g(bps) 1536000(bytes) probability probability sets the maximum drop probability in the form of integer and the value range is \[1,100] for delay sensitive services, it is recommended that the maximum drop probability be set to 90%; for throughput sensitive services, it is recommended that it be set to 10% configure explicit congestion notification configure explicit congestion notification table 16 configure explicit congestion notification table 16 configure explicit congestion notification purpose commands description enter global configuration view configure terminal create a wred and enter its configuration view wred profile name configure ecn parameters mode ecn gmin min th gmax max th gprobability probability \[ ymin min th ymax max th yprobability probability | rmin min th rmax max th rprobability probability ] min th min th set the low limit absolute value of ecn in bytes when the message length in the queue reaches this value, the interface starts to set the ecn field of the message to ce according to the probability the configurable minimum value is 15 kb the recommended configuration value is 15360 max th max th set the high limit absolute value of ecn in bytes when the message length in the queue reaches this value, the interface starts to set ecn field of all packets to ce for cx308p 48y n v2 and cx532p n v2 , the range is min th 25165824, and for other models, the range is min th 10243072 the recommended configuration values for the different rate interfaces are as follows 25g(bps) 192000(bytes) 100g(bps) 768000(bytes) 200g(bps) 768000(bytes) 400g(bps) 1536000(bytes) probability probability set the maximum mark probability in integer form the range is \[1,100] it is recommended to set the mark probability to 90 percent for latency sensitive services and 10 percent for throughput sensitive services apply the wred profile apply the wred profile after configuring a wred drop policy or ecn policy, you need to bind interfaces and queues for it to take effect table 17 apply the wred profile table 17 apply the wred profile purpose commands description enter global configuration view configure terminal create a class map and enter its configuration view class map class map name specify the queue for which wred is applied match cos queue the value of queue is 0 7, use space to separate multiple queues exit class map configuration view exit enter policy map view policy map policy map name bind the class map class class map name policy binds wred profile wred profile name exit the class view under policy map exit exit policy map view exit enter ethernet interface view interface ethernet interface name bind policy to interface service policy policy map name after the policy is bound to interface , dynamic modification of the policy configuration is not allowed configure packet remarking table 18 configure packet remarking table 18 configure packet remarking purpose commands description enter global configuration view configure terminal create layer 3 acl table access list table name l3 { ingress | egress } bind interface bind interface { ethernet interface name | link aggregation lag id | all } configure remarking rule rule rule id rule options { set dscp dscp | set tc tc | set pcp pcp } rule id rule sequence number (range 1–500) rule options match fields set dscp modify dscp value (dscp 0–63) set tc modify cos value (tc 0–7) set pcp modify vlan priority (pcp 0–7) display and maintenance display and maintenance class map information class map information table 19 class map information view table 19 class map information view purpose commands description show class map configuration show class map class map name diffserv map information diffserv map information table 20 diffserv map information view table 20 diffserv map information view purpose commands description show diffserv map configuration show diffserv map \[ type { ip dscp { default | diffserv map name }| 8021p diffserv map name }] policy map information policy map information tables 21 pfc information view tables 21 pfc information view purpose commands description show policy map information show policy map pfc information pfc information table 22 pfc information view table 22 pfc information view purpose commands description show all interface pfc modes show interface priority flow control show pfc buffer profile configuration show buffer profile show pfc profile configuration show pfc profiles show pfc count show counters priority flow control clear pfc count clear counters priority flow control pfcwd information pfcwd information table 23 pfcwd information view table 23 pfcwd information view purpose commands description display pfcwd configuration show pfcwd configuration display pfcwd statistic information show pfcwd stats wred information wred information table 24 wred information view table 24 wred information view purpose commands description show wred profile configuration show wred profile name show the ecn enable status of an interface show interface ecn { detail } show ecn count show counters ecn cx308p 48y n v2 and cx532p n v2 are not supported now clear ecn count clear counters ecn ecn buffer usage view show counters ecn buffer interface interface name queue queue id queue id queue id not supported by cx308p 48y n v2 and cx532p n v2 queue information queue information table 25 queue information view table 25 queue information view purpose commands description show queue count show counters queue \[ interface name ] clear queue count clear counters queue typical configuration example typical configuration example example of priority mapping and queue scheduling configuration example of priority mapping and queue scheduling configuration network requirements the network structure of a data center is shown in the figure below there are three types of traffic accessing the internet in the network http, ftp and email, and the dscp bits in the corresponding messages are 33, 35 and 27 respectively the following requirements are required set the packet transmission priority on the switch as follows http>ftp>email when congestion occurs, priority will be given to the transmission of http messages, and http data must be sent first before other data is sent, and the ratio of ftp to email traffic will be 2 1 topology procedure configure each interface ip to enable users to access the network through the switch (skipped) check the default mapping relationship on the port and find that dscp33, 35 and 27 are mapped to local priority 0 according to the networking requirements, these three types of messages should be mapped to different queues here, dscp33, 35 and 27 are mapped to queues 5, 6 and 7 respectively as an example sonic# configure terminal sonic(config)# diffserv map type ip dscp dscp profile sonic(config diffservmap dscp profile)# ip dscp 33 cos 5 sonic(config diffservmap dscp profile)# ip dscp 35 cos 6 sonic(config diffservmap dscp profile)# ip dscp 27 cos 7 sonic(config diffservmap dscp profile)# exit sonic(config)# policy map pmap1 sonic(config pmap pmap1)# set cos dscp diffserv dscp profile sonic(config pmap pmap1)# exit sonic(config)# interface ethernet 0/0 sonic(config if 0/1)# service policy pmap1 configure dwrr+sp schedule on switch ethernet1 sonic(config)# policy map pmap2 sonic(config pmap pmap2)# queue scheduler queue limit percent 20 queue 6 sonic(config pmap pmap2)# queue scheduler queue limit percent 10 queue 7 sonic(config pmap pmap2)# queue scheduler priority queue 5 sonic(config)# interface ethernet 0/1 sonic(config if 0/1)# service policy pmap2 verify verify the configuration sonic# show diffserv map type ip dscp dscp profile diffserv map dscp profile type ip dscp from 27 to 7 from 33 to 5 from 35 to 6 sonic# show policy map ! policy map pmap1 set cos dscp diffserv dscp profile ! policy map pmap2 queue scheduler priority queue 5 queue scheduler queue limit percent 10 queue 7 queue scheduler queue limit percent 20 queue 6 sonic# show interface policy map port service policy \ 0/0 pmap1 0/1 pmap2 send the stream to verify check queue reception on switch port ethernet1 sonic# show counters queue 0/1 when congestion occurs, traffic on queue5 is sent first and there is no packet loss queue6 and 7 both experience packet loss and transmit traffic in a ratio of roughly 2 1 example of flow shape configuration example of flow shape configuration networking requirements the network structure of a data center is shown in the figure below the services from the network side of the group are data, voice and video, carrying 802 1p priorities of 2, 5 and 6 respectively bandwidth jitter may occur as the traffic rate on the ingress side of the switch is greater than the rate on the egress side in order to reduce bandwidth jitter while ensuring bandwidth requirements for all types of services, it is required that switch egress bandwidth limited to 1000mbit/s data bandwidth limited to 200mbit/s voice bandwidth limited to 300mbit/s video bandwidth limited to 500mbit/s topology procedure configure each interface ip to enable users to access the network through the switch (skipped) configure the priority mapping of dot1p to tc sonic# configure terminal sonic(config)# diffserv map type ip dscp dscp profile sonic(config diffservmap dscp profile)# ip dscp 2 cos 2 sonic(config diffservmap dscp profile)# ip dscp 5 cos 5 sonic(config diffservmap dscp profile)# ip dscp 6 cos 6 sonic(config diffservmap dscp profile)# exit sonic(config)# policy map pmap1 sonic(config pmap pmap1)# set cos dscp diffserv dscp profile sonic(config pmap pmap1)# exit sonic(config)# interface ethernet 0/0 sonic(config if 0/1)# service policy pmap1 configure port traffic shaping and queue traffic shaping on ethernet1 of the switch set pir=1000mb/s and pbs=1280000b sonic(config)# class map que2 sonic(config cmap c1)# match cos 2 sonic(config)# class map que5 sonic(config cmap c1)# match cos 5 sonic(config)# class map que6 sonic(config cmap c1)# match cos 6 sonic(config)# policy map pmap2 sonic(config pmap pmap2)# port shape 1000000000 1280000 sonic(config pmap pmap2)# queue scheduler priority queue 2 sonic(config pmap pmap2)# queue scheduler priority queue 5 sonic(config pmap pmap2)# queue scheduler priority queue 6 sonic(config pmap pmap2)# class que2 sonic(config pmap c)# queue shape 200000000 256000 sonic(config pmap c)# exit sonic(config pmap pmap1)# class que5 sonic(config pmap c)# queue shape 500000000 640000 sonic(config pmap c)# exit sonic(config pmap pmap2)# class que6 sonic(config pmap c)# queue shape 600000000 768000 sonic(config pmap c)# end sonic# configure terminal sonic(config)# interface ethernet 0/1 sonic(config if 0/1)# service policy pmap2 verify verify the configuration sonic# show diffserv map type ip dscp dscp profile diffserv map dscp profile type ip dscp from 2 to 2 from 5 to 5 from 6 to 6 sonic# show policy map ! policy map pmap1 set cos dscp diffserv dscp profile ! policy map pmap2 class que2 queue shape 200000000 256000 class que5 queue shape 500000000 640000 class que6 queue shape 600000000 768000 port shape 1000000000 1280000 queue scheduler priority queue 2 queue scheduler priority queue 5 queue scheduler priority queue 6 sonic# show interface policy map port service policy \ 0/0 pmap1 0/1 pmap2 send the stream to verify check the port count and queue count, and both meet the requirements show counters interface show counters queue 0/1
