Wednesday, January 27, 2016

Full Bandwidth Management Parent Queue Tree Mikrotik

Full Bandwidth Management Parent Queue Tree



This is the combination, continued and completion of bandwidth management methods previously using parent queue tree about to handle all sorts of purposes in an internet network that is more complex. Perhaps if you do not want to think too hard, you simply apply the simple queue to limit bandwidth that so powerful and assertive to limit bandwidth per client on your internet network. The problem is if we share the bandwidth with a simple queue is stiffness, and it's hard for me to divide into many clients normally. It would be appropriate to be applied to the kind of dedicate internet connection.


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 BandwidthManagement using the parent queue tree. For more easily to make the complex rule, I will work with the scripts for more quickly.


Situation and Conditions:

Total Bandwidth = Up to 2 M

8 Clients that I have :
Billing : 192.168.1.11
Client1    : 192.168.1.17
Client2    : 192.168.1.16
Client3    : 192.168.1.15
Client4    : 192.168.1.14
Client5    : 192.168.1.20
Client6    : 192.168.1.21
Master    : 192.168.1.8 

In-Interface = ether1
Out-Interface = wlan1

/ip firewall address-list
add address=192.168.1.0/24  disabled=no list=MikroTik comment=""

1.      Marking all the connection out and in of the interface Mikrotik router, and create the connection


The connection that we will use is All-Outconn as the above scripts with the connection chain=forwardout-interface=wlan1, which we subsequently differentiate into different connections to produce different connection packets.

2. Take the connections of All-Outconn then divide it into the connections to every client, and make connection packets every client that will captured by the queue tree per client.
Here are the following scripts :
/ip firewall mangle
addaction=mark-connectionchain=forwardcomment="Billing"disabled=nodst-address=192.168.1.11 new-connection-mark=Billing-conn passthrough=yes connection-mark=All-Outconn
addaction=mark-connectionchain=forwardcomment="Client1"disabled=nodst-address=192.168.1.17 new-connection-mark=Client1-conn passthrough=yes connection-mark=All-Outconn
addaction=mark-connectionchain=forwardcomment="Client2"disabled=nodst-address=192.168.1.16 new-connection-mark=Client2-conn passthrough=yes connection-mark=All-Outconn
addaction=mark-connectionchain=forwardcomment="Client3"disabled=nodst-address=192.168.1.15 new-connection-mark=Client3-conn passthrough=yes connection-mark=All-Outconn
addaction=mark-connectionchain=forwardcomment="Client4"disabled=nodst-address=192.168.1.14 new-connection-mark=Client4-conn passthrough=yes connection-mark=All-Outconn
addaction=mark-connectionchain=forwardcomment="Client5"disabled=nodst-address=192.168.1.20 new-connection-mark=Client5-conn passthrough=yes connection-mark=All-Outconn
addaction=mark-connectionchain=forwardcomment="Client6"disabled=nodst-address=192.168.1.21 new-connection-mark=Client6-conn passthrough=yes connection-mark=All-Outconn
addaction=mark-connectionchain=forwardcomment="Master"disabled=nodst-address=192.168.1.8 new-connection-mark=Master-conn passthrough=yes connection-mark=All-Outconn

/ip firewall mangle
addaction=mark-packet chain=forwardnew-packet-mark=Billing-pktpassthrough=yes connection-mark=Billing-conn comment="BILLING DOWNSTEAM"
addaction=mark-packet chain=forwardnew-packet-mark=Client1-pkt passthrough=yes connection-mark=Client1-conn comment="CLIENT1 DOWNSTEAM"
addaction=mark-packet chain=forwardnew-packet-mark=Client2-pkt passthrough=yes connection-mark=Client2-conn comment="CLIENT2 DOWNSTEAM"
addaction=mark-packet chain=forwardnew-packet-mark=Client3-pkt passthrough=yes connection-mark=Client3-conn comment="CLIENT3 DOWNSTEAM"
addaction=mark-packet chain=forwardnew-packet-mark=Client4-pkt passthrough=yes connection-mark=Client4-conn comment="CLIENT4 DOWNSTEAM"
addaction=mark-packet chain=forwardnew-packet-mark=Client5-pkt passthrough=yes connection-mark=Client5-conn comment="CLIENT5 DOWNSTEAM"
addaction=mark-packet chain=forwardnew-packet-mark=Client6-pkt passthrough=yes connection-mark=Client6-conn comment="CLIENT6 DOWNSTEAM"
addaction=mark-packet chain=forwardnew-packet-mark=Master-pktpassthrough=yes connection-mark=Master-conn comment="MASTER DOWNSTEAM"

