0% found this document useful (0 votes)
54 views1 page

Mikrotik Mangle Rules Overview

The document defines a queue tree with different queues for downloading, uploading, browsing, streaming, and other traffic. It also defines firewall rules to mark traffic flowing from an internal network for machine learning, browsing, streaming, and other purposes for subsequent traffic shaping based on the packet marks.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views1 page

Mikrotik Mangle Rules Overview

The document defines a queue tree with different queues for downloading, uploading, browsing, streaming, and other traffic. It also defines firewall rules to mark traffic flowing from an internal network for machine learning, browsing, streaming, and other purposes for subsequent traffic shaping based on the packet marks.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

/queue tree

add limit-at=256k max-limit=50M name=Download parent=ether3_HS queue=\


pcq-download-default
add limit-at=256k max-limit=50M name=Upload parent=ether1_WAN queue=\
pcq-upload-default
add limit-at=128k max-limit=30M name=browsing-dl packet-mark=browsing parent=\
Download queue=pcq-download-default
add limit-at=128k max-limit=20M name=streaming-dl packet-mark=streaming \
parent=Download queue=pcq-download-default
add limit-at=128k max-limit=10M name=others-dl packet-mark=others parent=\
Download priority=5 queue=pcq-download-default
add limit-at=128k max-limit=30M name=browsing-up packet-mark=browsing parent=\
Upload queue=pcq-upload-default
add limit-at=128k max-limit=30M name=streaming-up packet-mark=streaming \
parent=Upload queue=pcq-upload-default
add limit-at=128k max-limit=10M name=others-up packet-mark=others parent=\
Upload priority=5 queue=pcq-upload-default
add limit-at=128k max-limit=10M name=ML-dl packet-mark=ml parent=Download \
priority=1 queue=pcq-download-default
add limit-at=128k max-limit=10M name=ML-up packet-mark=ml parent=Upload \
priority=1 queue=pcq-upload-default

/ip firewall mangle


add action=accept chain=forward dst-port=53 protocol=udp
add action=accept chain=forward protocol=icmp
add action=mark-connection chain=forward comment=ml dst-port=\
5000-5180,5500-5680,9443,30020-30220 new-connection-mark=ml passthrough=\
yes protocol=tcp src-address=[Link]/23
add action=mark-connection chain=forward dst-port=\
5000-5180,5500-5680,9992,30020-30220 new-connection-mark=ml passthrough=\
yes protocol=udp src-address=[Link]/23
add action=mark-packet chain=forward connection-mark=ml new-packet-mark=ml \
passthrough=no
add action=mark-connection chain=forward comment=browsing dst-port=\
80,8080,443 new-connection-mark=browsing passthrough=yes protocol=tcp \
src-address=[Link]/23
add action=mark-packet chain=forward connection-mark=browsing \
new-packet-mark=browsing passthrough=no
add action=mark-connection chain=forward comment=streaming dst-port=\
80,8080,443 new-connection-mark=streaming passthrough=yes protocol=udp \
src-address=[Link]/23
add action=mark-packet chain=forward connection-mark=streaming \
new-packet-mark=streaming passthrough=no
add action=mark-connection chain=forward comment=others new-connection-mark=\
others passthrough=yes src-address=[Link]/23
add action=mark-packet chain=forward connection-mark=others new-packet-mark=\
others passthrough=no

Common questions

Powered by AI

Packet marks like 'browsing', 'streaming', and 'ml' are used to identify and categorize network traffic based on the type of service or application. This categorization allows for differentiated bandwidth allocation, where specific limits and priorities can be set for each category. For instance, 'browsing' might be allocated less bandwidth compared to 'streaming', which typically requires higher throughput to avoid buffering. Implementing these marks enables effective management and optimization of available bandwidth, ensuring that critical applications like 'ml' (machine learning) receive necessary resources swiftly, given their typically higher priority needs .

