Knowledgebase
Mikrotik - QoS
Posted by Tech Support on 15 April 2016 04:46 PM

 

To set QoS or Quality of Service successfully, we first want to know the rates that the internet circuit is stable at.

 

- What does that mean?

 

When running a capacity speed test (such as speedtest.net), the results will reflect the speed of the circuit, however the circuit will not be stable at those speeds.

To find the stable speeds of the circuit, we recommend using an application speed test.

 

For the purposes of this knowledge article, we will assume that the application speed test results for the circuit, which we will be using for service, has 1.5 MB down and 1.5 MB up (this is just an example, results will differ for each internet circuit).

 

For this example, we will be using five phones (we allocate 100 KB per phone) which means that we will want to reserve 500 KB for all phones.

The remaining bandwidth, which is 1000 KB or 1MB will be used for data. 

Lastly, voice will be given the highest priority and data the lowest priority.

 

  • 500k for voice with highest priority
  • 1M for data with lowest priority

 

- But, how does the Mikrotik know the difference between voice and data traffic? 

 

Managle rules will be added that will mark the connection to and from our RTP proxy (192.92.8.0/27) and then mark those packets.

 


  

Marking RTP Connection and Packets

  1. From Winbox, go to IP
  2. Go to Firewall

  1. Click on Mangle tab
  2. Click on Blue Plus Sign to add a Mangle rule

  1. For Chain select prerouting
  2. Enter in the source address (Src. Address) of 192.92.8.0/27 
  3. Click on the Action tab

  1. For Action, select mark connection
  2. For New Connection Mark, enter VoIP
  3. Ensure Passthrough option is checked
  4. Enter a Comment
  5. Enter in "From VoIP Addr" (this is to identify the rule)
  6. Click OK to close the Comment box
  7. Click OK to complete the rule

  1. Click the Blue Plus Sign to add another rule
  2. For Chain, select prerouting
  3. Enter in the Destination Address (Dst. Address) of 192.92.8.0/27
  4. Click on the Action tab

  1. For Action select mark connection
  2. For New Connection Mark enter VoIP
  3. Ensure Passthrough is checked
  4. Enter a Comment
  5. In the comment box enter in "To VoIP Addr" (this is to identify the rule)
  6. Click OK to close the Comment box
  7. Click OK to complete the rule

  1. Click the Blue Plus Sign to add another rule
  2. For Chain select prerouting
  3. For the Connection Mark select VoIP
  4. Click on the Action tab

  1. For Action select mark packet
  2. For New Packet Mark enter VoIP
  3. Ensure Passthrough is not checked
  4. Enter a Comment
  5. In the comment box enter in "Mark VoIP Packets" (this is to identify the rule)
  6. Click OK to close the Comment box
  7. Click OK to complete the rule

 

 The Mangle Rules are now created.

Bandidth and Prioritizing Traffic

  1. Go to Queues

  1. Click on the Blue Plus Sign to add a new Simple Queue
  2. For Name enter in VoIP Traffic
  3. For Target enter in the subnet being used, for this example we kept the default subnet of 192.168.88.0/24
  4. For Max Limit enter in the bandwidth being allocated for Voice (as per our example we are using 5 phones and allocating 100k per phone)
    • 500k for Upload
    • 500k for Download
  5. Go to Advanced tab

  1. For Marks select VoIP (using dropdown menu)
  2. For Priority enter 1 for Target Upload and Target Download (1 is the hightest priority)
  3. Enter a Comment
  4. In the comment box enter in "Configure Up/Dn speeds in this rule by multipling the amount of phones x 100k" (this is to identify the rule)
  5. Click OK to close the comment box
  6. Click OK

  1. Click on the Blue Plus Sign to add a new Simple Queue
  2. For Name enter in All Other Traffic
  3. For Target enter in the subnet being used, for this example we kept the default subnet of 192.168.88.0/24
  4. For Max Limit enter in the bandwidth being allocated for Data (this is the difference from 1.5M - 500K = 1000k or 1MB)
    • 1M for Upload
    • 1M for Download
  5. Go to Advanced tab

  1. For Marks select no-mark (using dropdown menu)
  2. For Priority enter 8 for Target Upload and Target Download (8 is the lowest priority)
  3. Enter a Comment
  4. In the comment box enter in "Configure this rule with your Up/Dn speeds minus the bandwith you put for the VoIP rules." (this is to identify the rule)
  5. Click OK to close the comment box
  6. Click OK

The Simple Queues are now created (when adding down, 500k + 1M = 1.5M, this needs to equal the application speed test results).

 

Active Call

If you open the VoIP Traffic Simple Queue by double clicking the queue and go to the Traffic tab during an active call, the queue will present the bandwidth being used for the call.

 

(3 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).