Class-3 Bandwidth Management
Class-3 Bandwidth Management
Class-3 Bandwidth Management
BANDWIDTH MANAGEMENT
M.T.M. Monty
Topics we cover
What is Bandwidth
Download and Upload speeds
Relation between internet speed, download speed and browsing speed?
Simple Queues
HTB/CBQ
PCQ Based Queues
Bandwidth Control: Day-Night package
Dedicate Bandwidth
Shared Control
Burst Limit
LAB Work
Bandwidth is the data speed supported by a network connection. Bandwidth refers to how
much data per unit of time a network connection can handle. Bigger bandwidth allow greater
data to flow through them.
Bandwidth is typically measured in bits per second (bps). Commonly used larger units are
kilobits per second (Kbps), megabits per second (Mbps) and gigabits per second (Gbps).
Two terms are generally used when talking about broadband speeds:
The download speed is how fast you can pull data from the server to you. Most connections
are designed to download much faster than they upload, since the majority of online activity,
like loading web pages or streaming videos, consists of downloads. Download speed is
measured in megabits per second (Mbps).
The upload speed is how fast you send data from you to others. Uploading is necessary for
sending big files via email, or in using video-chat to talk to someone else online (since you
have to send your video feed to them). Upload speed is measured in megabits per second
(Mbps).
When you download something, your browser or your download manager shows the speed
is MBps(Megabytes per seconds)
Hence even if your bandwidth is 2Mbps as promised by your ISP, you'll get download speeds of
2Mbps/8= 1/4 MBps which is 256 KBps. Similarly to get a download speed of 2MBps, you need to
have an internet connection of 16Mbps.
Moreover there are other factors which affect your download speed as well. The network congestion,
background services on your computer which are using the internet connection, etc.
Prepared by: M.T.M. Monty ([email protected])
QUEUE
limit data rate for certain IP addresses, subnets, protocols, ports, and other parameters
share available traffic among users equally, or depending on the load of the channel
Bandwidth Management Service is the most popular Feature of MikroTik Router. It is said that
MikroTik Router is mostly used because of its Bandwidth Management service.
The module or service which is used to manage bandwidth in MikroTik Router is Queues.
There are various queue services in MikroTik router for managing user bandwidth. Among these,
simple queue service is mostly used for managing an office internet bandwidth.
The Hierarchical Token Bucket (HTB) is a faster replacement for the class based queueing
(CBQ) queueing discipline in Linux. It is useful to limit a client's download/upload rate so that the
limited client cannot saturate the total bandwidth. HTB (Hierarchical Token Bucket) is part of QoS
(Quality of Services), to make a hierarchical queue structure and determine relations between
queues (priority, burst possibility, etc)
Priority:
Normally, MikroTik bandwidth is assigned sequentially if they are in same priority. That
means, the user who is top position of Queue list will get first priority to assign bandwidth
and then the second positioned user and then the next positioned user. Priority can be
selected 1 to 8. 1 is high priority and 8 is less priority. High priority user will get
bandwidth first and then less priority user.
Lets Say, I have 7 PC which I will share a maximum bandwidth of 512k and a minimum
bandwidth of 73 kb each PC. If only one of my PC is online then he will be able to BW max
512kb, but if there are two PC online BW divided by 2, and so on up to 7 with the distribution
of bandwidth evenly.
Dedicated Bandwidth:
In broad terms, dedicated Internet is exactly what it sounds like: Internet access and
bandwidth dedicated to one user and one user alone. Say, I have 10Mb Bandwidth, and I am
using it alone.
Shared Control:
Lets say, I have 2Mb bandwidth and I have more than Twenty clients by assigning 512kb
bandwidth in each is a example of shared control.
Bursts are used to allow higher data rates for a short period of time.
Every 1/16 part of the burst-time, the router calculates the average
data rate of each class over the last burst-time seconds. If this
average data rate is less than burst-threshold, burst is enabled and
the actual data rate reaches burst-limit bps, otherwise the actual data
rate falls to max-limit or limit-at.
Initially, the average data rate in the last 16 seconds is 0 Kbps. Since the
average data rate is smaller than the burst-threshold, Then the burst can be
done.
Max-limit=256kbps, burst-time=16,
burst-threshold=128kbps, burst-limit=512kbps.
Burst Time is the period of time, in seconds, over which the average
data rate is calculated.
The Created Queue will show like this, with the assigning specific Bandwidth
for specific IP. You can Rearrange the Queue by dragging and drop.
After Creating some Queues, If we don’t want to allow any other IP’s into the
Internet apart from above IP’s/Queues. In that case We will have to create a
queue by assigning minimum value for the rest of IP’s. It should be in full IP
block.
Or, If want to assign 2Mbps bandwidth for the rest of IP’s, apart from above
QUEUES. In that case We will create a queue by 2Mbps for the rest of IP’s. It
should be in full block.
If we disable Mr. Liton’s Queue, The user’s traffic will automatically shift to
the Rest of IP’s Queue.
OR, You can also assign to Full IP Block with a specific Bandwidth. Which will
be shared among all the user’s within the IP block.
As we have already discussed about the Queue Priority. From here we can able
To set the Priority. Lowest value is the highest priority. By default its value is
8. Value 1 is the highest Priority and value 8 is the lowest Priority.
Prepared by: M.T.M. Monty ([email protected])
Parent-Child Queue
The queue list is now looks like above. Mr. Nasir and
Mr. Ratan are now child queue where is their parent
queue is Accounts Dept.
Rate = 1M
I am setting here whatever
the bandwidth is, doesn’t
matter. From each
connection it will get highest
1Mbps Download speed
accordingly.
Create PCQ
Prepared by: M.T.M. Monty ([email protected])
Per Connection Queue (PCQ)
Simple Queue Method
Rate = 1M
As download PCQ, The same
process is here. Set 1Mbps
upload speed for each
connection.
Create PCQ
Prepared by: M.T.M. Monty ([email protected])
Per Connection Queue (PCQ)
Simple Queue Method
Create QUEUE
Prepared by: M.T.M. Monty ([email protected])
Per Connection Queue (PCQ)
Simple Queue Method
Create QUEUE
Prepared by: M.T.M. Monty ([email protected])
Per Connection Queue (PCQ)
Simple Queue Method
Queue Tree: By Using this method bandwidth management like this, no need to
Define speed on each clients because bandwidth will be shared equal for all.
Simple Queue: Simple Queue works serially in ascending order. It means first
queue will get the highest priority and the last queue will get the lowest priority.
But Queue tree process all the queues at the same time.
NTP stands for Network Time Protocol, and it is an Internet protocol used
to synchronize the time of a computer client or server to another server or
reference time source. NTP is an Internet standard protocol originally
developed by Professor David L. Mills at the University of Delaware of
USA.
Day Queue will be automatically disable after running the Script. Means script is okay
Configuration is done. Now we can check by changing time. And the both
Queue will be on and off after a certain time which has been mentioned.
Prepared by: M.T.M. Monty ([email protected])
Burst Limit
Burst Calculation:
Burst Limit/ Burst Threshold * Burst Time = Client Burst
5120/1024*100= 20 Second
Therefore, Client Burst Will Be 20 Seconds
Prepared by: M.T.M. Monty ([email protected])
Thank You Very Much!!