You are on page 1of 103

For internal use only

QoS Principle
ISSUE 1.0
www.huawei.com

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

By taking this course, we can

master the following topics: Basic QoS concepts Traffic policing & traffic shaping Congestion control

Congestion avoidance

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page2

Chapter 1 Basic QoS Concepts Chapter 2 Packet Classification & Marking Chapter 3 Traffic Policing & Shaping Chapter 4 Congestion Control & Avoidance

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page3

Basic QoS Concepts


QoS stands for the quality of service. It refers to the expected

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page4

Bandwidth Limit
IP IP IP IP

512 kbps 256 kbps 10 Mbps 100 Mbps

BWmax = min(10M, 256k, 512k, 100M)=256 kbps BWavail = BWmax /Flows

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page5

End-to-End Delay
IP IP IP IP

Propagation Delay (P1) Processing and Queuing Delay (Q1)

Propagation Propagation Delay Delay (P2) (P2) Processing and Queuing Delay (Q2)

Propagation Propagation Delay Delay (P3) (P3) Processing and Queuing Delay (Q3)

Propagation Delay (P4)

Delay = P1 + Q1 + P2 + Q2 + P3 + Q3 + P4 = X ms

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page6

Delay

Forwarding

IP

IP

IP

IP

Processing Delay

Queuing Delay Transit Delay

Processing delay Queuing delay Transit delay

HUAWEI TECHNOLOGIES CO., LTD.

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

How To Reduce Delay?


TCP Header Compression RTP Header Compression cTCP Data

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)

Fancy FIFO queuing Queuing

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

How To Reduce the Packet Loss Rate?

Weighted Random Early Detection (WRED)

IP

Data

Dropper

Fancy FIFO queuing Queuing

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

Mapping Between Services and QoS Requirements


Throughput Interactive (e.g., Telnet) Batch (e.g., FTP) Fragile (e.g,. SNA) Voice Video Low High Low Low High Delay Low Not important Loss Low Low None Low Low Jitter Not important Not important Not important

Low Low and predictable Low and predictable

Low Low

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page11

Different Effects of Various Services


Throughput Gold Silver Bronze Best Effort Guaranteed Guaranteed Guaranteed limited No guarantee Delay Low No guarantee No guarantee No guarantee Loss Low No guarantee No guarantee No guarantee Jitter Low No guarantee No guarantee No guarantee

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page12

Three IP QoS Models


Best-Effort: It is the default service model of Internet. Best-Effort

uses the first-in-first-out (FIFO) queue.


IntServ: In this model, the service applies to the network for

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 TECHNOLOGIES CO., LTD.

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

are permitted or inform the network of the transmission.


Network tries everything to transmit the packets but does not

guarantee the delay and reliability.


Best-Effort service is the default service model of Internet. It uses

FIFO technology.

HUAWEI TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

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

Policy Decision Point (PDP)

Resource reservation Admission control

HUAWEI TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page18

IntServ Application
RSVP

Class of Service or Best Effort

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page19

IntServ Application End-to-End


RSVP

All Routers
WFQ applied per flow based on RSVP requests

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page20

IntServ DiffServ Integration


RSVP RSVP

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

HUAWEI TECHNOLOGIES CO., LTD.

page21

IntServ Advantages & Disadvantages


+ RSVP advantages
Simple to control (end-to-end) Dynamic signaling port (such as H.323)

RSVP disadvantages
No expandability Transmission problems of successive signaling caused by the network structure configured with diversified attribute.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page22

Common Open Policy Service


Compared with RSVP, COPS has the following advantages:
Manage services in an integrated manner. authorize and access the RSVP traffic in an integrated manner.

QoS-based RSVP solution has more expandability.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page23

DiffServ Model Structure