/queue tree
addname=Billing parent=All-Bandwidth packet-mark=Billing-pkt queue=defaultpriority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname=Client1 parent=All-Bandwidth packet-mark=Client1-pkt queue=defaultpriority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname=Client2 parent=All-Bandwidth packet-mark=Client2-pkt queue=defaultpriority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname=Client3 parent=All-Bandwidth packet-mark=Client3-pkt queue=defaultpriority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname=Client4 parent=All-Bandwidth packet-mark=Client4-pkt queue=defaultpriority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname=Client5 parent=All-Bandwidth packet-mark=Client5-pkt queue=defaultpriority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname=Client6 parent=All-Bandwidth packet-mark=Client6-pkt queue=defaultpriority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname=Master parent=All-Bandwidth packet-mark=Master-pkt queue=defaultpriority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s


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
  • Connections Per Client : Billing-conn, Client1-conn, Client2-conn, Client3-conn, Client4-conn, Client5-conn, Client6-conn, Master-conn
  • Connection Packets Per Client : Billing-pkt, Client1-pkt, Client1-pkt, Client2-pkt, Client3-pkt, Client4-pkt, Client5-pkt, Client6-pkt, Master-pkt

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
addcomment=""name=download regexp="^.*get.+\\.(exe|rar|iso|zip|7zip|flv|mkv|avi|mp4|3gp|rmvb|mp3|img|dat|mov).*\$"

/ip firewall mangle
addchain=forwardlayer7-protocol=download action=mark-packet new-packet-mark=billing-dpktpassthrough=nopacket-mark=Billing-pkt comment=Billing-Down
addchain=forwardlayer7-protocol=download action=mark-packet new-packet-mark=client1-dpkt passthrough=nopacket-mark=Client1-pkt comment=Client1-Down
addchain=forwardlayer7-protocol=download action=mark-packet new-packet-mark=client2-dpkt passthrough=nopacket-mark=Client2-pkt comment=Client2-Down
addchain=forwardlayer7-protocol=download action=mark-packet new-packet-mark=client3-dpkt passthrough=nopacket-mark=Client3-pkt comment=Client3-Down
addchain=forwardlayer7-protocol=download action=mark-packet new-packet-mark=client4-dpkt passthrough=nopacket-mark=Client4-pkt comment=Client4-Down
addchain=forwardlayer7-protocol=download action=mark-packet new-packet-mark=client5-dpkt passthrough=nopacket-mark=Client5-pkt comment=Client5-Down
addchain=forwardlayer7-protocol=download action=mark-packet new-packet-mark=client6-dpkt passthrough=nopacket-mark=Client6-pkt comment=Client6-Down
addchain=forwardlayer7-protocol=download action=mark-packet new-packet-mark=master-dpktpassthrough=nopacket-mark=Master-pkt comment=Master-Down
  
/queue tree
addname=Billing-Down parent=Billing packet-mark=billing-dpkt queue=defaultpriority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
addname=Client1-Down parent=Client1 packet-mark=client1-dpkt queue=defaultpriority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
addname=Client2-Down parent=Client2 packet-mark=client2-dpkt queue=defaultpriority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
addname=Client3-Down parent=Client3 packet-mark=client3-dpkt queue=defaultpriority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
addname=Client4-Down parent=Client4 packet-mark=client4-dpkt queue=defaultpriority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
addname=Client5-Down parent=Client5 packet-mark=client5-dpkt queue=defaultpriority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
addname=Client6-Down parent=Client6 packet-mark=client6-dpkt queue=defaultpriority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
addname=Master-Down parent=Master packet-mark=master-dpkt queue=defaultpriority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s

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
addcomment=Billing-Streams chain=forwardlayer7-protocol=streaming action=mark-packet new-packet-mark=billing-spktpassthrough=nopacket-mark=Billing-pkt
addcomment=Client1-Streams chain=forwardlayer7-protocol=streaming action=mark-packet new-packet-mark=client1-spkt passthrough=nopacket-mark=Client1-pkt
addcomment=Client2-Streams chain=forwardlayer7-protocol=streaming action=mark-packet new-packet-mark=client2-spkt passthrough=nopacket-mark=Client2-pkt
addcomment=Client3-Streams chain=forwardlayer7-protocol=streaming action=mark-packet new-packet-mark=client3-spkt passthrough=nopacket-mark=Client3-pkt
addcomment=Client4-Streams chain=forwardlayer7-protocol=streaming action=mark-packet new-packet-mark=client4-spkt passthrough=nopacket-mark=Client4-pkt
addcomment=Client5-Streams chain=forwardlayer7-protocol=streaming action=mark-packet new-packet-mark=client5-spkt passthrough=nopacket-mark=Client5-pkt
addcomment=Client6-Streams chain=forwardlayer7-protocol=streaming action=mark-packet new-packet-mark=client6-spkt passthrough=nopacket-mark=Client6-pkt
addcomment=Master-Streams chain=forwardlayer7-protocol=streaming action=mark-packet new-packet-mark=master-spktpassthrough=nopacket-mark=Master-pkt
  
