Gaming relies on low latency, stable connections and optimised network settings. A MikroTik router, with its robust features, can be tailored to create a lag-free gaming experience. Below is a step-by-step guide to achieving this setup.
Prioritise Gaming Traffic (QoS Configuration)
Gaming devices and applications should have a high priority on your network. Use MikroTik’s Queue or Mangle feature for traffic prioritisation.
For a full list of all games and applications can be found here:
https://portforward.com/ports/a
Xbox | 3074 |
Steam | 27000-27100 |
Playstation 5 | 1935, 3074, 3478-3480 |
This step allows the prioritisation of particular ports/protocols via our Queues.
The first step is to create Mangle Rules to match and mark the traffic for the destination ports/protocols and then using those marks to match in our Queue which will have a higher priority (which in the queue is prioritised by the lowest number)
Steps:
- Go to IP > Firewall > Mangle.
- Add a new rule to mark gaming traffic:
- Chain: Forward
- Protocol: Select UDP or TCP (most games use UDP).
- Dst. Port: Add ports specific to the game (e.g. 3074 for Xbox, 27015 for Steam). Add multiple rules for each different game/application
- Action: Mark Packet
- New Packet Mark: Gaming
- Go to Queues > Queue Tree and create a queue for gaming traffic:
- Parent: Global
- Queue Type: Priority
- Packet Mark: Gaming
- Assign higher (lower number) priority (e.g., priority 1 for gaming).
Enable FastTrack for Low Latency
This option cannot be used with the previous option. While it is possible to still limit bandwidth with a Queue Tree and FastTrack, all FastTrack traffic will bypass the following:
- Firewall
- Connection tracking
- Simple Queues
- Queue tree with parent=global
- Mange Rules
This means we won’t be able to use the Mangle Rules to match traffic.
This means if using this along with a Queue Tree (as mentioned above), we need to change the parent to be an interface where the traffic is destined:
- Download = LAN interface (e.g. LAN bridge)
- Upload = WAN interface (e.g. interface or interface list)
Then we also need to remove our Packet Marks and it will match all traffic. This option still allows the selection of which Queue Type (PCQ, CAKE, etc) we wish.
IPv4 FastTrack handler is automatically used for marked connections and is designed to process packets quickly, reducing latency.
Note that not all packets in a connection can be FastTracked, so it is likely to see some packets going through slow path even though the connection is marked for FastTrack, so we need an identical action=accept rule to prevent this.
Steps:
- Go to IP > Firewall > Filter Rules.
- Add a new rule:
- Chain: forward
- Action: fasttrack connection
- Add the second non-FastTrack rule
- Chain: forward
- Action: accept
- Place these rules at the top of the list.
Minimise Bufferbloat
Bufferbloat can cause high latency during congestion. This can be helped via our Queue Types Per Connection Queues (PCQ) and Common Applications Kept Enhanced (CAKE)
While they both aim to improve bandwidth allocation and reduce bufferbloat, they differ in design, complexity, and performance, especially in gaming scenarios. Below is a comparison to help you decide which is better suited for your setup.
What Are PCQ and CAKE?
- PCQ (Per Connection Queue):
- A MikroTik-specific queue type that divides available bandwidth equally among all connections or users.
- Works well in shared environments, like home or small office networks.
- Customizable but requires manual configuration.
- CAKE (Common Applications Kept Enhanced):
- A modern, advanced queue management algorithm designed for low latency and fairness.
- Focuses on solving bufferbloat, prioritizing latency-sensitive traffic (e.g., gaming, VoIP).
- Implements Active Queue Management (AQM) and includes features like bandwidth shaping, per-host fairness, and DiffServ classification.
Key Features Comparison
Feature | PCQ | CAKE |
Bufferbloat Mitigation | Moderate. Relies on basic queuing mechanisms. | Excellent. Specifically designed to reduce bufferbloat. |
Fairness | Equal bandwidth per connection or user. | Per-host fairness with enhanced prioritization. |
Ease of Configuration | Requires manual setup and tuning for best results. | Simple to implement with minimal tweaking. |
Latency Reduction | Decent for general use but not latency-optimized. | Excellent for latency-sensitive traffic like gaming. |
Bandwidth Shaping | Good for static allocation. | Dynamic shaping with auto-optimization. |
Gaming Traffic Optimization | Requires specific rules for gaming. | Automatically prioritizes gaming and VoIP traffic. |
CPU Load | Lightweight, efficient for most hardware. | Higher CPU usage, especially on older MikroTik devices. |
How They Help in Gaming Scenarios
PCQ for Gaming:
- PCQ allocates bandwidth per connection or per user. This can prevent one device from hogging bandwidth but does not inherently prioritize gaming traffic.
- You need to:
- Mark gaming packets via Mangle Rules.
- Assign them to a high-priority PCQ queue.
Advantages:
- Customizable for different scenarios.
- Works well for shared bandwidth environments.
Disadvantages:
- Doesn’t dynamically handle bufferbloat.
- Requires effort to identify and prioritize gaming traffic manually.
CAKE for Gaming:
- CAKE automatically handles bufferbloat and prioritizes latency-sensitive traffic like gaming without extensive manual configuration.
- Features built-in DiffServ support, which recognizes and prioritizes gaming, VoIP, and streaming packets.
Advantages:
- Best-in-class latency reduction.
- Automatically adapts to network conditions.
- Minimal configuration required for gaming optimization.
Disadvantages:
- Higher CPU usage, which might strain older MikroTik devices.
- Requires enabling from the Queue Types menu, and not all MikroTik models support it out of the box.
Configuration Comparison
PCQ Configuration
- Go to Queues > Queue Types and create a new PCQ Queue.
- Set PCQ Rate to divide bandwidth per user.
- Use different PCQ Rates for download and upload.
- Assign the PCQ Queue to your gaming device’s IP or marked packets via Queue Tree.
Full guide here: https://mikrotikmasters.com/controlling-bandwidth-with-cake/
CAKE Configuration
- Go to Queues > Queue Types and select or create a CAKE Queue.
- Apply the CAKE Queue to a Simple Queue or Queue Tree.
- Set the download and upload rates slightly below your ISP’s advertised speeds to combat bufferbloat.
Full guide here: https://mikrotikmasters.com/how-to-use-mikrotik-pcq-per-connection-queues/
Which Should You Choose?
Choose PCQ If:
- You want granular control over bandwidth distribution.
- Your router has limited CPU resources.
- You’re comfortable manually configuring QoS and traffic prioritization.
Choose CAKE If:
- You want an easy-to-implement solution for bufferbloat and gaming optimization.
- Your network prioritizes low-latency traffic like gaming and VoIP.
- Your router has enough processing power to handle CAKE’s advanced algorithms.
Final Recommendation
- For General Home Networks with Gaming Needs: Use CAKE for its simplicity, automatic traffic prioritization, and superior bufferbloat mitigation.
- For Multi-User Networks (e.g., households with multiple users/devices): Use PCQ, especially if you want to control how bandwidth is distributed among users.!
Use a Static IP for Gaming Devices
This is a simple one but by assigning a static IP to your gaming console or PC it makes port forwarding and QoS setup easier. Preferred is to do it via a static DHCP lease rather than assigning it directly to the console.
Steps:
- Go to IP > DHCP Server > Leases.
- Select your device and click Make Static.
Monitor Network Usage
When applying any changes that are aimed to improve service or resolve an issue, it’s important to monitor the traffic to help identify improvements or unresolved issues.
For short term immediate live analysis, use MikroTik’s tools to monitor network traffic and ensure optimal performance such as Torch on either the LAN or WAN interface and filter for specific traffic. However for historical data to be able to build trends or comparisons, try exporting the data to be graphed via SNMP, which you can find out more on from this guide:
https://mikrotikmasters.com/mikrotik-snmp-traffic-monitoring-queue-usage-on-prtg/