Various DS fields can have different PHB to provide diversified policies based on services. Cross-regional services are offered between these DS fields by balancing SLA and TCA. . Service Level Agreement (SLA): It refers to the expected quality of the service traffic transmitted over networks. . Traffic Control Agreement (TCA): It is an agreement on the service classification rules, service models, and the related processing. PHB determines the policy of the services provided by the DS filed. DS nodes forward packets according to the PHB attribute. Classify services and adjust traffic on the edge of network. - Service classification . Based on the DS field . Based on other features - Traffic adjustment . Measure . Mark . Discard . Shape

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page24

Differentiated Services Model


The Differentiated Services model describes the relationship between the service and the traffic classification. Classification and shaping of integrated traffic is completed on the edge router. No per-flow/per-application status exists at the core layer. The core layer completes only simple per-hop behaviors during the traffic aggregation. Its aims at retractility.

HUAWEI TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page27

Chapter 1 Basic QoS Concepts Chapter 2 Packet Classification & Marking Chapter 3 Traffic Policing & Shaping Chapter 4 Congestion Control & Avoidance

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page28

Packet Classification & Marking


ACL , IP priority

Packet classification and marking is the foundation for

implementing the QoS service.


Packet classification uses the ACL and IP priority technologies. Forward packets to other modules to process or mark (coloring)

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page30

Traffic Shaping and Policing

Meter

Classifier
Traffic Stream

Marker

Dropper

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page31

Application of Traffic Shaping or Policing


High-Speed Link Low-Speed Link

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.

256 kbps The access resources are limited.

64 kbps

Use TDM on a single physical link or lease links.

FastEthernet

128 kbps Server Farm

Internet

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page32

Traffic Shaping vs. Traffic Policing


Traffic Shaping Traffic shaping does not discard packets. Traffic shaping displays the congestion of frame relay communication. Traffic Policing Traffic policing supports the packet marking. Traffic policing does not require Buffer to be added, whereas traffic shaping requires additional queue system.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page33

How Does the Router Measure the Traffic Speed?


Bandwidth

Link Bandwidth Exceeding Traffic Rate Limit Conforming Traffic Time

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page34

Token Bucket

700 200

500 bytes

Conform Action

500 bytes

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page35

Token Bucket (cont.)

200

300 bytes

Exceed Action

s byte 300

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page36

Token Bucket
Be

Bc of tokens is added every Tc [ms] Tc = Bc / CIR

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page37

Traffic Shaping & Policing Mechanism


Shaping Generic traffic shaping (GTS) Frame Relay traffic shaping (FRTS) Class-based traffic shaping Policing Committed access rate (CAR) Class-based traffic policing

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page38

GTS

Meter

Classifier
Traffic Stream

Marker

Shaper Dropper

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page39

GTS Model
Forwarder
Classifier
No No Yes Yes No

Shaping WFQ

Classifier
No

Yes

Shaping WFQ

Yes Yes No Yes

Classifier

Shaping WFQ

No

Physical Interface Queue(s)

HUAWEI TECHNOLOGIES CO., LTD.

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)

If the hardware queue is empty skip over it directly.

Software queue does not work if the configured shaping rate is much less than the link bandwidth.

HUAWEI TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page42

GTS Example #1 (cont.)

WAN Core Customer

interface qos gts ! interface qos gts

ethernet0/0 cir 256000 cbs 32000 ebs 61440000 serial1/0 cir 256000 cbs 32000 ebs 61440000

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page43

GTS Example #2

WAN Core Customer

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page45

CAR Can Be Configured Both on the Egress and Ingress.


Meter

Inbound

Classifier

Marker

Dropper

Forwarding
Outbound

Meter

Classifier

Marker

Dropper

Queuing

HUAWEI TECHNOLOGIES CO., LTD.

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)

If the hardware queue is empty skip over it directly.

Software queue does not work if the configured CAR value is much less than the link bandwidth.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page47

CAR Mechanism
drop

Class 1?

CAR
continue drop

transmit

Class 2?

CAR
continue

transmit

Output Queue or Forward

drop

Class n?

CAR

transmit

The CAR mechanism has three behaviors:


Transmit Continue Drop

HUAWEI TECHNOLOGIES CO., LTD.

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

Go to Next CAR Command

Yes

Drop? Drop?

