36. Traffic Control
ROX™ v2.2 User Guide 391 RuggedBackbone™ RX5000
assigned to the packet, and if no class matches the mark, then the packet is assigned to the default
class.
Marks are assigned to packets either by the TC Rules based on any of a number of parameters, such
as IP address, port number, protocol, packet length, and so on.
36.1.2.1. Traffic Control Example
The goal of this example is to operate T1 port at 1.5Mbit/s and ensure that UDP source port 20000
traffic gets at least half the bandwidth, while ICMP and TCP ACK packets should have high priority,
HTTP traffic gets at least 20% and at most 50%, and all other traffic should get what is left over but
only up to 50% of the bandwidth.
The three TC menus would be configured as follows:
36.1.2.1.1. TC Interfaces
Interface Inbound bandwidth Outbound bandwidth
te1-3-1c24ppp 1500kbit 1500kbit
Table 36.1. TC Interfaces
36.1.2.1.2. TC Classes
Interface Mark Minimum Maximum Priority Options
te1-3-1c24ppp 1 full/2 full 0
te1-3-1c24ppp 2 28bps full 1 tcp-ack
te1-3-1c24ppp 3 full/5 full*5/10 2
te1-3-1c24ppp 4 28bps full*5/10 3 default
Table 36.2. TC Classes
36.1.2.1.3. TC Rules
Mark Source Destination Protocol Source Port Dest Port Test Length TOS
2 Any Any ICMP Any Any Any Any Any
RESTORE Any Any Any Any Any 0 Any Any
CONTINUE Any Any Any Any Any !0 Any Any
1 Any Any UDP 20000 Any Any Any Any
3 Any Any TCP Any 80 Any Any Any
4 Any Any Any Any Any 0 Any Any
SAVE Any Any Any Any Any !0 Any Any
Table 36.3. TC Rules
The rules first check non connection-based protocol rules (ICMP in this case) in order to assign a mark.
For any packet that is still not marked, we attempt to restore a saved mark for the connection. If at this
point the packet has a mark set, we stop checking rules (CONTINUE) since it is either ICMP or a packet
from an existing connection which we have already assigned a mark. If still no mark is assigned, it must
be a new connection so we process the packet through all the remaining rules to determine the mark
it should receive. At the end, we save the new mark to the connection so that any further packets for
the connection do not have to go through all the rules again, in order to save processing resources. We
mark all packets with no other matching rule to 4 since that represents the default class (as defined in
TC Classes). This allows explicit traffic control of even unspecified network connections.