Full Bandwidth Management Parent Queue Tree
Full Bandwidth Management Parent Queue Tree
Full Bandwidth Management Parent Queue Tree
For example If I have a totally the bandwidth internet connection is up to 2M, after i
have tested by speed test, the bandwidth average is 512 kbps. It means that if I
have 6 clients, be 512/6 = 86 kbps/clients normally, the ideal number is very small
inappropriate for our client. If the bandwidth of up to 2 M calculated with 2000/6 to
be around 334 kbps /clients, it can makes browsing and online game stuck if just
only one client there who download and play streaming video, because the client
spend almost all the average speed (512kbps) other clients will be especially
problematic just for browsing or online game. In this case we need the priority to
the fourth packets.
Full Bandwidth Management with the parent queue tree complete the lack of
packets connection per client, especially to handle the internet network with many
clients. The principle is equally divide the bandwidth to all the clients with
bandwidth greater than that should be given as the limit bandwidth on each clients,
in which we set Online Games, Browsing, Download, Video Streaming packets,
connection packets. Well, for now I will make the Full Bandwidth Management
using the parent queue tree. For more easily to make the complex rule, I will
work with the scripts for more quickly.
1. Marking all the connection out and in of the interface Mikrotik router, and
create the connection
/ip firewall mangle
add action=mark-connection chain=prerouting dst-address=!MikroTik ininterface=ether1 new-connection-mark=All-Inconn disabled=no
passthrough=yes comment="CONNECTION-IN"
add action=mark-packet chain=prerouting connection-mark=All-Inconn
disabled=no new-packet-mark=All-inpkt passthrough=yes
comment="UPSTEAM PACKETS"
add
action=mark-connection
in-interface=wlan1
newThe
connection
that we will usechain=forward
is All-Outconn
as the above scripts
with the
connection-mark=All-Outconn
disabled=no
passthrough=yes
connection chain=forward out-interface=wlan1, which we subsequently
comment="CONNECTION-OUT"
differentiate
into different connections to produce different connection packets.
add action=mark-packet chain=forward connection-mark=All-Outconn new2. Take the connections of All-Outconn then divide it into the connections to
packet-mark=All-Outpkt disabled=no passthrough=yes
every client, and make connection packets every client that will captured by the
comment="DOWNSTEAM-PACKETS"
queue tree per client.
Here are the following scripts :
/queue tree
The scripts above consists with mangle and queue tree rule. From here we are already making
the connections per ip address of clients, such as
3. The Connections per client that we have divided will separated into four packets
connection such as browsing, online games, download, streaming video per client. Here are
the forth part of four different packets connection. If there are any packets that have not been
defined I asked for suggestions from those of you that had experience.
Part I : Making the packets per client for download and the queue tree with priority as you
wish, here the following scripts:
/ip firewall layer7-protocol
add comment="" name=download regexp="^.*get.+\\.(exe|rar|iso|zip|7zip|flv|mkv|
avi|mp4|3gp|rmvb|mp3|img|dat|mov).*\$"
/ip firewall mangle
add chain=forward layer7-protocol=download action=mark-packet new-packetmark=billing-dpkt passthrough=no packet-mark=Billing-pkt comment=Billing-Down
add chain=forward layer7-protocol=download action=mark-packet new-packetmark=client1-dpkt passthrough=no packet-mark=Client1-pkt comment=Client1-Down
add chain=forward layer7-protocol=download action=mark-packet new-packetmark=client2-dpkt passthrough=no packet-mark=Client2-pkt comment=Client2-Down
add chain=forward layer7-protocol=download action=mark-packet new-packetmark=client3-dpkt passthrough=no packet-mark=Client3-pkt comment=Client3-Down
add chain=forward layer7-protocol=download action=mark-packet new-packetmark=client4-dpkt passthrough=no packet-mark=Client4-pkt comment=Client4-Down
add chain=forward layer7-protocol=download action=mark-packet new-packetmark=client5-dpkt passthrough=no packet-mark=Client5-pkt comment=Client5-Down
Here we take and use the connections per client and differentiate into
connection packets of downloaded by the extension files, so if there are any the
extension files that you think is important, just add the the extension files that
you want to the layer 7 protocols from the above scripts.
Part II. Making the video packet connection per client complete with the queue
tree and priority as you please. Here the following scripts
add comment="" name=streaming regexp="^.*get.+\\.(c.youtube.com|
cdn.dailymotion.com|metacafe.com|mccont.com).*\$"
If the above script doesn't works, try the second regexp on the script below!
/ip firewall layer7-protocol
add comment="" name=streaming regexp="videoplayback|video"
/ip firewall mangle
add comment=Billing-Streams chain=forward layer7-protocol=streaming
action=mark-packet new-packet-mark=billing-spkt passthrough=no packetmark=Billing-pkt
add comment=Client1-Streams chain=forward layer7-protocol=streaming
action=mark-packet new-packet-mark=client1-spkt passthrough=no packetmark=Client1-pkt
add comment=Client2-Streams chain=forward layer7-protocol=streaming
action=mark-packet new-packet-mark=client2-spkt passthrough=no packetmark=Client2-pkt
This is the similar method in making the connection packets like download
packets is by using a layer 7 protocols, the content of streaming video other
sites that have not been defined, please you add on the layer 7 protocols if you
think that is important, and adjust the priority and limit speed on the queue tree
as you please.
c. Membuat packets Online game per client lengkap dengan queue treenya,
berikut ini adalah scriptsnya :
Part III : Making the Online games packet connection per client complete with
the queue tree and priority, here the following scripts:
/ip firewall mangle
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packetmark=gpkt passthrough=yes protocol=tcp dst-port=5340-5352,6000-6152,1000110011,14009-14030,18901-18909 comment="Online Game Portal"
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packetmark=gpkt passthrough=yes protocol=tcp dstport=39190,27780,29000,22100,10009,4300,15001,15002,7341,7451
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packetmark=gpkt passthrough=yes protocol=tcp dstport=40000,9300,9400,9700,7342,8005-8010,37466,36567,8822
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packetmark=gpkt passthrough=yes protocol=tcp dstport=47611,16666,20000,5105,29000,18901-18909,9015
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packetmark=gpkt passthrough=yes protocol=udp dst-port=27005,27015
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packetmark=gpkt passthrough=yes protocol=udp dst-port=27005-27020,13055,78007900,12060-12070
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packetmark=gpkt passthrough=yes protocol=udp dst-port=80058010,9068,1293,1479,9401,9600,30000
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packetmark=gpkt passthrough=yes protocol=udp dst-port=14009-14030,42051-42052,4000040050,13000-13080
/ip firewall mangle
add action=mark-packet chain=forward new-packet-mark=billing-gpkt
passthrough=no dst-address=192.168.1.11 packet-mark=gpkt comment=Billing-Game
add action=mark-packet chain=forward new-packet-mark=client1-gpkt
passthrough=no dst-address=192.168.1.17 packet-mark=gpkt comment=Client1-Game
add action=mark-packet chain=forward new-packet-mark=client2-gpkt
passthrough=no dst-address=192.168.1.16 packet-mark=gpkt comment=Client2-Game
add action=mark-packet chain=forward new-packet-mark=client3-gpkt
passthrough=no dst-address=192.168.1.15 packet-mark=gpkt comment=Client3-Game
add action=mark-packet chain=forward new-packet-mark=client4-gpkt
passthrough=no dst-address=192.168.1.14 packet-mark=gpkt comment=Client4-Game
add action=mark-packet chain=forward new-packet-mark=client5-gpkt
passthrough=no dst-address=192.168.1.20 packet-mark=gpkt comment=Client5-Game
add action=mark-packet chain=forward new-packet-mark=client6-gpkt
passthrough=no dst-address=192.168.1.21 packet-mark=gpkt comment=Client6-Game
add action=mark-packet chain=forward new-packet-mark=master-gpkt passthrough=no
dst-address=192.168.1.8 packet-mark=gpkt comment=Master-Game
/queue tree
add name=Billing-Game parent=Billing packet-mark=billing-gpkt queue=default
priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k
burst-time=2s
add name=Client1-Game parent=Client1 packet-mark=client1-gpkt queue=default
priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k
burst-time=2s
add name=Client2-Game parent=Client2 packet-mark=client2-gpkt queue=default
priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k
burst-time=2s
add name=Client3-Game parent=Client3 packet-mark=client3-gpkt queue=default
priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k
burst-time=2s
In this case we make the online-games connection at first, based on outinterface=wlan1 and tcp and udp of many ports that used by the online games.
Then make the online games connection packets per ip address client from that,
finally we capture the packets online games on queue tree and the priority as
you wish.
Part IV. Make browsing connection packets per client complete with tree queue
and give the priority, here the following script :
/ip firewall mangle
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no packet-mark=Billing-pkt new-packet-mark=billing-bpkt
protocol=tcp comment="BILLING BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no packet-mark=Client1-pkt new-packet-mark=client1-bpkt
protocol=tcp comment="CLIENT1 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no packet-mark=Client2-pkt new-packet-mark=client2-bpkt
protocol=tcp comment="CLIENT2 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no packet-mark=Client3-pkt new-packet-mark=client3-bpkt
protocol=tcp comment="CLIENT3 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no packet-mark=Client4-pkt new-packet-mark=client4-bpkt
protocol=tcp comment="CLIENT4 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no packet-mark=Client5-pkt new-packet-mark=client5-bpkt
protocol=tcp comment="CLIENT5 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no packet-mark=Client6-pkt new-packet-mark=client6-bpkt
protocol=tcp comment="CLIENT6 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no packet-mark=Master-pkt new-packet-mark=master-bpkt protocol=tcp
comment="MASTER BROWSING"
/queue tree
add name="Billing-Browsing" parent=Billing packet-mark=billing-bpkt
queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burstthreshold=192k burst-time=2s
add name="Client1-Browsing" parent=Client1 packet-mark=client1-bpkt
queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burstthreshold=192k burst-time=2s
Take and use the connection per client then we make the new browsing
connection by capturing based on port 80 and 443 (HTTP and HTTPS ports) and
adding small bytes connection-bytes=0-1000000, port that commonly used in
browsing the url site, small bytes of data may also be included here from the
other three connection packets else, but small enough