Queue Tree lebih berat dari Simple Queue karena butuh Mangle + Queue Tree + PCQ. RB941 dengan CPU AR9344 650MHz
dan RAM 32MB cocok untuk QoS skala kecil dengan 10-20 rule mangle + 10-20 queue tree.
CPU
AR9344 - 650MHz
RAM
32 MB DDR2
STORAGE
16 MB FLASH
ETHERNET
4x 10/100 Mbps
WIRELESS
2.4GHz b/g/n
MANGLE RULE
~20-30 MAX
QUEUE TREE
~20-30 MAX
MAX BW QOS
~20-30 Mbps
POWER
5V DC / USB
OS DEFAULT
RouterOS v6 L4
DIMENSI
113 x 89 x 28mm
BERAT
160 gram
PERINGATAN: Queue Tree + Mangle + PCQ + L7 = SANGAT BERAT untuk RB941. Jika kombinasi semua aktif, CPU bisa 80-100%. Batasi rule mangle maksimal 20-30, queue tree 10-20. Untuk QoS skala besar, upgrade ke hAP ac^2 (717MHz, 128MB RAM) atau CCR series.
ALUR QUEUE TREE: (1) Packet masuk, (2) Mangle inspect & mark connection, (3) Mangle mark packet berdasarkan connection-mark, (4) Queue Tree ambil packet berdasarkan packet-mark, (5) Queue Tree apply limit & priority sesuai hierarki parent-child.
VISUALISASI MANGLE + QUEUE TREE
LIVE FLOW
Visualisasi alur QoS: packet dari client di-inspect oleh Mangle, di-mark berdasarkan
aplikasi (game/stream/browsing/download), lalu masuk ke Queue Tree hierarki dengan priority berbeda.
Game (P1 - Fast)
Browsing (P3 - Med)
Streaming (P5 - Slow)
Download (P8 - Lowest)
Upload Packet
Download Packet
KEUNGGULAN QUEUE TREE: Hierarki parent-child memungkinkan pembagian bandwidth yang fleksibel. Parent = total bandwidth, child = sub-bagian. PCQ membagi rata per connection. Priority menentukan siapa dapat jatah saat bandwidth penuh.
RESET & AKSES AWAL
STEP 01
Pastikan router dalam kondisi bersih sebelum konfigurasi. Hubungkan PC ke ether2 dengan kabel UTP.
RESET KE FACTORY DEFAULT
RESET
# CARA 1: Tombol fisik# 1. Cabut power router# 2. Tekan tombol RESET dengan pin# 3. Colok power sambil tetap tekan RESET# 4. Tunggu LED berkedip (~5 detik), lepas# 5. Router reboot dengan config default# CARA 2: Via terminal[admin@MikroTik] > /system reset-configurationDo you really want to reset configuration? [y/N]y# CARA 3: Reset tanpa default config (kosong total)[admin@MikroTik] > /system reset-configuration no-defaults=yes skip-backup=yes! WARNING: semua konfigurasi akan terhapus
AKSES ROUTER
METODE
ALAT
ALAMAT
WinBox
Aplikasi Windows
MAC Address / 192.168.88.1
WebFig
Browser
http://192.168.88.1
SSH
Terminal / PuTTY
ssh admin@192.168.88.1
MAC Telnet
WinBox
MAC Address
NEIGHBORS
# di WinBox, klik tab "Neighbors"MAC ADDRESS IDENTITY IP VERSIOND4:01:C3:XX:XX:XX MikroTik 192.168.88.1 6.48.6# klik dua kali -> Connect via MAC (paling aman)# login: admin | password: (kosong)
IDENTITY & USER MANAGEMENT
STEP 02
Beri nama router dan ganti password admin. WAJIB sebelum router terhubung internet.
SET IDENTITY
IDENTITY
[admin@MikroTik] > /system identity set name="QT-GATEWAY"[admin@QT-GATEWAY] > # prompt berubah otomatis
GANTI PASSWORD
USER
[admin@QT-GATEWAY] > /user set admin password="Admin@QT-2024!"# buat user operator (read-only)[admin@QT-GATEWAY] > /user add name="monitor" password="monitor@2024" group="read"[admin@QT-GATEWAY] > /user print
INTERFACE & BRIDGE
STEP 03
Setup interface: ether1 untuk WAN, ether2-4 dan wlan1 digabung dalam bridge untuk LAN.
CEK INTERFACE
INTERFACE
[admin@QT-GATEWAY] > /interface print # NAME TYPE ACTUAL-MTU 0 R1 ether1 ether 1500 1 R2 ether2 ether 1500 2 R3 ether3 ether 1500 3 R4 ether4 ether 1500 4 R wlan1 wlan 1500 5 R bridge1 bridge 1500
[admin@QT-GATEWAY] > /interface wireless set wlan1 mode=ap-bridge ssid="QT-NET" country=indonesia frequency-mode=regulatory-domain[admin@QT-GATEWAY] > /interface wireless set wlan1 channel=6 band=2ghz-b/g/n[admin@QT-GATEWAY] > /interface wireless security-profiles set [find default=yes] mode=dynamic-keys authentication-types=wpa2-psk wpa2-pre-shared-key="wifi@qt2024!"[admin@QT-GATEWAY] > /interface wireless set wlan1 tx-power-mode=all-rates-fixed tx-power=17
KONSEP QUEUE TREE
CORE
Queue Tree adalah sistem QoS advanced di RouterOS yang bekerja berdasarkan
packet-mark dari Mangle. Berbeda dengan Simple Queue yang bekerja berdasarkan target IP,
Queue Tree bisa mengelompokkan traffic berdasarkan aplikasi, protokol, port, konten, dll.
ARSITEKTUR QUEUE TREE
STEP 1
PACKET MASUK
Dari client / internet
STEP 2
MANGLE
Inspect & mark connection
STEP 3
MARK PACKET
Berdasarkan connection-mark
STEP 4
QUEUE TREE
Apply limit & priority
STEP 5
KELUAR
Ke tujuan
STRUKTUR HIERARKI
global-in[total bandwidth masuk dari ISP]
|
+-- upload-total[limit upload global]
| |
| +-- game-upload[packet-mark=pkt-game-up]
| +-- browse-upload[packet-mark=pkt-browse-up]
| +-- stream-upload[packet-mark=pkt-stream-up]
| `-- download-upload[packet-mark=pkt-download-up]
|
`-- download-total[limit download global]
|
+-- game-download[packet-mark=pkt-game-down]
+-- browse-download[packet-mark=pkt-browse-down]
+-- stream-download[packet-mark=pkt-stream-down]
+-- download-download[packet-mark=pkt-download-down]
| |
| +-- per-ip-1[PCQ per src-address]
| +-- per-ip-2[PCQ per src-address]
| `-- per-ip-N[PCQ per src-address]
`-- other-download[packet-mark tidak ter-mark]
KEUNGGULAN QUEUE TREE
HIERARKI FLEKSIBEL
Parent-child structure. Parent = total bandwidth, child = sub-bagian. Bisa nested sampai dalam.
MARKING FLEKSIBEL
Bisa mark berdasarkan: port, protocol, address, Layer7, content, connection state, dll.
PCQ PER CONNECTION
PCQ membagi bandwidth per connection, bukan per IP. Fair sharing otomatis untuk banyak user.
PRIORITY DETAIL
Priority per queue tree node. Bisa set priority berbeda untuk upload dan download.
KEKURANGAN: Queue Tree kompleks dan butuh pemahaman Mangle. Salah konfigurasi = traffic tidak ter-limit. Konsumsi CPU lebih tinggi dari Simple Queue. Tidak cocok untuk pemula tanpa pemahaman dasar.
QUEUE TREE vs SIMPLE QUEUE
CORE
Perbandingan detail antara Queue Tree dan Simple Queue untuk menentukan mana yang cocok untuk kebutuhan Anda.
TABEL PERBANDINGAN
ASPEK
SIMPLE QUEUE
QUEUE TREE
Kompleksitas
Mudah
Kompleks
Kebutuhan Mangle
TIDAK
WAJIB
Target
IP / Subnet / Interface
Packet-mark (dari Mangle)
Struktur
Flat (tidak ada parent)
Hierarki (parent-child)
Marking
Berdasarkan IP
Berdasarkan aplikasi/protokol/konten
PCQ
Bisa
Bisa + lebih fleksibel
Priority
Bisa
Bisa per node
Burst
Bisa
Bisa
Performa CPU
Lebih ringan
Lebih berat
Cocok untuk
Rumah, kantor kecil
ISP, kantor besar, hotspot advanced
Limit per aplikasi
Tidak bisa
Bisa (via L7/port)
Dynamic per-IP
Manual
Bisa dengan PCQ
KAPAN PAKAI QUEUE TREE?
PAKAI QUEUE TREE JIKA
Butuh limit per aplikasi (game, streaming, download). Butuh PCQ per connection. Butuh hierarki bandwidth.
PAKAI SIMPLE QUEUE JIKA
Cukup limit per IP/subnet. Tidak butuh marking aplikasi. Hardware terbatas (RB941 dengan banyak client).
KOMBINASI KEDUA
Simple Queue untuk total bandwidth, Queue Tree untuk detail per aplikasi. Best of both worlds.
RB941 CONSIDERATION
RB941 bisa handle Queue Tree untuk 10-20 client dengan 10-20 rule mangle. Lebih dari itu, pertimbangkan upgrade hardware.
MANGLE - DASAR MARKING
CORE
Mangle adalah fitur RouterOS untuk marking packet
berdasarkan berbagai kriteria. Mangle adalah fondasi Queue Tree - tanpa Mangle, Queue Tree tidak tahu traffic mana yang harus di-limit.
ALUR MARKING
PACKET
UNMARKED
Belum ada mark
MANGLE
MARK CONNECTION
Mark connection (group)
MANGLE
MARK PACKET
Mark packet (individual)
QUEUE
QUEUE TREE
Apply limit & priority
JENIS MARKING
MARK TYPE
FUNGSI
KEGUNAAN
connection-mark
Mark group koneksi (1 connection = banyak packet)
Step 1 - mark koneksi
packet-mark
Mark individual packet
Step 2 - mark packet berdasarkan connection-mark
routing-mark
Mark untuk routing policy
PBR (Policy Based Routing)
CHAIN MANGLE
CHAIN
ARAH
KEGUNAAN
prerouting
Sebelum routing decision
Paling umum untuk QoS (mark semua traffic)
output
Traffic dari router
Mark traffic yang dihasilkan router
postrouting
Setelah routing
Mark setelah routing decision
input
Traffic ke router
Mark traffic yang dituju router
KRITERIA MARKING
BERDASARKAN PORT
dst-port=80 (HTTP), dst-port=443 (HTTPS), dst-port=53 (DNS). Simple tapi tidak akurat untuk aplikasi modern.
BERDASARKAN PROTOCOL
protocol=tcp, udp, icmp. Untuk traffic berdasarkan transport protocol.
BERDASARKAN LAYER 7
layer7-protocol=pattern. Deteksi aplikasi berdasarkan konten packet. Berat CPU tapi akurat.
BERDASARKAN CONNECTION
connection-mark=xxx. Mark packet berdasarkan connection-mark yang sudah di-set sebelumnya.
PASSTHROUGH: YES vs NO
PASSTHROUGH
# passthrough=yes -> packet lanjut ke rule mangle berikutnya# passthrough=no -> packet STOP di rule ini# CONTOH:# Rule 1: mark connection game (passthrough=yes)# -> packet di-mark, lanjut ke rule 2# Rule 2: mark packet game (passthrough=no)# -> packet di-mark, STOP# URUTAN PENTING:# 1. Mark connection DULU (passthrough=yes)# 2. Mark packet BERDASARKAN connection-mark (passthrough=no)
TIPS: Mangle rule diproses dari atas ke bawah. Rule pertama yang match akan dieksekusi. Taruh rule yang paling spesifik di atas, yang paling general di bawah.
MARK CONNECTION
CORE
Mark Connection adalah step pertama dalam marking. Connection = group packet dari source ke destination
yang sama. 1 connection bisa terdiri dari banyak packet. Mark connection lebih efisien daripada mark packet langsung.
Mark connection harus passthrough=yes agar packet lanjut ke rule mark-packet berikutnya.
URUTAN SPESIFIK DULU
Taruh rule paling spesifik di atas. Contoh: mark game (port spesifik) sebelum mark browsing (port umum).
NAMA YANG JELAS
Pakai nama connection-mark yang jelas: conn-game, conn-browse, conn-stream. Mudah di-debug.
PAKAI COMMENT
Selalu beri comment untuk setiap rule. Memudahkan troubleshooting dan dokumentasi.
JANGAN: mark connection dan mark packet dalam 1 rule. Harus 2 rule terpisah. Mark connection dulu, baru mark packet berdasarkan connection-mark.
MARK PACKET
CORE
Mark Packet adalah step kedua. Mark packet berdasarkan connection-mark
yang sudah di-set sebelumnya. Packet-mark inilah yang akan dipakai oleh Queue Tree.
URUTAN KRITIS: Mark connection HARUS di atas mark packet. Jika mark packet di atas, connection-mark belum ada, packet tidak akan ter-mark.
MANGLE + LAYER 7 PROTOCOL
ADVANCED
Untuk deteksi aplikasi yang lebih akurat (YouTube, TikTok, Instagram, dll), gunakan Layer 7 Protocol
di Mangle. Layer 7 inspect isi packet (payload) untuk identifikasi aplikasi, bukan hanya port.
BUAT LAYER 7 PROTOCOL
LAYER 7
# buat L7 pattern untuk YouTube[admin@QT-GATEWAY] > /ip firewall layer7-protocol add name="youtube" regexp="(^|\.)(youtube|youtu\.be|googlevideo)\.com"# buat L7 pattern untuk TikTok[admin@QT-GATEWAY] > /ip firewall layer7-protocol add name="tiktok" regexp="(^|\.)(tiktok|tiktokcdn|bytecdn)\.com"# buat L7 pattern untuk Facebook[admin@QT-GATEWAY] > /ip firewall layer7-protocol add name="facebook" regexp="(^|\.)(facebook|fbcdn|fbsbx)\.com"# buat L7 pattern untuk Instagram[admin@QT-GATEWAY] > /ip firewall layer7-protocol add name="instagram" regexp="(^|\.)(instagram|cdninstagram)\.com"# buat L7 pattern untuk streaming umum[admin@QT-GATEWAY] > /ip firewall layer7-protocol add name="streaming" regexp="(^|\.)(youtube|netflix|spotify|twitch|tiktok)\.com"
PERINGATAN KERAS: 1. Layer 7 TIDAK BISA baca isi HTTPS (terenkripsi). Hanya match di SNI header.
2. Layer 7 SANGAT BERAT CPU. RB941 bisa 80-100% CPU dengan 5+ L7 pattern aktif.
3. Untuk HTTPS modern, lebih baik pakai DNS filtering atau IP address-list.
4. Batasi maksimal 3-5 L7 pattern di RB941.
ALTERNATIF L7 YANG LEBIH RINGAN
DNS FILTERING
Block domain di DNS level. Ringan, efektif untuk HTTPS. Pakai /ip dns static.
ADDRESS LIST
Block IP server aplikasi. Ringan, efektif. Update rutin karena IP bisa berubah.
PORT BASED
Mark berdasarkan port. Ringan, tapi tidak akurat untuk aplikasi modern yang pakai port dinamis.
UPGRADE HARDWARE
Jika butuh L7 + banyak pattern, upgrade ke hAP ac^2 atau CCR series.
QUEUE TREE BASIC
CORE
Setup Queue Tree dasar berdasarkan packet-mark dari Mangle. Queue Tree akan apply limit dan priority sesuai hierarki.
QUEUE TREE UPLOAD
UPLOAD QUEUE
# 1. Parent upload total (limit upload global)[admin@QT-GATEWAY] > /queue tree add name="upload-total" parent=global max-limit="10M" priority="5" comment="Total Upload"# 2. Child upload per aplikasi[admin@QT-GATEWAY] > /queue tree add name="game-upload" parent="upload-total" packet-mark="pkt-game-up" limit-at="2M" max-limit="5M" priority="1"[admin@QT-GATEWAY] > /queue tree add name="browse-upload" parent="upload-total" packet-mark="pkt-browse-up" limit-at="2M" max-limit="5M" priority="3"[admin@QT-GATEWAY] > /queue tree add name="stream-upload" parent="upload-total" packet-mark="pkt-stream-up" limit-at="1M" max-limit="3M" priority="5"[admin@QT-GATEWAY] > /queue tree add name="download-upload" parent="upload-total" packet-mark="pkt-download-up" limit-at="1M" max-limit="2M" priority="8"
CATATAN: Total max-limit child TIDAK HARUS sama dengan parent. RouterOS akan bagi bandwidth parent ke child sesuai limit-at (guaranteed). Jika bandwidth parent cukup, child dapat sesuai max-limit.
HIERARCHY PARENT-CHILD
CORE
Hierarki parent-child adalah kekuatan utama Queue Tree. Parent = total bandwidth, child = sub-bagian.
Child bisa punya child lagi (nested hierarchy).
BAGAIMANA HIERARCHY BEKERJA?
HOW IT WORKS
# SKENARIO:# Parent: download-total = 45M# Child 1: game-download = max 10M, limit-at 5M# Child 2: browse-download = max 20M, limit-at 10M# Child 3: stream-download = max 20M, limit-at 10M# Child 4: download-download = max 10M, limit-at 5M# KASUS 1: Bandwidth parent PENUH (45M terpakai)# - Tiap child dapat sesuai limit-at (guaranteed):# game: 5M, browse: 10M, stream: 10M, download: 5M# Total: 30M (sisanya 15M idle atau dibagi sesuai priority)# KASUS 2: Bandwidth parent TIDAK penuh (misal 30M terpakai)# - Tiap child dapat sesuai max-limit:# game: 10M, browse: 20M, stream: 20M, download: 10M# Total: 60M (tapi parent hanya 45M, jadi dibagi)# - Priority menentukan siapa dapat duluan# KASUS 3: Hanya game aktif# - Game dapat sampai max-limit 10M# - Child lain idle, bandwidth tidak terpakai
LIMIT-AT vs MAX-LIMIT
PARAMETER
FUNGSI
KAPAN DIPAKAI
limit-at
Bandwidth DIJAMIN (guaranteed)
Saat bandwidth parent penuh
max-limit
Bandwidth MAKSIMAL (ceiling)
Saat bandwidth parent cukup
NESTED HIERARCHY
NESTED
# contoh nested hierarchy: download -> social media -> per app# parent: download-total[admin@QT-GATEWAY] > /queue tree add name="download-total" parent=global max-limit="45M"# child: social-media[admin@QT-GATEWAY] > /queue tree add name="social-media" parent="download-total" max-limit="20M"# grandchild: per aplikasi[admin@QT-GATEWAY] > /queue tree add name="youtube" parent="social-media" packet-mark="pkt-youtube-down" max-limit="10M" priority="5"[admin@QT-GATEWAY] > /queue tree add name="tiktok" parent="social-media" packet-mark="pkt-tiktok-down" max-limit="5M" priority="6"[admin@QT-GATEWAY] > /queue tree add name="facebook" parent="social-media" packet-mark="pkt-facebook-down" max-limit="3M" priority="7"[admin@QT-GATEWAY] > /queue tree add name="instagram" parent="social-media" packet-mark="pkt-instagram-down" max-limit="2M" priority="7"# total social-media = 20M# youtube: 10M, tiktok: 5M, facebook: 3M, instagram: 2M
TIPS: Nested hierarchy bagus untuk grouping. Contoh: social-media -> youtube/tiktok/facebook. Tapi jangan terlalu dalam (max 3-4 level) agar tidak rumit dan tidak berat CPU.
PCQ (PER CONNECTION QUEUE)
CORE
PCQ adalah algoritma queue yang membagi bandwidth secara fair per connection.
Jika ada 1 user download, dia dapat semua bandwidth. Saat user lain mulai, bandwidth otomatis dibagi rata.
SETUP PCQ DI QUEUE TREE
PCQ SETUP
# 1. buat queue type PCQ[admin@QT-GATEWAY] > /queue type add name="pcq-download" kind=pcq pcq-classifier=dst-address pcq-rate="5M" pcq-limit-at="2M" pcq-total-limit="45M"[admin@QT-GATEWAY] > /queue type add name="pcq-upload" kind=pcq pcq-classifier=src-address pcq-rate="2M" pcq-limit-at="1M" pcq-total-limit="10M"# 2. gunakan PCQ di queue tree[admin@QT-GATEWAY] > /queue tree set [find name="download-download"] queue="pcq-download"[admin@QT-GATEWAY] > /queue tree set [find name="download-upload"] queue="pcq-upload"# cek queue type[admin@QT-GATEWAY] > /queue type print # NAME KIND CLASSIFIER RATE LIMIT-AT 0 default sfq 1 ethernet-default sfq 2 wireless-default sfq 3 pcq-download pcq dst-address 5M 2M 4 pcq-upload pcq src-address 2M 1M
PCQ CLASSIFIER
CLASSIFIER
ARTI
KEGUNAAN
src-address
Per IP sumber
Fair sharing per upload client
dst-address
Per IP tujuan
Fair sharing per download client
src-address:port
Per IP + port sumber
Lebih granular
dst-address:port
Per IP + port tujuan
Lebih granular
src-address,dst-address
Per pair IP
Fair sharing per connection pair
BAGAIMANA PCQ BEKERJA?
HOW PCQ WORKS
# SKENARIO: download-download dengan PCQ (pcq-rate=5M, total=45M)# 1 user download (1 connection)# -> dapat 5M (sesuai pcq-rate)# 2 user download (2 connection)# -> masing-masing dapat 5M# -> total: 10M# 5 user download (5 connection)# -> masing-masing dapat 5M# -> total: 25M# 9 user download (9 connection)# -> masing-masing dapat 5M# -> total: 45M (max total)# 10 user download (10 connection)# -> total max 45M, dibagi rata# -> masing-masing dapat 4.5M# KEUNTUNGAN PCQ:# - Fair sharing otomatis# - Tidak perlu buat queue per user# - Bandwidth terpakai maksimal# - User baru otomatis dapat jatah
KAPAN PAKAI PCQ?
BANYAK USER
Hotspot, kantor dengan banyak user. PCQ otomatis bagi rata tanpa perlu set limit per user.
FAIR SHARING
Ingin semua user dapat jatah adil. Tidak ada yang bisa boros bandwidth.
MAKSIMALKAN BANDWIDTH
Bandwidth ISP selalu terpakai maksimal. Tidak ada bandwidth idle.
JANGAN PAKAI UNTUK
User dengan kebutuhan berbeda (boss vs staff). PCQ bagi rata, tidak ada prioritas.
TIPS: Kombinasi PCQ + Priority = QoS optimal. PCQ untuk fair sharing dalam kategori, Priority untuk prioritas antar kategori. Contoh: game (P1) + PCQ, browsing (P3) + PCQ, download (P8) + PCQ.
PRIORITY QUEUE
CORE
Priority menentukan siapa dapat jatah bandwidth dulu saat bandwidth penuh. Priority 1 = paling prioritas, 8 = paling rendah.
SETUP PRIORITY
PRIORITY
# priority di queue tree[admin@QT-GATEWAY] > /queue tree set [find name="game-download"] priority=1[admin@QT-GATEWAY] > /queue tree set [find name="browse-download"] priority=3[admin@QT-GATEWAY] > /queue tree set [find name="stream-download"] priority=5[admin@QT-GATEWAY] > /queue tree set [find name="download-download"] priority=8# priority bisa berbeda untuk upload dan download# format: priority=upload/download[admin@QT-GATEWAY] > /queue tree set [find name="game-upload"] priority=1/1[admin@QT-GATEWAY] > /queue tree set [find name="browse-upload"] priority=3/3
REKOMENDASI PRIORITY
PRIORITY
LEVEL
APLIKASI
1
TERTINGGI
Game online, VoIP, video call
2-3
TINGGI
Browsing, email, aplikasi bisnis
4-5
SEDANG
Streaming video, music
6-7
RENDAH
Social media, update otomatis
8
TERENDAH
Download, torrent, backup, P2P
BAGAIMANA PRIORITY BEKERJA?
HOW PRIORITY WORKS
# SKENARIO: Bandwidth parent PENUH (45M)# game (P1): limit-at 5M, max 10M# browse (P3): limit-at 10M, max 20M# stream (P5): limit-at 10M, max 20M# download (P8): limit-at 5M, max 10M# Step 1: Bagi limit-at (guaranteed)# game: 5M, browse: 10M, stream: 10M, download: 5M# Total: 30M (sisanya 15M)# Step 2: Sisa bandwidth dibagi berdasarkan priority# Priority 1 (game) dapat duluan# -> game dapat tambahan sampai max 10M# -> sisa: 15 - 5 = 10M# Priority 3 (browse) dapat berikutnya# -> browse dapat tambahan sampai max 20M# -> sisa: 10 - 10 = 0M# Priority 5, 8 tidak dapat tambahan# -> tetap di limit-at# HASIL AKHIR:# game: 10M (max)# browse: 20M (max)# stream: 10M (limit-at)# download: 5M (limit-at)# Total: 45M
TIPS: Priority hanya bekerja saat bandwidth PENUH. Saat bandwidth cukup, semua child dapat sesuai max-limit. Priority menentukan siapa dapat jatah DULUAN saat bandwidth kurang.
BURST CONFIGURATION
ADVANCED
Burst memungkinkan queue dapat bandwidth lebih besar dari max-limit untuk waktu singkat. Berguna untuk loading page, download file kecil.
SETUP BURST
BURST
# burst di queue tree[admin@QT-GATEWAY] > /queue tree set [find name="browse-download"] burst-max-limit="30M" burst-threshold="15M" burst-time="10s" bucket-size="0.1"# PENJELASAN:# burst-max-limit = bandwidth saat burst (30M)# burst-threshold = threshold untuk aktifkan burst (15M)# jika traffic < threshold, burst aktif# burst-time = durasi burst (10 detik)# bucket-size = ukuran bucket (0.1 = 10% dari burst-time)# CARA KERJA:# 1. Client mulai browsing# 2. Traffic < 15M (threshold) -> burst aktif# 3. Client dapat 30M (burst-max-limit)# 4. Setelah 10 detik, burst habis# 5. Client turun ke 20M (max-limit)
KAPAN PAKAI BURST?
LOADING WEB PAGE
Burst membantu loading page cepat. Setelah page loaded, traffic turun ke max-limit.
DOWNLOAD FILE KECIL
File <10MB dapat download cepat dengan burst. File besar tetap di-limit max-limit.
BUFFERING VIDEO
Burst membantu buffering awal video. Setelah buffer penuh, streaming lancar di max-limit.
JANGAN PAKAI UNTUK
Download besar (torrent, backup). Burst akan habis cepat, lalu turun ke max-limit. Tidak efektif.
TIPS: Burst tidak menambah bandwidth total. Jika bandwidth ISP penuh, burst tidak akan aktif. Burst hanya berguna jika ada bandwidth idle yang bisa "dipinjam" sementara.
PER-IP DYNAMIC QUEUE
ADVANCED
Untuk hotspot atau network dengan banyak client dynamic, bisa generate queue tree per IP otomatis menggunakan script + PCQ.
PCQ PER-IP (OTOMATIS)
PCQ PER-IP
# PCQ otomatis membuat queue per IP# tidak perlu script manual# 1. buat queue type PCQ[admin@QT-GATEWAY] > /queue type add name="pcq-per-ip-down" kind=pcq pcq-classifier=dst-address pcq-rate="5M" pcq-limit-at="2M" pcq-total-limit="45M"[admin@QT-GATEWAY] > /queue type add name="pcq-per-ip-up" kind=pcq pcq-classifier=src-address pcq-rate="2M" pcq-limit-at="1M" pcq-total-limit="10M"# 2. buat queue tree dengan PCQ[admin@QT-GATEWAY] > /queue tree add name="all-download" parent=global max-limit="45M" queue="pcq-per-ip-down"[admin@QT-GATEWAY] > /queue tree add name="all-upload" parent=global max-limit="10M" queue="pcq-per-ip-up"# PCQ akan otomatis:# - buat queue per IP saat client connect# - bagi bandwidth rata ke semua IP# - hapus queue saat client disconnect# cek queue aktif[admin@QT-GATEWAY] > /queue tree print # NAME PARENT MAX-LIMIT QUEUE 0 all-download global 45M pcq-per-ip-down 1 all-upload global 10M pcq-per-ip-up# saat ada client, PCQ otomatis buat sub-queue[admin@QT-GATEWAY] > /queue tree print # NAME PARENT MAX-LIMIT QUEUE 0 all-download global 45M pcq-per-ip-down 1 pcq_dst-10.10.10.101 all-download 5M pcq-download-default 2 pcq_dst-10.10.10.102 all-download 5M pcq-download-default 3 pcq_dst-10.10.10.103 all-download 5M pcq-download-default 4 all-upload global 10M pcq-per-ip-up 5 pcq_src-10.10.10.101 all-upload 2M pcq-upload-default 6 pcq_src-10.10.10.102 all-upload 2M pcq-upload-default 7 pcq_src-10.10.10.103 all-upload 2M pcq-upload-default
SCRIPT AUTO GENERATE (OPSIONAL)
SCRIPT
# jika butuh lebih kontrol, pakai script[admin@QT-GATEWAY] > /system script add name="gen-qt-per-ip" source=":foreach lease in=[/ip dhcp-server lease find where status=bound] do={ :local ip [/ip dhcp-server lease get $lease address]; :local mac [/ip dhcp-server lease get $lease mac-address]; :local host [/ip dhcp-server lease get $lease host-name]; :if ([/queue tree find where name=\"qt-$ip\"] = \"\") do={ /queue tree add name=(\"qt-\" . $ip) parent=download-total packet-mark=\"\" max-limit=\"5M\" priority=5 comment=(\"Auto: \" . $host) } }"# jalankan script[admin@QT-GATEWAY] > /system script run gen-qt-per-ip# jadwalkan otomatis tiap 5 menit[admin@QT-GATEWAY] > /system scheduler add name="auto-qt" interval=5m on-event="gen-qt-per-ip"
REKOMENDASI: Untuk kebanyakan kasus, PCQ per-IP sudah cukup. Tidak perlu script manual. PCQ lebih efisien dan otomatis handle dynamic client.
TIME-BASED QUEUE TREE
ADVANCED
Aktifkan/nonaktifkan queue tree berdasarkan waktu. Berguna untuk limit bandwidth di jam tertentu saja.
SETUP TIME-BASED
TIME-BASED
# queue tree aktif hanya jam kerja (08:00 - 17:00)[admin@QT-GATEWAY] > /queue tree set [find name="download-total"] time="8h-17h,sun,mon,tue,wed,thu,fri"# queue tree aktif hanya malam (19:00 - 23:00)[admin@QT-GATEWAY] > /queue tree add name="malam-only" parent=global max-limit="20M" time="19h-23h"# queue tree aktif hanya weekend[admin@QT-GATEWAY] > /queue tree add name="weekend-only" parent=global max-limit="40M" time="sat,sun"# format time:# Xh-Yh = jam X sampai jam Y# sun,mon,tue,wed,thu,fri,sat = hari# bisa kombinasi: "8h-17h,mon-fri"
SCHEDULER ALTERNATIF
SCHEDULER
# alternatif: pakai scheduler untuk enable/disable queue tree# scheduler untuk enable jam 19:00[admin@QT-GATEWAY] > /system scheduler add name="enable-malam" start-time="19:00:00" interval=1d on-event="/queue tree enable [find name=\"malam-only\"]"# scheduler untuk disable jam 07:00[admin@QT-GATEWAY] > /system scheduler add name="disable-malam" start-time="07:00:00" interval=1d on-event="/queue tree disable [find name=\"malam-only\"]"
KASUS PENGGUNAAN
JAM KERJA KANTOR
Limit bandwidth ketat jam 08:00-17:00 untuk produktivitas. Longgar di luar jam kerja.
MALAM HARI
Limit download/torrent malam hari untuk hemat bandwidth. Pagi hari bebas.
WEEKEND VS WEEKDAY
Limit berbeda untuk weekday (ketat) dan weekend (longgar). Sesuai pola penggunaan.
JAM SEKOLAH
Limit social media/game jam sekolah. Bebas di luar jam sekolah untuk anak.
TIPS: Pastikan NTP sinkron sebelum pakai time-based queue. Jika waktu router salah, queue tidak aktif sesuai jadwal. Cek dengan /system clock print.
QUEUE TREE UNTUK HOTSPOT
ADVANCED
Integrasi Queue Tree dengan Hotspot untuk limit bandwidth per user/voucher dengan QoS advanced.
HOTSPOT USER PROFILE
HOTSPOT PROFILE
# buat user profile dengan rate-limit[admin@QT-GATEWAY] > /ip hotspot user profile add name="1jam-2Mbps" rate-limit="2M/5M" idle-timeout="10m" shared-users=1[admin@QT-GATEWAY] > /ip hotspot user profile add name="3jam-5Mbps" rate-limit="5M/10M" idle-timeout="15m" shared-users=1[admin@QT-GATEWAY] > /ip hotspot user profile add name="1hari-10Mbps" rate-limit="10M/20M" idle-timeout="30m" shared-users=2# saat user login hotspot:# - queue otomatis dibuat sesuai profile# - user dapat bandwidth sesuai rate-limit# saat user logout:# - queue otomatis dihapus
QUEUE TREE GLOBAL HOTSPOT
GLOBAL HOTSPOT
# buat queue tree global untuk semua hotspot user[admin@QT-GATEWAY] > /queue tree add name="hotspot-total" parent=global max-limit="45M" queue="pcq-per-ip-down"# queue ini membatasi total bandwidth semua hotspot user# masing-masing user tetap di-limit oleh profile rate-limit# PCQ membagi rata ke semua user# cek queue hotspot[admin@QT-GATEWAY] > /queue tree print # NAME PARENT MAX-LIMIT QUEUE 0 hotspot-total global 45M pcq-per-ip-down 1 hs-v001 hotspot-total 5M/2M <- auto 2 hs-v002 hotspot-total 10M/5M <- auto 3 hs-v003 hotspot-total 20M/10M <- auto
MANGLE UNTUK HOTSPOT
HOTSPOT MANGLE
# mark connection untuk hotspot user[admin@QT-GATEWAY] > /ip firewall mangle add chain=prerouting action=mark-connection new-connection-mark="conn-hotspot" in-interface=bridge hotspot=auth passthrough=yes# mark packet untuk hotspot[admin@QT-GATEWAY] > /ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark="pkt-hotspot-up" connection-mark="conn-hotspot" in-interface=bridge passthrough=no[admin@QT-GATEWAY] > /ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark="pkt-hotspot-down" connection-mark="conn-hotspot" in-interface=ether1 passthrough=no# queue tree untuk hotspot[admin@QT-GATEWAY] > /queue tree add name="hotspot-download" parent="hotspot-total" packet-mark="pkt-hotspot-down" max-limit="45M" queue="pcq-per-ip-down"[admin@QT-GATEWAY] > /queue tree add name="hotspot-upload" parent=global packet-mark="pkt-hotspot-up" max-limit="10M" queue="pcq-per-ip-up"
TIPS: Untuk hotspot, pakai user profile rate-limit + queue tree global dengan PCQ. Hotspot otomatis handle queue per user. Queue tree global untuk total bandwidth semua user.
QUEUE TREE UNTUK GAME & STREAMING
SCENARIO
Setup Queue Tree khusus untuk game online dan streaming video dengan priority dan limit yang optimal.
GAME ONLINE (PRIORITY 1)
GAME QUEUE
# mark connection game (port game online)# Mobile Legends, PUBG, Free Fire, dll[admin@QT-GATEWAY] > /ip firewall mangle add chain=prerouting action=mark-connection new-connection-mark="conn-game" protocol=udp dst-port="30000-40000" passthrough=yes[admin@QT-GATEWAY] > /ip firewall mangle add chain=prerouting action=mark-connection new-connection-mark="conn-game" protocol=tcp dst-port="10000-20000" passthrough=yes# mark packet game[admin@QT-GATEWAY] > /ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark="pkt-game-up" connection-mark="conn-game" in-interface=bridge passthrough=no[admin@QT-GATEWAY] > /ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark="pkt-game-down" connection-mark="conn-game" in-interface=ether1 passthrough=no# queue tree game (priority 1 - tertinggi)[admin@QT-GATEWAY] > /queue tree add name="game-download" parent="download-total" packet-mark="pkt-game-down" limit-at="5M" max-limit="10M" priority=1 queue="pcq-per-ip-down"[admin@QT-GATEWAY] > /queue tree add name="game-upload" parent="upload-total" packet-mark="pkt-game-up" limit-at="2M" max-limit="5M" priority=1 queue="pcq-per-ip-up"# Game butuh:# - Latency rendah (priority 1)# - Bandwidth kecil tapi stabil (limit-at)# - PCQ untuk fair sharing antar player
TIPS: Monitor queue tree rutin untuk deteksi masalah. Jika RATE = MAX-LIMIT terus, berarti client butuh bandwidth lebih. Jika dropped tinggi, pertimbangkan naikkan limit atau tambah bandwidth ISP.
TROUBLESHOOTING QUEUE TREE
SUPPORT
Masalah umum Queue Tree dan solusinya.
QUEUE TREE TIDAK BEKERJA (CLIENT TETAP DAPAT FULL BANDWIDTH)
KEMUNGKINAN PENYEBAB:
1. Packet-mark tidak ter-mark - cek Mangle rule
2. Connection-mark tidak ada - cek urutan Mangle
3. Queue tree parent salah - cek parent queue
4. Queue tree disabled - cek status enabled
5. Packet-mark nama salah (typo) - cek spelling SOLUSI: Cek Mangle mark connection & mark packet. Pastikan urutan benar. Cek queue tree parent & packet-mark match.
MANGLE TIDAK MARK PACKET
KEMUNGKINAN PENYEBAB:
1. Mark connection di bawah mark packet - urutan salah
2. Mark connection passthrough=no - packet tidak lanjut
3. Mark packet passthrough=yes - packet lanjut ke rule lain
4. Kriteria mark salah (port, protocol, address) SOLUSI: Mark connection HARUS di atas mark packet. Mark connection passthrough=yes, mark packet passthrough=no.
CPU LOAD TINGGI (>80%) SAAT QUEUE TREE AKTIF
KEMUNGKINAN PENYEBAB:
1. Terlalu banyak Mangle rule
2. Terlalu banyak Queue Tree rule
3. Layer 7 protocol aktif (berat CPU)
4. Bandwidth terlalu tinggi untuk RB941 SOLUSI: Kurangi jumlah rule Mangle & Queue Tree. Disable Layer 7. Turunkan bandwidth. Upgrade hardware jika perlu.
PCQ TIDAK BAGI RATA
KEMUNGKINAN PENYEBAB:
1. PCQ classifier salah (src-address vs dst-address)
2. pcq-rate terlalu besar
3. pcq-total-limit terlalu kecil
4. Parent queue limit terlalu kecil SOLUSI: Cek PCQ classifier. Untuk download pakai dst-address, untuk upload pakai src-address. Set pcq-rate sesuai kebutuhan.
PRIORITY TIDAK BEKERJA (SEMUA CLIENT DAPAT SAMA)
KEMUNGKINAN PENYEBAB:
1. Bandwidth tidak penuh - priority hanya bekerja saat bandwidth penuh
2. Semua queue priority sama
3. limit-at terlalu besar (melebihi parent) SOLUSI: Test saat bandwidth penuh. Pastikan priority berbeda. Cek limit-at tidak melebihi parent.
QUEUE TREE HIERARCHY SALAH
KEMUNGKINAN PENYEBAB:
1. Parent queue tidak ada - cek parent name
2. Parent queue disabled - enable parent dulu
3. Circular reference (child jadi parent dirinya)
4. Total limit child melebihi parent SOLUSI: Cek parent queue ada & enabled. Pastikan tidak circular. Total limit child tidak harus sama parent, tapi limit-at child tidak boleh melebihi parent.
DIAGNOSTIC COMMANDS
DIAGNOSTIC
# cek queue tree[admin@QT-GATEWAY] > /queue tree print[admin@QT-GATEWAY] > /queue tree print detail# cek mangle[admin@QT-GATEWAY] > /ip firewall mangle print# cek connection mark[admin@QT-GATEWAY] > /ip firewall connection print where connection-mark!=""# cek CPU load[admin@QT-GATEWAY] > /system resource print# traffic monitor[admin@QT-GATEWAY] > /tool traffic-monitor interface=ether1# torch per IP[admin@QT-GATEWAY] > /tool torch interface=bridge# test speed[admin@QT-GATEWAY] > /tool bandwidth-test 10.10.10.101 duration=10s direction=both
BEST PRACTICE QUEUE TREE
TIPS
URUTAN MANGLE
Mark connection di atas mark packet. Rule spesifik di atas rule general. Passthrough=yes untuk mark connection, no untuk mark packet.
HIERARCHY JELAS
Parent = total bandwidth, child = sub-bagian. Jangan terlalu dalam (max 3-4 level). Dokumentasikan hierarki.
PRIORITY BERBEDA
Set priority berbeda sesuai kebutuhan. Game (P1), browsing (P3), streaming (P5), download (P8).
PAKAI PCQ
PCQ untuk fair sharing otomatis. Tidak perlu buat queue per user. Lebih efisien dan scalable.
BURST HEMAT
Pakai burst untuk browsing, bukan download besar. Burst-time 5-15 detik cukup.
HINDARI LAYER 7
Layer 7 berat CPU. Untuk RB941, batasi max 3-5 pattern. Lebih baik pakai DNS filtering atau address-list.
MONITOR RUTIN
Cek queue usage, CPU load, dropped packet. Deteksi dini jika ada masalah.
BACKUP CONFIG
Backup config sebelum ubah queue tree. Jika salah, bisa restore dengan cepat.
DOKUMENTASI
Dokumentasikan: Mangle rules, Queue Tree hierarchy, priority, limit. Update saat ada perubahan.
UPDATE ROUTEROS
Update ke versi stable terbaru untuk patch keamanan dan perbaikan bug queue.
UPGRADE JIKA PERLU
Jika RB941 overload, upgrade ke hAP ac^2 atau CCR. Jangan paksakan hardware di luar limit.
TEST DULU
Test queue tree di lab environment sebelum production. Pastikan Mangle mark & Queue Tree bekerja sesuai harapan.
INDIKATOR LED
REFERENCE
LED di panel depan RB941 memberi informasi status router.
PWR
ON
Power normal
ACT
BLINK
Ada traffic
ETHER1
LINK
WAN OK
ETHER2-4
LINK
LAN OK
WLAN
BLINK
WiFi aktif
KONDISI LED
ARTI
TINDAKAN
PWR ON
Power normal
OK
PWR OFF
Tidak ada power
Cek adaptor/kabel
ACT BLINK CEPAT
Traffic tinggi
Normal saat banyak client
ACT OFF
Tidak ada traffic
Cek koneksi
WLAN BLINK
WiFi ada traffic
Normal
WLAN OFF
WiFi disabled
Aktifkan wireless
QUEUE TREE CHEATSHEET
QUICK REF
QUEUE TREE COMMANDS
# MANGLE - MARK CONNECTION> /ip firewall mangle add chain=prerouting action=mark-connection new-connection-mark=conn-game protocol=udp dst-port=30000-40000 passthrough=yes# MANGLE - MARK PACKET> /ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=pkt-game-down connection-mark=conn-game in-interface=ether1 passthrough=no# QUEUE TREE - PARENT> /queue tree add name=download-total parent=global max-limit=45M# QUEUE TREE - CHILD> /queue tree add name=game-download parent=download-total packet-mark=pkt-game-down limit-at=5M max-limit=10M priority=1# QUEUE TYPE - PCQ> /queue type add name=pcq-down kind=pcq pcq-classifier=dst-address pcq-rate=5M pcq-total-limit=45M# LAYER 7 PROTOCOL> /ip firewall layer7-protocol add name=youtube regexp="(^|\.)(youtube|googlevideo)\.com"# MONITORING> /queue tree print> /ip firewall mangle print> /ip firewall connection print where connection-mark!=""> /tool traffic-monitor interface=ether1> /tool torch interface=bridge> /system resource print