/queue tree
addname=Billing-Streams parent=Billing packet-mark=billing-spkt queue=defaultpriority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client1-Streams parent=Client1 packet-mark=client1-spkt queue=defaultpriority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client2-Streams parent=Client2 packet-mark=client2-spkt queue=defaultpriority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client3-Streams parent=Client3 packet-mark=client3-spkt queue=defaultpriority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client4-Streams parent=Client4 packet-mark=client4-spkt queue=defaultpriority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client5-Streams parent=Client5 packet-mark=client5-spkt queue=defaultpriority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client6-Streams parent=Client6 packet-mark=client6-spkt queue=defaultpriority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Master-Streams parent=Master packet-mark=master-spkt queue=defaultpriority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s

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 lengkapdengan queue treenya, berikutiniadalahscriptsnya :

Part III : Making the Online games packet connection per client complete with the queue tree and priority, here the following scripts:
/ip firewall mangle
addaction=mark-packet chain=forwardpacket-mark=All-Outpkt new-packet-mark=gpktpassthrough=yes protocol=tcpdst-port=5340-5352,6000-6152,10001-10011,14009-14030,18901-18909 comment="Online Game Portal"
addaction=mark-packet chain=forwardpacket-mark=All-Outpkt new-packet-mark=gpktpassthrough=yes protocol=tcp dst-port=39190,27780,29000,22100,10009,4300,15001,15002,7341,7451
addaction=mark-packet chain=forwardpacket-mark=All-Outpkt new-packet-mark=gpktpassthrough=yes protocol=tcpdst-port=40000,9300,9400,9700,7342,8005-8010,37466,36567,8822
addaction=mark-packet chain=forwardpacket-mark=All-Outpkt new-packet-mark=gpktpassthrough=yes protocol=tcpdst-port=47611,16666,20000,5105,29000,18901-18909,9015
addaction=mark-packet chain=forwardpacket-mark=All-Outpkt new-packet-mark=gpktpassthrough=yes protocol=udpdst-port=27005,27015
addaction=mark-packet chain=forwardpacket-mark=All-Outpkt new-packet-mark=gpktpassthrough=yes protocol=udpdst-port=27005-27020,13055,7800-7900,12060-12070
addaction=mark-packet chain=forwardpacket-mark=All-Outpkt new-packet-mark=gpktpassthrough=yes protocol=udpdst-port=8005-8010,9068,1293,1479,9401,9600,30000
addaction=mark-packet chain=forwardpacket-mark=All-Outpkt new-packet-mark=gpktpassthrough=yes protocol=udpdst-port=14009-14030,42051-42052,40000-40050,13000-13080

/ip firewall mangle
addaction=mark-packet chain=forwardnew-packet-mark=billing-gpktpassthrough=nodst-address=192.168.1.11 packet-mark=gpkt comment=Billing-Game
addaction=mark-packet chain=forwardnew-packet-mark=client1-gpkt passthrough=nodst-address=192.168.1.17 packet-mark=gpkt comment=Client1-Game
addaction=mark-packet chain=forwardnew-packet-mark=client2-gpkt passthrough=nodst-address=192.168.1.16 packet-mark=gpkt comment=Client2-Game
addaction=mark-packet chain=forwardnew-packet-mark=client3-gpkt passthrough=nodst-address=192.168.1.15 packet-mark=gpkt comment=Client3-Game
addaction=mark-packet chain=forwardnew-packet-mark=client4-gpkt passthrough=nodst-address=192.168.1.14 packet-mark=gpkt comment=Client4-Game
addaction=mark-packet chain=forwardnew-packet-mark=client5-gpkt passthrough=nodst-address=192.168.1.20 packet-mark=gpkt comment=Client5-Game
addaction=mark-packet chain=forwardnew-packet-mark=client6-gpkt passthrough=nodst-address=192.168.1.21 packet-mark=gpkt comment=Client6-Game
addaction=mark-packet chain=forwardnew-packet-mark=master-gpktpassthrough=nodst-address=192.168.1.8 packet-mark=gpkt comment=Master-Game

