Linux - prioritising interactive traffic
Welcome to the tutorial guide. The tutorial will provide a user with guidance and instructions on prioritising interactive traffic.
If there is a lot of data coming down or up and user is trying to carry out some through telnet or ssh, this may not go too well. Other packets are blocking the keystrokes. Linux can provide a user with an opportunity so that the user can sneak past the bulk traffic with the interactive packet.
As before, we need to handle traffic going both ways. Evidently, this works best if there are Linux boxes on both ends of the link, although other UNIX’s are able to do this.
The standard pfifo_fast scheduler has 3 different ‘bands’. Traffic in band 0 is transmitted first, after which traffic in band 1 and 2 gets considered. It is vital that our interactive traffic be in band 0!
The most common use is to set telnet & ftp control connections to “Minimum Delay” and FTP data to “Maximum Throughput”. This would be done as follows, on the upstream router:
# iptables -A PREROUTING -t mangle -p tcp –sport telnet \
-j TOS –set-tos Minimize-Delay
# iptables -A PREROUTING -t mangle -p tcp –sport ftp \
-j TOS –set-tos Minimize-Delay
# iptables -A PREROUTING -t mangle -p tcp –sport ftp-data \
-j TOS –set-tos Maximize-Throughput
Now, this only works for data going from the telnet foreign host to the local computer. The other way around appears to be done i.e., telnet, ssh & friends all set the TOS field on outgoing packets automatically.
If a users application does not do this, then a user should do this with netfilter. On the local box:
# iptables -A OUTPUT -t mangle -p tcp –dport telnet \
-j TOS –set-tos Minimize-Delay
# iptables -A OUTPUT -t mangle -p tcp –dport ftp \
-j TOS –set-tos Minimize-Delay
# iptables -A OUTPUT -t mangle -p tcp –dport ftp-data \
-j TOS –set-tos Maximize-Throughput
If you followed this tutorial guide then you would have learnt about prioritising interactive traffic.













