Basic traffic shaping based on layer-7 protocols

If we want to ensure decent internet browsing for more users using the same internet connection, but we don't want to disable any protocols (such as p2p), just to make the priority of http higher, we can use these rules.

Packets are marked at the public side in /ip firewall mangle. Packets are marked based on layer-7 signatures and then queued.

OPTIONAL:
In this example we do not catch the "all remaining" packets so packets that are not caught here will get higher priority. If we want to catch them and put them in our queue rules we need to add these lines:

NOTE 1: The 'imesh' Layer7 matcher is reported to crash the Linux kernel? and some versions of RouterOS so you might simply not use that one, since the application is old/not popular anyway.

NOTE 2: According to official manual (Queue,HTB), we must have limit-at= set to something and max-limit= set properly, for each child queue, to have priorities. In this example these settings are not shown.

NOTE 3: Doing this may get the TCP packets out-of-order. Although reordering is denied by MT staff, putting different parts of a TCP connection in different queues may be bad for TCP performance at least.

Experiment with the settings until you find what is best for you, and please report the successes in the forum. We would love to see them!