Skip to content
Back to Blog
MikroTik

MikroTik Bandwidth Management: Queues & Traffic Shaping

Master Simple Queues, Queue Trees, and PCQ in MikroTik RouterOS to control per-user and per-IP bandwidth allocation.

Aug 2025
12 min read

Introduction

Bandwidth management on MikroTik RouterOS is one of the most powerful features available to network engineers. Whether you're managing a small office or an ISP with thousands of clients, MikroTik's queue system gives you granular control over traffic shaping, prioritization, and rate limiting.

Understanding MikroTik Queue Types

MikroTik has two main queue mechanisms:

  1. Simple Queues — Easy to configure, great for per-client rate limiting
  2. Queue Tree — Advanced, policy-based shaping using mangle marks

Simple Queue: Per-Client Rate Limiting

The simplest use case: limit a specific IP to 10 Mbps download and 2 Mbps upload.

BASH
/queue simple add name="Client-192.168.1.100" target=192.168.1.100/32 max-limit=10M/2M

For a DHCP-based network with many clients:

BASH
/queue simple add name="Office-Clients" target=192.168.1.0/24 max-limit=100M/20M

Queue Tree with Mangle: Advanced Traffic Shaping

Queue Tree requires marking packets with mangle first, then shaping based on marks.

Step 1: Mark connections with mangle

BASH
/ip firewall mangle
add chain=forward src-address=192.168.1.0/24 out-interface=ether1 action=mark-connection new-connection-mark=LAN-out passthrough=yes
add chain=forward connection-mark=LAN-out action=mark-packet new-packet-mark=LAN-out-pkt passthrough=no

Step 2: Create parent queue on WAN interface

BASH
/queue tree
add name="WAN-Out" parent=ether1 max-limit=100M packet-mark=""

Step 3: Add child queues with priority

BASH
/queue tree
add name="VoIP" parent=WAN-Out packet-mark=LAN-out-pkt priority=1 max-limit=10M limit-at=2M
add name="HTTP" parent=WAN-Out packet-mark=LAN-out-pkt priority=4 max-limit=80M limit-at=20M
add name="P2P" parent=WAN-Out packet-mark=LAN-out-pkt priority=8 max-limit=20M limit-at=1M

PCQ: Per-Connection Queuing for ISPs

PCQ (Per Connection Queue) is perfect for ISPs who need fair bandwidth distribution among many clients without creating individual queues.

BASH
/queue type
add name="PCQ-Download" kind=pcq pcq-classifier=dst-address pcq-rate=2M pcq-limit=50 pcq-total-limit=2000
add name="PCQ-Upload" kind=pcq pcq-classifier=src-address pcq-rate=512k pcq-limit=50 pcq-total-limit=2000

Apply the PCQ queues:

BASH
/queue tree
add name="Download-PCQ" parent=bridge1 queue=PCQ-Download
add name="Upload-PCQ" parent=ether1 queue=PCQ-Upload

Burst Configuration

Burst allows clients to temporarily exceed their limit — great for web browsing feel:

BASH
/queue simple
add name="Client-Burst" target=192.168.1.50/32   max-limit=10M/2M   burst-limit=20M/4M   burst-threshold=8M/1.5M   burst-time=10s/10s

This means: normally 10M, burst to 20M for 10 seconds when average is below 8M.

Monitoring Queue Statistics

BASH
# View queue stats live
/queue simple print stats

# Monitor specific queue
/queue simple monitor [find name="Client-192.168.1.100"]

Practical ISP Setup Example

For an ISP with 100 clients each getting 10M/2M:

BASH
# Create PCQ types
/queue type
add name=pcq-dl kind=pcq pcq-rate=10M pcq-classifier=dst-address
add name=pcq-ul kind=pcq pcq-rate=2M pcq-classifier=src-address

# Mark traffic
/ip firewall mangle
add chain=forward in-interface=ether1-WAN action=mark-packet new-packet-mark=from-wan passthrough=no
add chain=forward out-interface=ether1-WAN action=mark-packet new-packet-mark=to-wan passthrough=no

# Apply queues
/queue tree
add name=Download parent=bridge-LAN packet-mark=from-wan queue=pcq-dl
add name=Upload parent=ether1-WAN packet-mark=to-wan queue=pcq-ul

Troubleshooting

BASH
# Check if packets are being queued
/queue simple print stats detail

# See dropped packets (high drops = queue full = client is over limit)
/interface print stats where name=ether1

# Torch tool for live traffic monitoring
/tool torch interface=ether1 src-address=192.168.1.100

Best Practices

  1. Always set limit-at (guaranteed rate) as well as max-limit in Queue Tree
  2. Use PCQ for large deployments — don't create 1000 simple queues
  3. Place queues on the correct interface direction (in/out)
  4. Use burst sparingly — it can mask underlying bandwidth issues
  5. Monitor queue drops to detect congestion before users complain