Introduction
Efficient network traffic management is essential for optimal network performance, especially in scenarios with high-traffic connections. By prioritizing critical traffic, you can ensure that important applications and services receive the bandwidth they need. This article will guide you through the process of implementing a traffic prioritization strategy using a powerful script known as Connection-Rate on your MikroTik router.
Understanding Connection-Rate
The Connection-Rate script is a versatile tool that allows you to identify and manage high-bandwidth connections. By analyzing various parameters such as connection rate and byte usage, the script can accurately classify traffic into different categories. This classification enables you to prioritize specific types of traffic, ensuring that critical applications receive the bandwidth they require.
Implementing Connection-Rate
To implement Connection-Rate, follow these steps:
- Configure Firewall Mangle Rules:
- Create rules to mark high-bandwidth connections as “heavy_traffic” and low-bandwidth connections as “other_traffic.”
- Adjust the connection-rate and connection-bytes parameters to match your specific network requirements.
- Create Queue Tree:
- Set up a queue tree to shape traffic based on the connection marks.
- Assign lower priority to “heavy_traffic” and higher priority to “other_traffic.”
- Adjust the maximum limits and limit-at values to allocate bandwidth appropriately.
Example Configuration
Here’s an example configuration to illustrate the process:
/ip firewall mangle
add chain=forward action=mark-connection connection-mark=!heavy_traffic_conn \
new-connection-mark=all_conn
add chain=forward action=mark-connection connection-bytes=500000-0 \
connection-mark=all_conn connection-rate=200k-100M \
new-connection-mark=heavy_traffic_conn protocol=tcp
add chain=forward action=mark-connection connection-bytes=500000-0 \
connection-mark=all_conn connection-rate=200k-100M \
new-connection-mark=heavy_traffic_conn protocol=udp
add chain=forward action=mark-packet connection-mark=heavy_traffic_conn \
new-packet-mark=heavy_traffic passthrough=no
add chain=forward action=mark-packet connection-mark=all_conn \
new-packet-mark=other_traffic passthrough=no
/queue tree
add name=upload parent=ether1 max-limit=10M
add name=other_upload parent=upload limit-at=6M max-limit=10M \
packet-mark=other_traffic priority=1
add name=heavy_upload parent=upload limit-at=3M max-limit=10M \
packet-mark=heavy_traffic priority=8
add name=download parent=bridgeLocal max-limit=10M
add name=other_download parent=download limit-at=6M max-limit=10M \
packet-mark=other_traffic priority=1
add name=heavy_download parent=download limit-at=3M max-limit=10M \
packet-mark=heavy_traffic priority=8
Important Considerations:
- Adjust Parameters: Fine-tune the connection-rate and connection-bytes thresholds to match your specific network needs and traffic patterns.
- Verify Parent: Ensure that the parent queue in the queue tree is correct. This typically depends on your network configuration, such as the interface used for your internet connection.
- Monitor and Optimize: Continuously monitor your network traffic and adjust the configuration as needed to maintain optimal performance.
By effectively implementing Connection-Rate, you can significantly improve your network’s overall performance and user experience, especially in scenarios with heavy traffic loads.
.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you. https://www.binance.com/de-CH/join?ref=53551167
Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://www.binance.com/el/join?ref=GJY4VW8W
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me? https://www.binance.info/vi/join?ref=B4EPR6J0
Your article helped me a lot, is there any more related content? Thanks! https://accounts.binance.com/sl/register-person?ref=V3MG69RO