/queue tree
addname=Billing-Game parent=Billing packet-mark=billing-gpkt queue=defaultpriority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client1-Game parent=Client1 packet-mark=client1-gpkt queue=defaultpriority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client2-Game parent=Client2 packet-mark=client2-gpkt queue=defaultpriority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client3-Game parent=Client3 packet-mark=client3-gpkt queue=defaultpriority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client4-Game parent=Client4 packet-mark=client4-gpkt queue=defaultpriority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client5-Game parent=Client5 packet-mark=client5-gpkt queue=defaultpriority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Client6-Game parent=Client6 packet-mark=client6-gpkt queue=defaultpriority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
addname=Master-Game parent=Master packet-mark=master-gpkt queue=defaultpriority=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 out-interface=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
addaction=mark-packet chain=forwardconnection-bytes=0-1000000 src-port=80,443 passthrough=nopacket-mark=Billing-pkt new-packet-mark=billing-bpkt protocol=tcp comment="BILLING BROWSING"
addaction=mark-packet chain=forwardconnection-bytes=0-1000000 src-port=80,443 passthrough=nopacket-mark=Client1-pkt new-packet-mark=client1-bpkt protocol=tcp comment="CLIENT1 BROWSING"
addaction=mark-packet chain=forwardconnection-bytes=0-1000000 src-port=80,443 passthrough=nopacket-mark=Client2-pkt new-packet-mark=client2-bpkt protocol=tcp comment="CLIENT2 BROWSING"
addaction=mark-packet chain=forwardconnection-bytes=0-1000000 src-port=80,443 passthrough=nopacket-mark=Client3-pkt new-packet-mark=client3-bpkt protocol=tcp comment="CLIENT3 BROWSING"
addaction=mark-packet chain=forwardconnection-bytes=0-1000000 src-port=80,443 passthrough=nopacket-mark=Client4-pkt new-packet-mark=client4-bpkt protocol=tcp comment="CLIENT4 BROWSING"
addaction=mark-packet chain=forwardconnection-bytes=0-1000000 src-port=80,443 passthrough=nopacket-mark=Client5-pkt new-packet-mark=client5-bpkt protocol=tcp comment="CLIENT5 BROWSING"
addaction=mark-packet chain=forwardconnection-bytes=0-1000000 src-port=80,443 passthrough=nopacket-mark=Client6-pkt new-packet-mark=client6-bpkt protocol=tcp comment="CLIENT6 BROWSING"
addaction=mark-packet chain=forwardconnection-bytes=0-1000000 src-port=80,443 passthrough=nopacket-mark=Master-pkt new-packet-mark=master-bpkt protocol=tcp comment="MASTER BROWSING"

/queue tree
addname="Billing-Browsing"parent=Billing packet-mark=billing-bpkt queue=defaultpriority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname="Client1-Browsing"parent=Client1 packet-mark=client1-bpkt queue=defaultpriority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname="Client2-Browsing"parent=Client2 packet-mark=client2-bpkt queue=defaultpriority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname="Client3-Browsing"parent=Client3 packet-mark=client3-bpkt queue=defaultpriority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname="Client4-Browsing"parent=Client4 packet-mark=client4-bpkt queue=defaultpriority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname="Client5-Browsing"parent=Client5 packet-mark=client5-bpkt queue=defaultpriority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname="Client6-Browsing"parent=Client6 packet-mark=client6-bpkt queue=defaultpriority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
addname="Master-Browsing"parent=Master packet-mark=master-bpkt queue=defaultpriority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=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




 

2 comments:

  1. Gunjam Blog'S: Full Bandwidth Management Parent Queue Tree Mikrotik >>>>> Download Now

    >>>>> Download Full

    Gunjam Blog'S: Full Bandwidth Management Parent Queue Tree Mikrotik >>>>> Download LINK

    >>>>> Download Now

    Gunjam Blog'S: Full Bandwidth Management Parent Queue Tree Mikrotik >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete
  2. Gunjam Blog'S: Full Bandwidth Management Parent Queue Tree Mikrotik >>>>> Download Now

    >>>>> Download Full

    Gunjam Blog'S: Full Bandwidth Management Parent Queue Tree Mikrotik >>>>> Download LINK

    >>>>> Download Now

    Gunjam Blog'S: Full Bandwidth Management Parent Queue Tree Mikrotik >>>>> Download Full

    >>>>> Download LINK Iv

    ReplyDelete