ISP QoS Lab

Source: Internet
Author: User
Tags flushes map class

ISP QoS Lab
In ISP QoS Lab1-PQ Priority Queue (PQ, Priority Queue), four queues are high, medium, normal, and low Priority. Data packets are placed in different queues according to prior definitions. routers provide services in high, medium, normal, and low order. Only a queue with a high priority is empty before serving as a queue with a medium priority, and so on. This ensures that high-priority data packets must be prioritized. However, if the queue with high priority is not empty for a long time, the queue with low priority will never be served. We can set a length for each queue. When the queue is full, packets will be discarded R1 (config) # priority-list 1 protocol ip? \ Four priorities can be defined: highmediumnormallowR1 (config) # priority-list 1 protocol ip high tcp 23 \ we put telenet traffic at the highest priority R1 (config) # priority-list 1 interface f0/0 medium \ place the traffic received by an interface in the middle priority R1 (config) # priority-list 1 default lowR1 (config) # int f1/0R1 (config-if) # priR1 (config-if) # priority-group? <1-16> Priority groupR1 (config-if) # priority-group 1R1 # sh int f1/0FastEthernet1/0 is up, line protocol is upHardware is AmdFE, address is cc00.2618.0010 (bia cc00.2618.0010) Internet address is 192.168.12.1/24MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not setKeepalive set (10 sec) Full-duplex, 100 Mb/s, 100 BaseTX/FXARP type: ARPA, ARP Timeout 04: 00: 00 Last input 00:00:04, output 00:00:01, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: priority-list 1 Output queue (queue priority: size/max/drops): high: 0/20/0, medium: 0/40/0, normal: 0/60/0, low: 0/80/0R1 # show queueing priorityCurrent DLCI priority queue Ratio N: Current priority queue configuration: List Queue Args1 low default1 high protocol ip tcp port telnet1 medium interface FastEthernet0/02-CQ Custom Queue (CQ, Custom queue) is different from PQ, there are 16 queues in CQ. Data packets are placed in different queues according to the definition in advance. The router will serve a certain number of packets or bytes of data packets in the first queue, and then switch to the second queue service. We can define the depth of different queues to ensure that a queue has a large number of data packets, but it will never be served. The queue 0 in CQ is special. Only when the queue 0 is empty can it serve other queues. R1 (config) # queue-list 1 protocol ip 1 tcp telnet \ put telenet traffic in queue 1 R1 (config) # queue-list 1 default 6 \ other traffic is put in queue 6 by default R1 (config) # int f1/0R1 (config-if) # custom-queue-list 1R1 # sh int f1/0FastEthernet1/0 is up, line protocol is upHardware is AmdFE, address is cc00.2618.0010 (bia cc00.2618.0010) internet address is 192.168.12.1/24MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, Rxload 1/255 Encapsulation ARPA, loopback not setKeepalive set (10 sec) Full-duplex, 100 Mb/s, 100 BaseTX/FXARP type: ARPA, ARP Timeout 04: 00: 00 Last input 00:00:00, output 00:00:01, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: custom-list 1 Output queues: (queue #: size/max/drops) 0: 0/20/0 1: 0 /20/0 2: 0/20/0 3: 0/20/0 4: 0/20/05: 0/20/0 6: 0/20/0 7: 0/20/0 8: 0/20/0 9: 0/20/010: 0/20/0 11: 0/20/0 12: 0/20/0 13: 0/20/0 14: 0/20/015: 0/20/0 16: 0/20/05 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec3-WFQ weighted Fair Queue (WFQ, Weight Fair Queue) is the default setting for low-speed links (less than 2.048 M. WFQ separates data packets into different streams. For example, you can use IP addresses and port numbers to distinguish different TCP streams or UDP streams in an IP address. WFQ allocates different bandwidths for different streams based on their weights. the weights are the priority fields in IP data packets. For example, if there are three streams, the priority of the two streams is 0, the third is 5, and the total weight is (1 + 1 + 6) = 8, the first two streams get 1/8 of the bandwidth, and the third stream gets 6/8. R1 (config) # int f1/0R1 (config-if) # fair-queue 512 1024 10 \ and above enable WFQ on the interface. In fact, the speed of E1 (2.048 M) or at a lower speed, WFQ is enabled by default. 512 indicates the dropped value. When the number of data packets in the queue reaches 512, the data is discarded. 1024 indicates the maximum number of sessions, and 10 indicates the RSVP reserved queue. Show int f1/0 Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fairOutput queue: 0/1000/512/0 (size/max total/threshold/drops) Conversations 0/1/1024 (active/max total) Reserved Conversations 0/0 (allocated/max allocated) available Bandwidth 75000 kilobits/sec4-CBWFQ Class-Based weighted Fair Queue (CBWFQ, Class-Based Weight Fair Queue) allows users to customize classes and control the Bandwidth of these classes. This is useful in practice. For example, we can control the bandwidth of web traffic when our network accesses the Internet. You can define the traffic type in advance based on the protocol type, ACL, IP priority, or input interface of the data packet, and configure the maximum bandwidth and the percentage of the interface bandwidth used for different types of traffic. CBWFQ can be used together with NBAR and WRED. Step 1: define Class mapR1 (config) # class-map match-any map1R1 (config-cmap) # match protocol httpR1 (config-cmap) # match protocol ftpR1 (config-cmap) # exitR1 (config) # class-map match-all map2R1 (config-cmap) # match protocol telnetStep2: Define the Policy-MapR1 (config) # policy-map my-policyR1 (config-pmap) # class map1R1 (config-pmap-c) # bandwidth 60R1 (config-pmap-c) # class map2R1 (config-pmap-c) # bandwidth 10R1 (config-pmap-c) # exitSt Ep3: Call the interface R1 (config) # int f1/0R1 (config-if) # service-policy output my-polic [technical points] the class-map command format is: "class-map [match-all | match-any] name": match-all: specifies that all the following conditions must be met before execution. This is the default value; match-any: match any condition. In class-map mode, you can set various matching conditions. For example, match a protocol type: match protocol-name. There are hundreds of specific protocols, including EGP, ICMP, VPN, DNS, HTTP, and Telnet. Matched access list: match access-group {number | name acl_name }. It can match the number-based list and Name-based Access list. Match CoS (class of Servie): match cos-value. Match the CoS value in the IP package. IP Precedence: match IP precedence-value. Match the IP priority value in the IP package. Differentiated Services Code Point: match ip DSCP dscp_value. Match the DSCP value in the IP package. Match input interface: match input-interface type number. Interface that matches the IP package. R1 # show class-mapClass Map match-any class-default (id 0) Match anyClass Map match-any map1 (id 1) match protocol httpMatch protocol ftpClass Map match-all map2 (id 2) Match protocol telnetR1 # show policy-mapPolicy Map my-policyClass map1Bandwidth 60 (kbps) Max Threshold 64 (packets) the configuration of Class map2Bandwidth 10 (kbps) Max Threshold 64 (packets) 5-LLQ Low-Latency Queue (LLQ, Low Latency Queue) is similar to that of CBWFQ. Some data packets, such as VOIP data packets, are very sensitive to data delay. LLQ allows you to customize data classes and prioritize data transmission for these classes. Data of other classes will not be transmitted before the data is transmitted. LLQ = CBWFQ + PQDefault queue WFQR1 (config) # class-map match-any map3R1 (config-cmap) # match ip precedence criticalR1 (config-cmap) # exitR1 (config) # policyR1 (config) # policy-map my-policyR1 (config-pmap) # class map3R1 (config-pmap-c) # priority? <8-2000000> Kilo Bits per secondpercent % of total bandwidthR1 (config-pmap-c) # priority 15 \ LLQ configuration is similar to CQWFQ configuration, but the priority command is used, here we limit the bandwidth to 15 kb. packets exceeding this bandwidth will be discarded. In this way, the traffic of the CLASS-MAP3 will be sent first, and then the traffic such as the CLASS-MAP1 and CLASS-MAP2 will be sent. R1 # sh policy-map interface f1/0FastEthernet1/0Class-map: map3 (match-any) 0 packets, 0 bytes5 minute offered rate 0 bps, drop rate 0 bpsMatch: ip precedence 50 packets, 0 bytes5 minute rate 0 Bytes PriorityOutput Queue: Conversation 264 Bandwidth 15 (kbps) Burst 375 (bytes) (pkts matched/bytes matched) 0/0 (total drops/Bytes drops) 0/0Class-map: class-default (match-any) 763 packets, 63162 B Ytes5 minute offered rate 0 bps, drop rate 0 bpsMatch: anyR1 (config) # policy-map my-policyR1 (config-pmap) # class class-defaultR1 (config-pmap-c )#? QoS policy-map class configuration commands: bandwidth merge Activate Compressiondrop all packetsexit Exit from QoS class action configuration modefair-queue Enable Flow-based Fair Queuing in this Classnetflow-sampler NetFlow actionno Negate or set default values of a commandpolice limit Scheduling priority for this Classqueue-limit Queue Max Threshold for Tail Dr Oprandom-detect Enable Random Early Detection as drop policyservice-policy Configure Flow Nextset Set QoS valuesshape Traffic ShapingR1 (config-pmap-c) # no fair-queue \ changing the default queue mechanism 6-WRED weighted Random Early Detection (WRED, Weight Random Early Detect) is the Cisco Implementation of RED. When multiple TCP connections transmit data, all connections transmit data according to the maximum capacity, which quickly results in full queue and all data is lost when the queue is full; at this time, all senders transmit data at the same time with the minimum capacity, and the bandwidth starts to idle. Then all the senders began to increase the speed slowly, and at the same time reached the maximum rate, and there was congestion, so repeatedly. In this way, the bandwidth utilization is not high when the network is blocked in time and space. RED discards TCP packets randomly to ensure the overall utilization of the link. WRED is an improvement on RED. data packets are divided into different queues Based on IP priority. Each queue has a minimum threshold value and a maximum threshold value. When the average length is smaller than the minimum threshold value, data packets are not discarded; as the length of the average queue increases, the probability of dropping is also increased. When the average length is greater than the maximum threshold value, data packets are discarded according to the set proportion. R1 (config) # int f1/0R1 (config-if) # random-detect/And above enable WREDR1 (config-if) on the Interface) # random-detect precedence 0 18 42 12 // a queue with a configured IP priority of 0 or above, with a minimum threshold of 18. If the average queue length is less than 18, data packets will not be discarded; when the average queue length is greater than 18, data packets are discarded. The larger the average queue length, the more data packets are discarded. the maximum threshold is 42 and the average queue length is less than 42, data packets are discarded at a rate of 1/12. R1 # show queueing random-detectCurrent random-detect configuration: FastEthernet1/0 Queueing strategy: random early detection (WRED) Random-detect not active on the dialerExp-weight-constant: 9 (1/512) Mean queue depth: 0 class Random drop Tail drop Minimum Maximum Markpkts/bytes pkts/bytes thresh prob0 0/0 0/0 1/121 18 42 0/0 0/0 22 40 1/102 0/0 24 40 0/0 26 40 1/103 0/0 28 40 1 /105 0/0 0/0 31 40 1/106 0/0 33 40 0/0 1/107 0/0 35 40 0/0 rsvp 1/10 0/0 37 40 0/0 \ The WRED configuration is displayed, by default, the queues with different IP priorities have different minimum values. We changed the queues with the IP priority of 0. 7-CAR's committed Access Rate (CAR, Commited Access Rate) is a traffic policy classification and marking method, it limits the IP traffic rate based on IP priority, DSCP value, MAC address, or access control list. The IP priority or DSCP can be changed. The CAR uses the token bucket mechanism to check whether there are sufficient tokens in the token bucket. If an interface has an available token, the token can be removed from the token bucket and the packet is forwarded. When the time interval passes, the token will be added to the token bucket again. If the interface does not have an available token, the CAR can define the behavior of the data packet. CAR uses three rate definitions to define the traffic rate: Normal rate (Normal rate): the average rate of the token added to the token bucket, that is, the average data packet transmission rate. 1-Normal burst (Normal burst): The Normal traffic rate is allowed during the Normal burst period. 2-Excess burst: exceeds normal traffic bursts. When an excessive traffic spike is configured, the token is used and added to the token bucket to allow a certain amount of traffic bursts. When the borrowed token is used, any excess traffic received on this interface will be thrown away. Traffic bursts only occur in a short period of time and stop transmission until there is no token in the token bucket. We recommend that you set the normal traffic rate to equal to the average traffic rate within a period of time. The normal burst rate should be 1.5 times the normal rate. The excess rate is twice the normal burst rate. R1 (config-if) # rate-limit output access-group 101 64000 12000 16000 conform-actionset-prec-transmit 3 exceed-action set-prec-transmit 0 // The CAR is enabled on the interface, for traffic conforming to ACL 101, the average rate is 64000 bits/s, the normal traffic volume is 12000 Bytes/s, and the excessive traffic volume is 12000 Bytes/s. Rate-limit {output | input} {cir bc be} conform-action {action} exceed-action {action} The unit of CIR is bit/s; the unit of BC and BE is byte/s. The condition of conform-action is that when the data to be sent is smaller than the normal burst (bc), exceed-action refers to the time when the data to be sent is larger than the normal burst and smaller than the maximum burst (be. Action options include the following: continue to execute the next CAR statement drop: discard packet tranmsit: forward packet set-prec-continue {precedence }: set the IP priority and run the next CAR statement set-prec-transmit {precedence}: set the IP priority and forward the packet set-dscp-continue {dscp }: set-dscp-transmit {dscp}: sets the dscp value and forwards the packet R1 # show interfaces rate-limit9-NBAR network-based application recognition (NBAR, network Based Application Recognition) is actually a classification engine that views data packets and analyzes the information contained in data packets. NBAR not only enables the router to forward data, but also checks data packets, which greatly increases the load. NBAR can check the content at the application layer. For example, it can check whether the URL contains ". java. NBAR can be used with many QOS instances. R1 (config) # class-map exchangeR1 (config-cmap) # match protocol exchangeR1 (config-cmap) # exitR1 (config) # policy-map deny-exchangeR1 (config-pmap) # class exchangeR1 (config-pmap-c )#? QoS policy-map class configuration commands: bandwidth limit Activate Compressiondrop all packetsexit Exit from QoS class action configuration modenetflow-sampler NetFlow actionno Negate or set default values of a commandpolice limit Strict Scheduling Priority for this Classqueue-limit Queue Max limit for Tail droprandom-detect Enable Random Early Detection as drop p Olicyservice-policy Configure Flow Nextset Set QoS valuesshape Traffic ShapingR1 (config-pmap-c) # dropR1 (config) # int f1/0R1 (config-if) # The configuration of service-policy output deny-exchangeNABR is no different from that of CBWFQ, because NBAR is actually just a classification technology. In the old IOS, commands such as "match protocol bittorrent" cannot be used in class-map mode. You must download bittorrent from the Cisco website first. upload files such as pdlm to the FLASH on the vro and run the "ip nbar pdlm flash: bittorrent. before using the "matchprotocol bittorrent" command in class-map mode. [Note] the NBAR router needs to enable CEF. By default, CEF is enabled. If not, run the "ip cef" command. 10-command summary priority-list 1 protocol ip high tcp telnet creates a priority queue, marked as 1. Put telnet traffic in a high-priority queue priority-list 1 queue-limit 20 30 40 50 define priority queue length priority-group 1 in High, Medium, normal, and low queues set the defined priority show queueing priority on the queue application interface to view the priority queue status debug priority debug the priority queue-list 1 protocol ip 1 tcp telnet to create a custom queue, 1. Put the telnet traffic in queue 1. The queue-list 1 queue 1 limit 40 defines the depth of queue 1 as 40, custom-queue-list 1: Set fair-queue 512 1024 10 on the custom queue application interface to enable WFQ on the interface. 512 indicates the dropped value, and 1024 indicates the maximum number of sessions, 10 is the RSVP reserved queue class-map match-any CLASS-MAP1 defined class-map, named CLASS-MAP1match protocol http match http protocol

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.