Yes

Yes

Yes

Marking depends on the configured conform and exceed parameters.


HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page49

CAR: Limiting Example #1


ISP connects all customers through the 2M leased link (or ADSL) by using CAR to limit the communication traffic. Provide various services according to the customer demand.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page50

CAR: Limiting Example #1 (cont.)


interface serial 0/0 qos car input cir 256000 cbs 4000 ebs 96000 green pass red discard qos car output cir 256000 cbs 4000 ebs 96000 green pass red discard

Customer

2M bp s

2 Mbps

Internet
NAP

Customer
2

ps b M

ISP

Customer
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential

page51

CAR: Limiting and Marking Example #2


The WEB traffic is limited as 512 kbps and with high priority. The priority of excess traffic is the same as that of normal traffic. All traffic cannot exceed 256 kbps and should have the priority 0. Excess traffic is discarded. Normal burst traffic is 16000 bytes. Extra burst traffic is 24000 bytes.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page52

CAR: Limiting and Marking Example #2 (cont.)


2 Mbps Internet

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page54

Congestion Control
Inbound

Outbound
In case of network congestion, guarantee that the packets with different

priorities can get different QoS, including delay and bandwidth.


Place the packets with different priorities into different queues. Various

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.

All packets are classified into a class.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page56

FIFO Advantages & Disadvantages


+

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page57

PQ
Forwarded Packets
Priority Queuing System

High? High?

Tail-drop

Queue 1

Medium? Medium?

Tail-drop

Queue 2 Pre-emptive Scheduler

Hardware Queuing System Hardware Q Interface

Normal? Normal?

Tail-drop

Queue 3

Low? Low?

Tail-drop

Queue 4

PQ uses 4 FIFO queues.


HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page61

PQ Scheduling
Packet Packet in in HIGH HIGH queue? queue? Yes No

Packet Packet in in MEDIUM MEDIUM queue? queue? Yes

No

Packet Packet in in NORMAL NORMAL queue? queue? Yes

No

Packet Packet in in LOW LOW queue? queue? Yes

No

Dispatch packet and start checking the HIGH queue again

Hardware Q

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page62

PQ Advantages & Disadvantages


+

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page63

CQ
Forwarded Packets
Custom Queuing System

Class Class 1? 1?

Tail Drop

Queue 1

Class Class 2? 2?

Tail Drop

Queue 2 RoundRoundRobin Robin Scheduler Scheduler

Hardware Queuing System Hardware Q Interface

Class Class 16? 16?

Tail Drop

Queue 16

CQ uses 16 FIFO queues for subscriber queues.

HUAWEI TECHNOLOGIES CO., LTD.

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

Hardware Queuing System Hardware Q


Inter-face Inter-face

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 1 is the lowest custom queue that is serviced by the roundrobin scheduler.

HUAWEI TECHNOLOGIES CO., LTD.

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

Hardware Queuing System Hardware Hardware Q Q


Inter-face Inter-face

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page70

CQ Advantages & Disadvantages


+

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page71

WFQ
Forwarded Packets
Weighted Fair Queuing System

Flow Flow1? 1?

WFQ drop

Queue 1

Flow Flow2? 2?

WFQ drop

Queue 2 WFQ Scheduler

Hardware Queuing System Hardware Hardware Q Q Interface

Flow FlowN? N?

WFQ drop

Queue N

Weighted Fair Queuing (WFQ) uses the traffic FIFO queue.


HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential

page72

WFQ Tool

Parameter Classification mechanism Weighted fairness Each queue uses the improved tail-drop.

HUAWEI TECHNOLOGIES CO., LTD.

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.

Src. Dest. Addr. Addr.

Protocol

ToS

Src. Port

Dest. Port

Hash Algorithm

#queue (index of the queue)

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

WFQ Insertion & Discarding Mechanism


Nth Packet N>HQO? N>HQO? Yes Worst Worst Finish Finish Time? Time? No Drop the packet with the worst finish time (old) and enqueue the Nth packet (new). New Old No N>CDT? N>CDT? Yes Worst Worst Finish Finish Time? Time? Yes No Enqueue Packet

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