Static bandwidth limits can lead to suboptimal use of network resources. They do not adapt to changing network conditions or varying user demands, which can result in underutilization during low traffic periods or congestion during peak usage. This rigidity can hinder the flexibility required for dynamic applications such as real-time streaming or data-intensive machine learning processes, potentially leading to performance bottlenecks and dissatisfaction among users due to inadequate bandwidth when demands exceed the predefined limits .

Prioritizing UDP traffic is crucial for time-sensitive applications because UDP, being connectionless, allows for faster data transmission due to its lower overhead compared to TCP. By prioritizing UDP traffic, the network ensures that these applications—such as VoIP or streaming services, which require rapid packet delivery without the latency imposed by connection setup—can operate smoothly and efficiently, enhancing user experience by reducing lag and minimizing delays associated with packet transmissions .

Prioritizing machine learning traffic ensures rapid processing and reduced latency for data-intensive computations, which is crucial for timely analytics and decision-making. However, this prioritization could lead to reduced bandwidth availability for other operations, particularly if machine learning tasks are resource-intensive. While this can enhance machine learning application performance, it may degrade the service quality of other applications, especially real-time services like video conferencing or critical communications, unless sufficing bandwidth is allocated or dynamic bandwidth adaptation strategies are employed .

Setting priority levels in queue management directly influences the order of handling network traffic. Traffic marked with higher priority, such as 'ML-dl' and 'ML-up', is processed before lower-priority traffic like 'others-dl' and 'others-up'. This ensures that crucial services or applications receive bandwidth first, minimizing delays for time-sensitive data. Lower-priority traffic may experience slower transmission rates or higher latency, as it is queued and processed after higher-priority tasks are fulfilled .

Network traffic marking can assist in regulatory compliance by enabling the precise control and monitoring of data flows. By categorizing traffic based on its source, destination, and type, organizations can enforce policies that ensure sensitive data is moved within allowed channels, minimizing the risk of data breaches or unauthorized access. Furthermore, consistent monitoring and logging of these traffic marks facilitate auditing processes, providing evidence of compliance with data handling regulations like GDPR or HIPAA, which mandate controlled data access and transmission logs .

The 'pcq-download-default' and 'pcq-upload-default' queues are configured to evenly distribute available bandwidth among multiple connections, preventing any single connection from monopolizing network resources. They employ Per Connection Queuing (PCQ) to dynamically manage bandwidth allocation by establishing limits and maximum thresholds for different connection marks such as 'browsing', 'streaming', and 'ml'. This method ensures fairness and efficiency, enabling smoother network performance by preventing congestion and maintaining equitable service quality across different types of traffic .

The 'mark-packet' and 'mark-connection' actions serve dual roles: managing network performance and enhancing security. By marking packets and connections, the system can apply tailored policies for bandwidth allocation, thus optimizing network performance based on traffic type or priority. Additionally, these actions can help monitor and regulate traffic flow, denying or throttling connections that may pose security risks by deviating from expected patterns. Such an approach balances performance with security, ensuring efficient resource usage while maintaining protective measures against unauthorized or harmful activity .

Marking connections based on port numbers allows administrators to apply specific rules for different applications. For instance, certain ports are typically associated with browsing (ports 80, 8080, 443) and streaming services, whereas other designated ports (5000-5180, 5500-5680, etc.) may be used by machine learning tasks. By identifying packets through these port numbers and assigning them appropriate marks, the system can manage application-specific traffic efficiently, ensuring that each type of traffic receives appropriate bandwidth and priority based on its operational requirements and importance .

Src-address specifications in traffic shaping rules define the source addresses for which specific routing, prioritization, and bandwidth management policies apply. By using these specifications, network administrators can target policies to particular subnets or IP address ranges, allowing for customized traffic management based on the origin of the data. This is particularly beneficial in multi-tenant environments where different tenant networks may require tailored traffic handling to meet unique bandwidth and security requirements, ensuring equitable service quality and compliance with organizational policies .

You might also like