Mikrotik Queue tree with Traffic Priority
Example if you have assigned user with 1 mb profile, & if user is doing full download, his stream will get degrade, buffered because IDM will fetch using full available bandwidth using multiple connection.
Using Priority feature in TREE, we can configure mikrotik to assign user 1mb bandwidth limit, but it should always give 1mb priority to CDN traffic first, then to others. This way even if user is downloading at full speed liek using IDM, and if he plays video from CDN , then bandwidth priority will be given to CDN first (IDM download will degrade so that priority can be given to CDN.
This was done to avoid streaming buffer issue even if user is downloading at full speed .
– Youtube Link: https://www.youtube.com/watch?v=WxDzEonl-Bk
Queue Code: [dynamic queue for user is auto created upon user pppoe connection, on top of that we r using queue tree to prioritize]
/ip firewall address-list add address=172.16.99.0/24 list=1mb add address=58.27.130.0/24 list=cdn_list /ip firewall mangle add action=mark-connection chain=forward new-connection-mark=ICMP_Conn protocol=icmp add action=mark-packet chain=forward connection-mark=ICMP_Conn new-packet-mark=ICMP_Pkts passthrough=no add action=mark-packet chain=forward comment="MARK CDN UP" dst-address-list=1mb new-packet-mark=cdn_up passthrough=no \ src-address-list=cdn_list add action=mark-packet chain=forward comment="MARK CDN DOWN" dst-address-list=cdn_list new-packet-mark=cdn_down \ passthrough=no src-address-list=1mb add action=mark-packet chain=forward comment=MARK_1MB_UP_USER new-packet-mark=1mb_up passthrough=no src-address-list=1mb add action=mark-packet chain=forward comment=MARK_1MB_DOWN_USER dst-address-list=1mb new-packet-mark=1mb_down \ passthrough=no /queue simple add max-limit=1M/1M name=ICMP packet-marks=ICMP_Pkts target="" /queue tree add max-limit=1G name=10G-ZAIB-WAN-Link parent=global add name="icmp pkts Top Priority from Main Feed - Zaib" packet-mark=ICMP_Pkts parent=10G-ZAIB-WAN-Link priority=1 add name=1mb-overall-internet-up packet-mark=1mb_up parent=10G-ZAIB-WAN-Link queue=1mb-upload add name=1mb-overall-internet-down packet-mark=1mb_down parent=10G-ZAIB-WAN-Link queue=1mb-download add name=cdn-down-hi-priority packet-mark=cdn_down parent=1mb-overall-internet-down priority=2 queue=1mb-download add name=cdn-up-hi-priority packet-mark=cdn_up parent=1mb-overall-internet-up priority=2 queue=1mb-upload /queue simple add max-limit=1M/1M name=ICMP packet-marks=ICMP_Pkts target=""
Regard’s
Syed Jahanzaib