iperf and QOS/TOS Settings

iPerf is a tool for active measurements of the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, protocols, and buffers. For each test, it reports the bandwidth, loss, and other parameters.

QoS (Quality of Service) is a set of technologies used to manage network traffic in a cost-effective manner to enhance user experiences for various applications.

TOS (Type of Service) is a field in the IPv4 header which is used for Precedence, Delay, Throughput, and Reliability. It can be used to prioritize different types of traffic.

 

EXAMPLES

Cisco QOS Best Practices:

CISCO-BS-QOS

Using iperf with those values:
In each of these commands, replace 192.168.1.2 with the IP address of the machine you want to test against.

Also, ensure that iperf is running in server mode (iperf -s) on the destination machine.

TOS VALUE INTEGER:
1. Routing (CS6) – ToS value 0xC0

iperf -c 192.168.1.2 -S 192

2. Voice (EF) – ToS value 0xB8

iperf -c 192.168.1.2 -S 184

3. Interactive-Video (AF41) – ToS value 0x88

iperf -c 192.168.1.2 -S 136

4. Streaming-Video (CS4) – ToS value 0x80

iperf -c 192.168.1.2 -S 128

5. Mission-Critical (AF31) – ToS value 0x68

iperf -c 192.168.1.2 -S 104

6. Call-Signaling (CS3) – ToS value 0x60

iperf -c 192.168.1.2 -S 96

7. Transactional Data (AF21) – ToS value 0x48

iperf -c 192.168.1.2 -S 72

8. Network Management (CS2) – ToS value 0x40

iperf -c 192.168.1.2 -S 64

9. Bulk Data (AF11) – ToS value 0x28

iperf -c 192.168.1.2 -S 40

10. Scavenger (CS1) – ToS value 0x20

iperf -c 192.168.1.2 -S 32

11. Best Effort (0) – ToS value 0x00

iperf -c 192.168.1.2 -S 0

To set the Type of Service (ToS) value using iperf, you can use the `-S` flag. The value is an integer between 0 and 255. Below is a list of how you could test the different classes of service. Note that the values are hexadecimal, so they will need to be converted to decimal for use with iperf.

DSCP VALUE:
The `-q` parameter can be used in iperf3 to set the DSCP (Differentiated Services Code Point) value directly. You can express the value directly in decimal form without conversion. Here are the examples using `-q` with DSCP:

1. Routing (CS6) – DSCP value 48

iperf3 -c 192.168.1.2 -q 48

2. Voice (EF) – DSCP value 46

iperf3 -c 192.168.1.2 -q 46

3. Interactive-Video (AF41) – DSCP value 34

iperf3 -c 192.168.1.2 -q 34

4. Streaming-Video (CS4) – DSCP value 32

iperf3 -c 192.168.1.2 -q 32

5. Mission-Critical (AF31) – DSCP value 26

iperf3 -c 192.168.1.2 -q 26

6. Call-Signaling (CS3) – DSCP value 24

iperf3 -c 192.168.1.2 -q 24

7. Transactional Data (AF21) – DSCP value 18

iperf3 -c 192.168.1.2 -q 18

8. Network Management (CS2) – DSCP value 16

iperf3 -c 192.168.1.2 -q 16

9. Bulk Data (AF11) – DSCP value 10

iperf3 -c 192.168.1.2 -q 10

10. Scavenger (CS1) – DSCP value 8

iperf3 -c 192.168.1.2 -q 8

11. Best Effort (0) – DSCP value 0

iperf3 -c 192.168.1.2 -q 0

As wit the -S flag for ToS, setting the DSCP value with -q just marks packets with the specified value; it does not actually provide QoS. You need a network infrastructure configured to recognize and prioritize DSCP-marked traffic for QoS.