QoS Principle
QoS Principle
QoS Principle
ISSUE 1.0
www.huawei.com
HUAWEI Confidential
master the following topics: Basic QoS concepts Traffic policing & traffic shaping Congestion control
Congestion avoidance
HUAWEI Confidential
page2
Chapter 1 Basic QoS Concepts Chapter 2 Packet Classification & Marking Chapter 3 Traffic Policing & Shaping Chapter 4 Congestion Control & Avoidance
HUAWEI Confidential
page3
quality of subscriber service in case of packet loss, delay, jitter and bandwidth during network communication.
Targets of IP QoS:
Avoid and control the IP network congestion. Reduce the packet loss rate of the IP packet. Adjust the traffic over the IP network. Provide private bandwidth for specific subscribers or services. Support real-time services on the IP network.
HUAWEI Confidential
page4
Bandwidth Limit
IP IP IP IP
HUAWEI Confidential
page5
End-to-End Delay
IP IP IP IP
Propagation Propagation Delay Delay (P2) (P2) Processing and Queuing Delay (Q2)
Propagation Propagation Delay Delay (P3) (P3) Processing and Queuing Delay (Q3)
Delay = P1 + Q1 + P2 + Q2 + P3 + Q3 + P4 = X ms
HUAWEI Confidential
page6
Delay
Forwarding
IP
IP
IP
IP
Processing Delay
HUAWEI Confidential
page7
Bandwidth
Packet Loss
Forwarding
IP
IP
IP
IP
IP
Tail-drop Tail-drop
Tail-drop occurs when the transmitting queue is overlong. It is the most common discarding way in case of link congestion. There are many other discarding ways such as input queue drop, ignore, overrun, no buffer, and so on. These ways are used in case of router congestion.
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page8
Compress the Headers IP TCP Data Compress the Payload Priority Queuing (PQ) Custom Queuing (CQ) Modified Deficit Round Robin (MDRR) Class-Based Weighted Fair Queing (CBWFQ)
Compressed Packet
Stacker Predictor
Expand the link bandwidth. Forward critical packets preferentially. Compress the valid load of the Layer2 frame. Compress the header of the IP packet.
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page9
IP
Data
Dropper
Custom Queuing (CQ) Modified Deficit Round Robin (MDRR) Class-Based Weighted Fair Queuing (CBWFQ)
Expand the link bandwidth. Provide adequate bandwidth for delay-sensitive services. Use the random discard mechanism to prevent congestion.
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page10
Low Low
HUAWEI Confidential
page11
HUAWEI Confidential
page12
specific QoS service by sending signaling. Within the range of traffic parameters, the network reserves resources to meet the requirement.
DiffServ: In case of network congestion, DiffServ controls traffic
based on services and forwards traffic to solve the congestion according to the committed QoS levels of various services.
HUAWEI Confidential
page13
Best-Effort
Best-Effort is a single and simple service model. Application programs can transmit any packet in any case if they
FIFO technology.
HUAWEI Confidential
page14
IntServ
Provide controllable and end-to-end service for applications. Network unit supports the QoS control mechanism. Application programs apply to the network for specific QoS
service.
Signaling protocols place the QoS request on network. Resource Reservation Protocol (RSVP) is the mainly used
signaling protocol.
HUAWEI Confidential
page15
IntServ
Local Local Admission Admission Control Control request Remote Remote Admission Admission Control Control request Policy Enforcement Point (PEP) request Local Local Admission Admission Control Control request
reserve
reserve
reserve
reserve
request
reply
HUAWEI Confidential
page16
Related Protocols
RSVP is a protocol for reserving resources. The receiver initiates RSVP to set up the resource reservation for the multicast and unicast data traffic. RSVP is used between the host and the network device (FRCs 2205 to 2215). Common Open Policy Service (COPS) is a simple protocol at the application layer. COPS uses the query/response mode. This protocol applies to the policy exchange between the policy server and the policy client. In the COPS protocol, policy server is also the policy decision point (PDP), such as SPS in SIG. Policy client is also the policy enforcement point (PEP), such as the MA5200F. (RFCs 2748 to 2753)
HUAWEI Confidential
page17
RSVP Application
RSVP is used to transmit voice or video data on the IP network through application programs. In this case, the host serves as the initiator. RSVP applies to the MPLS traffic engineering and sets up the MPLS/TE tunnel. In this case, the router serves as the initiator.
HUAWEI Confidential
page18
IntServ Application
RSVP
HUAWEI Confidential
page19
All Routers
WFQ applied per flow based on RSVP requests
HUAWEI Confidential
page20
Precedence Classifier
Premium Standard
WRED
Egress Router
RSVP protocol sent on to destination WFQ applied to manage egress flow
Ingress Router
RSVP protocol
Mapped to classes Passed through to egress
Backbone
WRED applied based on class
HUAWEI Confidential
page21
RSVP disadvantages
No expandability Transmission problems of successive signaling caused by the network structure configured with diversified attribute.
HUAWEI Confidential
page22
HUAWEI Confidential
page23
DiffServ network
Inner node Boundary node Boundary node
SLA/TCA
DiffServ network
Boundary node Inner node Boundary node
Traffic control
Subscriber network
Subscriber network
HUAWEI Confidential
page24
HUAWEI Confidential
page25
Packet Header
DSCP Field: 6 bits Former ToS Byte = New DS Field
DS code point : The DS node chooses corresponding PHB according to the DSCP value.
Unused: 2 bits
DS field: It contains the TOS of the IPV4 packet header or the traffic type field of IPV6 (defined by RFC2474).
HUAWEI Confidential
page26
DSCP Code
Three combinations xxxxx0: common xxxx11: pilot or for local use xxxx01: pilot or for local use (It can be also used as the formal one) Default DSCP: 000000 Default PHB: FIFO, tail-drop
HUAWEI Confidential
page27
Chapter 1 Basic QoS Concepts Chapter 2 Packet Classification & Marking Chapter 3 Traffic Policing & Shaping Chapter 4 Congestion Control & Avoidance
HUAWEI Confidential
page28
based on the classification result for the classification on the core network.
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page29
Chapter 1 Basic QoS Concepts Chapter 2 Packet Classification & Marking Chapter 3 Traffic Policing & Shaping Chapter 4 Congestion Control & Avoidance
HUAWEI Confidential
page30
Meter
Classifier
Traffic Stream
Marker
Dropper
HUAWEI Confidential
page31
WAN
No congestion on the egress. Queues and WRED do not work. Congestion occurs on links because no packet is intelligently discarded at layer 2.
64 kbps
FastEthernet
Internet
HUAWEI Confidential
page32
HUAWEI Confidential
page33
Use the token bucket mechanism to record the arrival rate of packets. The token bucket functions only on the condition of new packets. The conforming traffic and exceeding traffic are returned.
HUAWEI Confidential
page34
Token Bucket
700 200
500 bytes
Conform Action
500 bytes
HUAWEI Confidential
page35
200
300 bytes
Exceed Action
s byte 300
HUAWEI Confidential
page36
Token Bucket
Be
Link Utilization Bc Bc Bc Bc Bc Bc
Link BW
Average BW (CIR)
Tc
2*Tc
3*Tc
4*Tc
5*Tc
Time
Bc + Be
Bc refers to the normal burst traffic. Be refers to the excess burst traffic.
HUAWEI Confidential
page37
HUAWEI Confidential
page38
GTS
Meter
Classifier
Traffic Stream
Marker
Shaper Dropper
HUAWEI Confidential
page39
GTS Model
Forwarder
Classifier
No No Yes Yes No
Shaping WFQ
Classifier
No
Yes
Shaping WFQ
Classifier
Shaping WFQ
No
HUAWEI Confidential
page40
GTS Implementation
Transmit packets based on the configured traffic. Transmit packets based on the line rate. Transmit packets based on the line rate.
Shaping Queue
(WFQ)
Software Queue
(FIFO, PQ, CQ, WFQ, ...)
Hardware Queue
(FIFO)
Software queue does not work if the configured shaping rate is much less than the link bandwidth.
HUAWEI Confidential
page41
GTS Example #1
ISP expects to provide a service for subscribers. With this service, subscribers can use the whole E1 line for 30s in case of burst, but the normal rate is 256 kbps. GTS parameters Bit rate: 256,000 output rate is 256,000 bps Burst size32,000 the number of bits sent in 125 ms Excess burst size: 61,440,000 = 2,048,000 x 30
HUAWEI Confidential
page42
ethernet0/0 cir 256000 cbs 32000 ebs 61440000 serial1/0 cir 256000 cbs 32000 ebs 61440000
HUAWEI Confidential
page43
GTS Example #2
interface ethernet 0/0 qos gts acl 101 cir 64000 interface serial 1/0 qos gts acl 101 cir 64000 ! access-list 101 permit tcp any any eq www
Subscribers hope that the WEB traffic does not exceed 64 kbps.
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page44
CAR
Meter
Inbound or Outbound
Classifier
Marker
Dropper
HUAWEI Confidential
page45
Inbound
Classifier
Marker
Dropper
Forwarding
Outbound
Meter
Classifier
Marker
Dropper
Queuing
HUAWEI Confidential
page46
CAR Implementation
Transmit packets based on the configured traffic. Transmit packets based on the line rate. Transmit packets based on the line rate.
CAR
Software Queue
(FIFO, PQ, CQ, WFQ, ...)
Hardware Queue
(FIFO)
Software queue does not work if the configured CAR value is much less than the link bandwidth.
HUAWEI Confidential
page47
CAR Mechanism
drop
Class 1?
CAR
continue drop
transmit
Class 2?
CAR
continue
transmit
drop
Class n?
CAR
transmit
HUAWEI Confidential
page48
CAR Mechanism
Meter Forward or Enqueue
Conforms? Conforms?
Yes / No
Transmit? Transmit? No
Yes
Mark? Mark? Set Set IP IP Precedence? Precedence? Set Set DSCP? DSCP? Set Set MPLS MPLSExperimental? Experimental? Set Set QoS QoS group? group? Yes Set IP Precedence Set DSCP Set MPLS Experimental Set QoS Group
Continue? Continue? No
Yes
Yes
Drop? Drop?
Yes
Yes
Yes
HUAWEI Confidential
page49
HUAWEI Confidential
page50
Customer
2M bp s
2 Mbps
Internet
NAP
Customer
2
ps b M
ISP
Customer
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page51
HUAWEI Confidential
page52
Customer
NAP
ISP
interface serial 0/0 qos car input acl 101 cir 256000 cbs 4000 ebs 96000 green remark-prec-pass 1 red continue qos car input cir 256000 cbs 16000 ebs 24000 green remark-prec-pass 0 red discard qos car output acl 101 cir 512000 cbs 64000 ebs 128000 green remark-prec-pass 1 red continue qos car output cir 256000 cbs 16000 ebs 24000 green remark-prec-pass 0 red discard ! access-list 101 permit tcp any any eq www access-list 101 permit tcp any eq www any
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page53
Chapter 1 Basic QoS Concepts Chapter 2 Packet Classification & Marking Chapter 3 Traffic Policing & Shaping Chapter 4 Congestion Control & Avoidance
HUAWEI Confidential
page54
Congestion Control
Inbound
Outbound
In case of network congestion, guarantee that the packets with different
queues are guaranteed with different scheduling priorities, discarding probabilities, and bandwidth.
Algorithm
First In First Out (FIFO) Priority Queue (PQ) Custom Queue (CQ) Weighted Fair Queuing (WFQ)
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page55
FIFO Queuing
Forwarded Packets
FIFO Queuing System All All in in one one queue queue FIFO Scheduler Hardware Queuing System Hardware Q Interface
Tail-drop
Queue 1
FIFO
FIFO uses one queue. If the queue is full, the newly arrived packet is discarded.
HUAWEI Confidential
page56
Advantages FIFO is simple and fast. Support many devices manufactured by different vendors. Support all HUAWEI VRP versions. All switching channels support FIFO.
Disadvantages Cannot assign bandwidth fairly. Some traffic occupies bandwidth alone and make other traffic is discarded. Cause jitter and some burst traffic fill in all queues.
HUAWEI Confidential
page57
PQ
Forwarded Packets
Priority Queuing System
High? High?
Tail-drop
Queue 1
Medium? Medium?
Tail-drop
Normal? Normal?
Tail-drop
Queue 3
Low? Low?
Tail-drop
Queue 4
page58
PQ Classification
PQ classification supports the following options (for IP): Source interface IP access list (standard and extended) Fragments TCP source/destination port ID UDP source/destination port ID
HUAWEI Confidential
page59
PQ Classification
PQ also supports other protocol options: Other protocol access lists Packet length (longer or shorter than the specified length) The following protocols support PQ:
IPX CLNS DECnet AppleTalk VINES DLSw
HUAWEI Confidential
page60
PQ Insertion Policy
Each queue has its maximum capacity. Before packets are placed into queues, the router queues these packets if the queue is not full. Each class uses tail-drop.
HUAWEI Confidential
page61
PQ Scheduling
Packet Packet in in HIGH HIGH queue? queue? Yes No
No
No
No
Hardware Q
HUAWEI Confidential
page62
Advantages
Transmit the packets with high priority at short delay. Support devices manufactured by different vendors. Support all HUAWEI VRP versions.
Disadvantages
Each PQ class has the disadvantages of FIFO. The queue with low priority is discarded when congestion occurs in the queue with high priority. Configure the classification manually on each hop.
HUAWEI Confidential
page63
CQ
Forwarded Packets
Custom Queuing System
Class Class 1? 1?
Tail Drop
Queue 1
Class Class 2? 2?
Tail Drop
Tail Drop
Queue 16
HUAWEI Confidential
page64
CQ Flowchart
Forwarded Packets
Custom Queuing System Class 0? Tail Drop Queue 0 Custom queuing has Queue 00 for Custom queuing has Queue for system and link-level messages system and link-level messages that use pre-emptive scheduling. that use pre-emptive scheduling.
Class Class 1? 1?
Tail Drop
Queue Queue 1 1
Pre-emptive Pre-emptive Scheduler Scheduler
Class Class 2? 2?
Tail Drop
Queue Queue 2 2
Tail Drop
Queue Queue 16 16
Queue 1 is the lowest custom queue that is serviced by the roundrobin scheduler.
HUAWEI Confidential
page65
CQ Flowchart
Forwarded Packets
Custom Queuing System Class Class 0? 0? Tail Tail Drop Drop Queue Queue 0 0 Custom queues can be configured to use the preemptive scheduler.
Class Class 1? 1?
Tail Drop
Queue Queue 1 1
Pre-emptive Pre-emptive Scheduler Scheduler
Class Class 2? 2?
Tail Drop
Queue Queue 2 2
RoundRoundRobin Robin Scheduler Scheduler Class Class 16? 16? Tail Drop Queue Queue 16 16
Queue 2 is now the lowest custom queue that is serviced by the roundrobin scheduler.
HUAWEI Confidential
page66
CQ Classification
CQ classification covers the following options (for IP): Source interface IP access list (standard and extended) Packet length (longer or shorter than the specified length) Fragments TCP source/destination port ID UDP source/destination port ID CQ classification is the same as the PQ classification.
HUAWEI Confidential
page67
CQ Insertion Policy
Each queue has its maximum capacity. Before packets are placed into queues, the router queues these packets if the queue is not full. Each class uses taildrop.
HUAWEI Confidential
page68
CQ Scheduling
No Packet Packet in in Queue N? Queue N? Yes No Next Queue (increase N) Yes Is Is Queue Queue N N over the over the threshold? threshold?
Dispatch Packet
Hardware Q
CQ uses the round-robin scheduling. Each queue uses the round-robin scheduling to transmit packets according to the pre-configured threshold.
HUAWEI Confidential
page69
CQ Scheduling
1500
1499
1500
Threshold (byte-count) = 3000 Up to 4499 bytes can be forwarded in one round in the worst case.
The threshold parameter byte-count defines the maximum byte number in each forwarding for queues. The router allows to send out a complete packet, even though the byte number exceeds the threshold.
HUAWEI Confidential
page70
Advantages Guarantee the service for all queues, and no traffic is discarded. Support devices manufactured by different vendors. Support all HUAWEI VRP versions.
Disadvantages Each CQ class has the disadvantages of FIFO. Configure the classification manually on each hop. Bandwidth is assigned inaccurately. Scheduling causes jitter.
HUAWEI Confidential
page71
WFQ
Forwarded Packets
Weighted Fair Queuing System
Flow Flow1? 1?
WFQ drop
Queue 1
Flow Flow2? 2?
WFQ drop
Flow FlowN? N?
WFQ drop
Queue N
page72
WFQ Tool
Parameter Classification mechanism Weighted fairness Each queue uses the improved tail-drop.
HUAWEI Confidential
page73
WFQ Classification
IP TCP Payload
WFQ WFQ classification classification uses uses the the following parameters: following parameters: Source Source IP IP address address Destination Destination IP IP address address Source Source TCP/UDP TCP/UDP port port Destination TCP/UDP Destination TCP/UDP port port Transport protocol Transport protocol Type Type of of service service (ToS) (ToS) The The HASH HASH algorithm algorithm is is used used to to provide provide queue queue indexes indexes when when packets packets enter enter the the queue. queue.
Protocol
ToS
Src. Port
Dest. Port
Hash Algorithm
The packets of the same traffic are terminated in the same queue. The TOS field is the only changeable parameter. Changing this parameter enables the packets of the same traffic to be terminated in different queues.
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page74
Yes
No
Hold-queue out limit (HQO) restricts the total number of packets that can be placed in all queues. Congestive discard threshold (CDT) limits the number of packets that can be placed in each queue. N is an SN given to the classified packets before the decision that whether the packets enter the queues or are discarded.
HUAWEI Confidential
Case Study
WFQ can contain 10 packets at maximum (hold-queue limit = 10). The early packet discarding (for the invasive packet to bandwidth) should be enabled when eight packets arrive. And eight packets is the threshold for discarding packets in case of congestion.
HUAWEI Confidential
page76
HQO reaches its upper threshold 10. Newly arrived packets are discarded as the TDM system places them at the end.
HUAWEI Confidential
page77
HQO reaches its upper threshold 10. Newly arrived packets are not discarded as the TDM system does not place them at the end. Instead, the packets placed at the end are discarded.
HUAWEI Confidential
page78
CDT exceeds its upper limit 8. Newly arrived packets are discarded for the TDM system places them at the end.
HUAWEI Confidential
page79
CDT exceeds its upper limit 8. Newly arrived packets enter the queue as they are not placed at the end.
HUAWEI Confidential
page80
The packets that are placed in the empty sub-queue will not be discarded forever. The packet priority does not affect the discarding mechanism.
HUAWEI Confidential
WFQ Scheduling
Each packet are marked with the finish time in the TDM system. WFQ scheduling mechanism sends the packets marked with the earliest finish time out of the TDM system.
refer to the On the Efficient Implementation of Fair Queuing, written by Keshav and Berkeley in 1994.
HUAWEI Confidential
page82
Weight
WFQ System (Real-Size Packets)
Flow with P=001 Flow with P=000
2 3 2
1 1
Precedence-1 packets appear half the real size.
4 3
3 2
2 1
1
Precedence-1 flow gets twice as much bandwidth as Precedence-0 flow.
HUAWEI Confidential
page83
HUAWEI Confidential
page84
Advantages Be simple to configure. Guarantee the transmission of all traffic. Preferentially discard the packets that is invasive to bandwidth. Support devices manufactured by different vendors. Support all HUAWEI VRP versions.
Disadvantages
Each WFQ class has all disadvantages of FIFO.
Multiple traffic is terminated in a queue. Cannot configure classification. Cannot guarantee a certain bandwidth. Performance is damaged by complex classification and scheduling mechanisms.
HUAWEI Confidential
page85
HUAWEI Confidential
page86
Disadvantages of Tail-Drop
Simple tail dropping has significant disadvantages: TCP synchronization TCP starvation High delay and jitter Packet discarding without distinguishing them Have no better way to provide the feedback of TCP traffic
HUAWEI Confidential
page87
TCP Synchronization
Multiple TCP sessions begin at different time. The TCP slide window increases. Tail-drop causes the packet of multiple sessions lost at the same time. Multiple TCP sessions restart at the same time (synchronization).
HUAWEI Confidential
page88
Prec. 0
Prec. 0
Queue
Delay
Tail-drop is regardless of the IP priority. If the interface congestion persists, traffic suffers delay for a long time.
Too long queue causes delay. A large amount of invasive traffic causes other traffic discarded. Frequent buffer changes cause jitter. Discard packets without distinguishing them.
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
page89
HUAWEI Confidential
page90
RED Profile
Drop Probability 100% No drop Random drop Full drop
10% 20 40
Minimum Threshold
Maximum Threshold
HUAWEI Confidential
page91
RED Modes
RED has the following modes:
No drop: It functions when the average queue length is between 0 and the lower threshold. Random drop: It functions when the average queue length is between the upper and the lower thresholds. Full drop/tail drop: It functions when the average queue length is equal to or bigger than the upper threshold.
HUAWEI Confidential
page92
Before RED
The TCP synchronization prevents the value of average link use from approaching to the link bandwidth. Tail drops slows down the TCP session start.
HUAWEI Confidential
page93
After RED
The value of average link use gets close to the link bandwidth. Random drops reduces the value of slide windows for the TCP session.
HUAWEI Confidential
page94
WRED
Compared with RED, WRED introduces weight. Various weights have different discarding policy. Each discarding policy contains three RED parameters: Lower threshold Upper threshold Upper discarding probability Weight can be IP Precedence (8 profiles) DSCP (64 profiles) At present, the WRED weight can be divided according to DSCP and the IP priority. The probability of discarding the packet of low priority is higher than that of the packet of high priority.
HUAWEI Confidential
page95
10% 10 20 40
WRED profiles can be manually set. WRED has 8 default value sets for IP priority-based WRED. WRED has 64 default value sets for DSCP-based WRED.
HUAWEI Confidential
page96
100%
10%
IP Precedence
20
HUAWEI TECHNOLOGIES CO., LTD.
1 2 3 22 24 26
4 5 6 7 RSVP 28 31 33 35 37 40
HUAWEI Confidential
page97
100%
10%
20
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential
36 40
page98
100%
Assured Forwarding Low Drop Assured Forwarding Medium Drop Assured Forwarding High Drop
10%
Average Queue Size
20 24
HUAWEI TECHNOLOGIES CO., LTD.
28 32
40
HUAWEI Confidential
page99
WRED Model
Calculating the average queue length
Queue Queue No Full? Full? Yes Current Queue Size FIFO Queue
IP Packet
IP Precedence or DSCP
WRED
Random Drop
Tail Drop
HUAWEI Confidential
page
WRED Policy
IP Priority 0 1 2 3 4 5 6 7 Meaning High-drop, best-effort traffic Low-drop, best-effort traffic Premium traffic outside of the contract Premium traffic in the contract Unused Voice over IP Routing protocol traffic Routing protocol traffic
HUAWEI Confidential
page
WRED Examples
VoIP Routing
0.1
RSVP
HUAWEI Confidential
page
Thank you
www.huawei.com