JAWUG

QOS

Proposal for QoS configuration on nodes

Overview


We need to come up with a standard which everyone will need to conform to. This standard will ensure the prioritisation of certain types of traffic over the network.
Unfortunately there is no way to centrally manage the traffic priorities over the network, so it will have to be done at every node edge. Doing this on the Backbone would cause too much load on the Highsite routers, and would decrease overall performance.
The Solution is to install the Queues on the Highsite routers, but rely on the users to mark their traffic correctly. So the Clients will have to set the ToS bits, and the Highsite will then use these ToS bit values to drop the packets into the correct queues.
Voice and Gaming traffic should be given the highest priority, seeing as they are the most delay sensitive applications on the network. Bulk transfers, such as FTP, should be given the lowest priority, and should be prepared to surrender their bandwidth to higher priority traffic.
We should ensure that all devices used to connect to the network are able to obey these policies. Mikrotik (Queues) and OpenWRT (tc) shouldn't be a problem. I'll include scripts here once we've agreed on what they should contain

Classifications

Pools

Pool Priority ToS Flag Bandwidth Lend Borrow
Voice 1 0x10 128kbit No Yes
Interactive 2 0x04 128kbit No Yes
Bulk 8 0x02 512kbit Yes Yes


Applications


Application Pool Protocol Port
VoIP SIP Voice UDP 5060
VoIP IAX Voice UDP 4569
VoIP IAX Voice TCP 4569
VoIP RTP Voice UDP <random>
SSH Interactive TCP 22
Telnet Interactive TCP 23
OSPF Interactive OSPF
Ping Interactive ICMP
IRC Interactive TCP 6667, 6668, 6697, 7324,7325
Battlefield 2 Interactive TCP 4711, 27901, 28910, 29900, 29901
Battlefield 2 Interactive UDP 1500-4999, 16567, 27900, 29900, 55123-55125
Quake II Interactive UDP 27910
Quake III Interactive UDP 27950,27952,27960,27965
Quake III Interactive TCP 27950,27952,27960,27965
Quake IV Interactive UDP 27650
Quake IV Interactive TCP 27650
Halflife Interactive UDP 6003,7002,27010,27015,27025
Halflife 2 Interactive TCP 27020-27039
Halflife 2 Interactive UDP 1200,27000-27015
FTP Bulk TCP 21
HTTP Bulk TCP 80

Packet Marking Implementation

Packets will need to be marked. This is how we'll tell other routers how to deal with certain packets.
We'll be using ToS values to mark the packets.

Value Description
0x10 Low Delay
0x08 Maximize Throughput
0x04 Maximize Reliability
0x02 Minimum Cost
0x00 Normal

Linux

We can use iptables to acheive this, using the TOS target. The TOS target works only in the mangle table.
eg: iptables -t mangle -A PREROUTING -p tcp --dport 22 -j TOS --set-tos 0x04

Mikrotik

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=22 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=23 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=5060 action=change-tos new-tos=min-delay comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=4569 action=change-tos new-tos=min-delay comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=4569 action=change-tos new-tos=min-delay comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=ospf action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=icmp action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=6667 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=6668 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=6697 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=7324 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=7325 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=4711 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=27901 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=28910 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=29900 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=29901 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=27900 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=29900 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=25123-25125 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=16567 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=27910 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=27950 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=27952 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=27960 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=27965 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=27950 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=27952 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=27960 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=27965 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=27650 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=udp dst-port=27650 action=change-tos new-tos=max-reliability comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=21 action=change-tos new-tos=min-cost comment="" disabled=no

/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=80 action=change-tos new-tos=min-cost comment="" disabled=no

/ ip firewall mangle add chain=prerouting action=change-tos new-tos=min-cost comment="" disabled=no

/ ip firewall mangle add chain=postrouting tos=max-reliability action=mark-connection new-connection-mark=0x04 passthrough=yes comment="" disabled=no

/ ip firewall mangle add chain=postrouting connection-mark=0x04 action=mark-packet new-packet-mark=0x04 passthrough=yes comment="" disabled=no

/ ip firewall mangle add chain=postrouting tos=min-delay action=mark-connection new-connection-mark=0x10 passthrough=yes comment="" disabled=no

add chain=postrouting connection-mark=0x10 action=mark-packet new-packet-mark=0x10 passthrough=yes comment="" disabled=no

/ ip firewall mangle add chain=postrouting tos=min-cost action=mark-connection new-connection-mark=0x02 passthrough=yes comment="" disabled=no

/ ip firewall mangle add chain=postrouting connection-mark=0x02 action=mark-packet new-packet-mark=0x02 passthrough=yes comment="" disabled=no

Shaping Implementation

Linux

Mikrotik

/ queue type add name="Priorities" kind=pfifo pfifo-limit=64

Note:You have to edit NAMEofRADIO to the name of your interface used on the Jawug link.

/ queue tree add name="Jawug" parent=NAMEofRADIO packet-mark="" limit-at=0 queue=Priorities priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no

/ queue tree add name="Interactive" parent=Jawug packet-mark=0x04 limit-at=128000 queue=Priorities priority=2 max-limit=512000 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no

/ queue tree add name="Voice" parent=Jawug packet-mark=0x10 limit-at=128000 queue=default priority=1 max-limit=512000 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no

/ queue tree add name="Bulk" parent=Jawug packet-mark=0x02 limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no

Subpages:
QOS