Configuring Mikrotik Rate Limits


#1

When editing a service plan you have the rate limit field (also in the Quota Control section). The rate-limit field accepts the Mikrotik notation that will be explained below.

This is the format that Mikrotik uses to specify rate limits:

rx-rate[/tx-rate] [rx-burst-rate[/tx-burst-rate] [rx-burst-threshold[/tx-burst-threshold] [rx-burst-time[/tx-burst-time] [priority] [rx-rate-min[/tx-rate-min]]]]

Description

From the router’s LAN interface, when the router receives data (rx) it means the client is uploading. When the router transfers data (tx), it means the client is downloading. In other terms, rx-rate/tx-rate means upload/download respectively.

Knowing that, the structure above translates to:

upload/download
burst upload/burst download
burst threshold upload/burst threshold download
burst time upload/burst time download
priority
min upload/min download

All rates should be numbers followed by an optional ‘k’ (thousands) or ‘M’ (millions).
For advanced shaping techniques, you may check how to configure Mikrotik Burst rate.

Some Ratelimit Examples

Example 1 : 512k
upload=512k, download=512k (no bursts)

Example 2 : 256k/512k
upload=256k, download=512k (no bursts)

Example 3 : 256k 512k
upload=download=256k, burst upload=burst download=512k, burst-threshold upload=burst threshold download=256k, burst time=1second

Example 4 : 256k 512k 192k
upload=download=256k, burst upload=burst download=512k, burst-threshold upload=burst threshold download=192k, burst time=1second

Example 5 : 256k/256k 512k/512k 192k/192k 8/8
upload=download=256k, burst upload=burst download=512k, burst-threshold upload=burst threshold download=192k, burst time upload=burst time download=8s

More details

If both burst threshold upload (rx-burst-threshold) and burst threshold download (tx-burst-threshold) are not specified but burst upload/burst download is specified, upload (rx-rate) and download (tx-rate) is used as burst thresholds, see Example 3.

If download (tx-rate) is not specified, it is counted the same as upload (rx-rate). The same goes for burst download (tx-burst-rate), burst threshold download (tx-burst-threshold) and burst time download (tx-burst-time), see Example 4.

If min upload (rx-rate-min) and min download (tx-rate-min) are not specified, upload (rx-rate) and download (tx-rate) values are used. The min upload (rx-rate-min) and min download (tx-rate-min) values can not exceed upload(rx-rate) and download(tx-rate) values.

If both burst time upload (rx-burst-time) and burst time download (tx-burst-time) are not specified, 1 second is used by default.

Priority takes a value between 1 and 8 where 1 is the highest priority and 8 is the lowest.