HUAWEI TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page76

Case Study: Interface Congestion

HQO reaches its upper threshold 10. Newly arrived packets are discarded as the TDM system places them at the end.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page77

Case Study: Interface Congestion

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page78

Case Study: Traffic Congestion

CDT exceeds its upper limit 8. Newly arrived packets are discarded for the TDM system places them at the end.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page79

Case Study: Traffic Congestion

CDT exceeds its upper limit 8. Newly arrived packets enter the queue as they are not placed at the end.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page80

WFQ Discarding Mechanism

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

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.

Virtual Packet Size = Real Packet Size / (IP Precedence + 1)

WFQ System (Virtual-Size Packets)


Flow with P=001 Flow with P=000

4 3

3 2

2 1

1
Precedence-1 flow gets twice as much bandwidth as Precedence-0 flow.

Hardware FIFO Queue


3 3 2 2 1 1

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page83

Mapping Between IP Priority and Weight


IP Precedence 0 1 2 3 4 5 6 7 32 (virtual IP Precedence) 1024 (virtual IP Precedence) Weight 4096 2048 1365 1024 819 682 585 512 128 (PAK-Priority) 4 (RSVP)

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page84

WFQ Advantages & Disadvantages


+

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page85

Comparison Between Several Queues


Weighted Fair Queuing No queue lists Low-volume traffic given priority Conversation dispatching Interactive traffic gets priority Works well on speeds up to 2 Mbps Enabled by default Priority Queuing 4 queues High-priority queue serviced first Packet-by-packet dispatching Critical traffic gets through Designed for low-bandwidth links Must configure Custom Queuing 16 queues Round-robin service Threshold dispatching Proportional allocation of bandwidth Designed for medium-speed links Must configure

HUAWEI TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page87

TCP Synchronization

Average link use

Flow A Flow B Flow C

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page88

TCP Starvation, Delay, and Jitter


Packet of the staving traffic
Prec. 3 Prec. 3 Prec. 3 Prec. 0 Prec. 3 Prec. 0

Packet of the invasive traffic

Prec. 0

Prec. 0

Queue

TCP has no feedback mechanism when multiple packets are discarded.

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

Random Early Detection


Random early detection (RED) discards packets at random before the queue is full. Packets discarded by RED increase gradually with the queue expansion. Influence given by RED : The speed of the TCP session slows down and approaches to the link bandwidth. Compared with the maximum queue length, the average queue length is shortened. The IP priority can be used to preferentially discard the packet that has low priority and is invasive to bandwidth.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page90

RED Profile
Drop Probability 100% No drop Random drop Full drop

Maximum Drop Probability

10% 20 40

Average Queue Size

Minimum Threshold

Maximum Threshold

HUAWEI TECHNOLOGIES CO., LTD.

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.

RED can prevent congestion and tail-drop.

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page92

Before RED

Average link use

Flow A Flow B Flow C

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page93

After RED

Average link use

Flow A Flow B Flow C

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 TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page95

Different RED Parameters


Drop Probability 100%

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.

Average Queue Size

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page96

Mapping Between the IP Priority and RED Parameters


Drop Probability

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

Average Queue Size

HUAWEI Confidential

page97

DSCP-based WRED (Expedited Forwarding)


Drop Probability

100%

10%

EF Average Queue Size

20
HUAWEI TECHNOLOGIES CO., LTD. HUAWEI Confidential

36 40

page98

DSCP-based WRED (Assured Forwarding)


Drop Probability

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

Select the WRED profile

Random Drop

Tail Drop

Minimum Threshold Maximum Threshold

HUAWEI TECHNOLOGIES CO., LTD.

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 TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page

WRED Examples

Packet Discard Probability

Priority 3 Priority 1 Priority 2 Priority 0


25 10 15 20 30

VoIP Routing

0.1

Average Queue Size


35 37

RSVP

HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI Confidential

page

Thank you
www.huawei.com