This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:router:mikrotik_qos [2014/08/20 08:39] gcooper |
networking:router:mikrotik_qos [2019/03/14 07:57] (current) gcooper |
||
---|---|---|---|
Line 2: | Line 2: | ||
See also **[[https:// | See also **[[https:// | ||
+ | |||
+ | https:// | ||
**Background**: | **Background**: | ||
+ | |||
+ | **Background**: | ||
+ | |||
+ | **Marking Connections**: | ||
+ | |||
+ | **Bridged**: | ||
**Snom Wiki**: http:// | **Snom Wiki**: http:// | ||
**Service Provider**: http:// | **Service Provider**: http:// | ||
+ | |||
+ | **Script**: http:// | ||
**Enterprise QoS – A consistent QoS strategy**: http:// | **Enterprise QoS – A consistent QoS strategy**: http:// | ||
Line 31: | Line 41: | ||
^ ^Voice Bearer | ^ ^Voice Bearer | ||
|DSCP |46 (EF) |24 (CS3) |34 (AF41) | |DSCP |46 (EF) |24 (CS3) |34 (AF41) | ||
- | |COS |5 | + | |COS |5 |
==== More Complete Chart ==== | ==== More Complete Chart ==== | ||
{{ : | {{ : | ||
+ | |||
+ | ===== Throttle Traffic ===== | ||
+ | |||
+ | You can use Simple Queues to throttle all traffic to or from an IP address. | ||
+ | |||
+ | * Throttle Printer Traffic | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ===== Lite Script ===== | ||
+ | |||
+ | FIXME Untested | ||
+ | |||
+ | :!: This script may be appropriate in a CPE router with an IP PBX behind it. | ||
+ | |||
+ | http:// | ||
+ | |||
+ | * This is a very simple script with just two levels of priority | ||
+ | * It prioritizes VoIP and that's it | ||
+ | * Internet service in this example is 5M down and 1M up | ||
+ | * Max-limit is the maximum amount that marked traffic may reach | ||
+ | * This is necessary for the algorithms to function and must not be 0 | ||
+ | * Choose a value 80%-90% of your tested speed to prevent the ISP's equipment from [[http:// | ||
+ | * Replace '' | ||
+ | |||
+ | < | ||
+ | # Qos Script Lite v1.0 | ||
+ | # September 7, 2013 | ||
+ | # Compatible with RouterOS 6.3 | ||
+ | # Rename ether-WAN and ether-LAN to match your environment | ||
+ | |||
+ | # Mark all UDP traffic for an IP-PBX. | ||
+ | /ip firewall mangle | ||
+ | add chain=forward action=mark-connection protocol=udp | ||
+ | add chain=forward action=mark-packet | ||
+ | add chain=forward action=mark-connection protocol=udp | ||
+ | add chain=forward action=mark-packet | ||
+ | |||
+ | # Mark everything else. | ||
+ | add chain=forward action=mark-connection connection-mark=no-mark | ||
+ | add chain=forward action=mark-packet | ||
+ | |||
+ | # Create two queue trees set to 90% of ISP Internet service. | ||
+ | /queue tree | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | |||
+ | # Add our marked connections as children of queue so priority works. | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | </ | ||
+ | |||
+ | ===== More Flexible Script ===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | FIXME Untested | ||
+ | |||
+ | < | ||
+ | # Date: November 11, 2013 | ||
+ | # Version: 1.2 | ||
+ | # Tested with RouterOS 6.6 | ||
+ | # Rename ether-WAN and ether-LAN to match your environment | ||
+ | |||
+ | |||
+ | |||
+ | ############################################################################### | ||
+ | # Mangle | ||
+ | # | ||
+ | # Using prerouting/ | ||
+ | # | ||
+ | /ip firewall mangle | ||
+ | ############################################################################### | ||
+ | |||
+ | # DNS requests. Mark in two places because DNS is sent out by the router (itself) too. | ||
+ | add chain=prerouting | ||
+ | add chain=prerouting | ||
+ | add chain=postrouting action=mark-connection protocol=udp | ||
+ | add chain=postrouting action=mark-packet | ||
+ | |||
+ | # Mark all VoIP traffic. We've set all our equiptment to use SIP 5060,5061 and RTP 10000-20000. | ||
+ | add chain=prerouting | ||
+ | add chain=prerouting | ||
+ | |||
+ | # Mark all UDP traffic. Mark different UDP streams if you want more granularity. | ||
+ | add chain=prerouting | ||
+ | add chain=prerouting | ||
+ | |||
+ | # Ping replies. Mark in two places because ICMP is sent out by the router (itself) too. | ||
+ | add chain=prerouting | ||
+ | add chain=prerouting | ||
+ | add chain=postrouting action=mark-connection protocol=icmp | ||
+ | add chain=postrouting action=mark-packet | ||
+ | |||
+ | # ACK traffic. Based on viewtopic.php? | ||
+ | add chain=postrouting action=mark-packet passthrough=no protocol=tcp tcp-flags=ack packet-size=0-123 new-packet-mark=" | ||
+ | add chain=prerouting | ||
+ | |||
+ | # Mark all new HTTP(s) connections with " | ||
+ | # If the current mark of " | ||
+ | add chain=prerouting | ||
+ | add chain=prerouting | ||
+ | add chain=prerouting | ||
+ | add chain=prerouting | ||
+ | |||
+ | # Mark everything else that has no mark applied. | ||
+ | add chain=prerouting action=mark-connection | ||
+ | add chain=prerouting action=mark-packet | ||
+ | |||
+ | |||
+ | |||
+ | ############################################################################### | ||
+ | # HTB Queue Tree a unidirectional queue | ||
+ | # | ||
+ | # Based on 90% of 1Mup/5Mdown Internet service. | ||
+ | # | ||
+ | # Notes: | ||
+ | # priority means 'drop packets' | ||
+ | # When limit-at=0 | ||
+ | # When limit-at=123 priority starts when limit-at is reached. | ||
+ | # | ||
+ | # The priority option applies to children not parents. Parent is for setting | ||
+ | # overall limits. Therefore use limit-at and max-limit on the children if | ||
+ | # you want more granularity. | ||
+ | # | ||
+ | # max-limit must always be set or priority will not happen. | ||
+ | # | ||
+ | # Tips for TCP (not VoIP) SOHO network: | ||
+ | # limit-at | ||
+ | # max-limit = Total bandwidth / min hosts | ||
+ | # | ||
+ | /queue tree | ||
+ | ############################################################################### | ||
+ | |||
+ | # The secret to ensuring VoIP quality (or any UDP traffic) is to put it into | ||
+ | # a queue that will never be full and thus never prioritize (drop) packets. | ||
+ | add name=" | ||
+ | add name=" | ||
+ | |||
+ | # Next, create a queue for high priority traffic. | ||
+ | add name=" | ||
+ | add name=" | ||
+ | |||
+ | # Finally, create a queues for traffic that normally exceeds levels. | ||
+ | add name=" | ||
+ | add name=" | ||
+ | |||
+ | # A | ||
+ | add name=" | ||
+ | add name=" | ||
+ | # B | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | # C | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | add name=" | ||
+ | </ |