8.4 QoS Configuration Explained
Key Concepts of QoS Configuration
Quality of Service (QoS) configuration involves setting up policies to manage network traffic based on priority, bandwidth, and latency requirements. Key concepts include:
- Classification: Identifying and categorizing traffic based on criteria such as source/destination IP, port numbers, and protocols.
- Marking: Applying tags or marks to packets to indicate their priority level.
- Policing and Shaping: Controlling the rate of traffic to ensure it does not exceed specified limits.
- Queuing: Managing the order and priority of packets in the queue to ensure high-priority traffic is processed first.
- Scheduling: Determining how packets are transmitted based on their priority and the available bandwidth.
Classification
Classification is the process of identifying and categorizing network traffic based on specific criteria. This allows for differentiated treatment of different types of traffic, such as VoIP, video streaming, and web browsing.
Example: In a MikroTik router, you can classify traffic by creating a firewall filter that matches packets based on their source IP address, destination IP address, and port number. For instance, all traffic to and from the VoIP server can be classified as high-priority.
Marking
Marking involves applying tags or marks to packets to indicate their priority level. These marks are used by the router to determine how to handle the packets in terms of queuing and scheduling.
Example: After classifying VoIP traffic as high-priority, you can mark these packets with a DSCP (Differentiated Services Code Point) value of 46, which corresponds to the EF (Expedited Forwarding) class. This ensures that the router treats these packets with higher priority.
Policing and Shaping
Policing and shaping are methods used to control the rate of traffic. Policing drops or re-marks packets that exceed a specified rate, while shaping queues packets to be transmitted at a later time to maintain the desired rate.
Example: You can configure a policer on the MikroTik router to drop any VoIP traffic that exceeds 1 Mbps. Alternatively, you can use traffic shaping to queue excess traffic and transmit it at a later time, ensuring that the overall rate does not exceed 1 Mbps.
Queuing
Queuing involves managing the order and priority of packets in the queue. Different queuing algorithms, such as FIFO (First In, First Out), PQ (Priority Queuing), and CBQ (Class-Based Queuing), can be used to ensure that high-priority traffic is processed first.
Example: In a MikroTik router, you can configure a priority queue that ensures VoIP traffic is always processed before web browsing traffic. This is achieved by assigning different priorities to different queues based on the traffic type.
Scheduling
Scheduling determines how packets are transmitted based on their priority and the available bandwidth. Various scheduling algorithms, such as WRR (Weighted Round Robin) and WFQ (Weighted Fair Queuing), can be used to distribute bandwidth fairly among different types of traffic.
Example: You can configure a WRR scheduler on the MikroTik router to allocate 70% of the bandwidth to VoIP traffic and 30% to web browsing traffic. This ensures that critical applications like VoIP receive the necessary bandwidth while still allowing other traffic to flow.