Generate DSCP marked pings
Today it was useful to confirm a switch was passing DSCP marked packets as expected and handling 'ef' marked packets.
To do this on a cisco switch we can use the extended ping feature and set the Type of Service (ToS) to a decimal value that is equivalent to the DSCP value wanted. The table below shows the ToS value to enter to get the DSCP marking needed.
| TOS (decimal) | DSCP Class |
| 0 | be |
| 32 | cs1 |
| 40 | af11 |
| 48 | af12 |
| 56 | af13 |
| 64 | cs2 |
| 72 | af21 |
| 80 | af22 |
| 88 | af23 |
| 96 | cs3 |
| 104 | af31 |
| 112 | af32 |
| 120 | af33 |
| 128 | cs4 |
| 136 | af41 |
| 144 | af42 |
| 152 | af43 |
| 160 | cs5 |
| 184 | ef |
| 192 | cs6 |
| 224 | - |
On a Cisco switch extended ping example below:
Moons-Router#ping
Protocol [ip]:
Target IP address: 8.8.8.8
Repeat count [5]: 100
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]: 184 <---------THIS SETS THE QOS MARKING
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]: rotate
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
Packet has rotating data pattern starting with 0x0000
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 60/63/64 ms
Nice hacky way to generate ef marked traffic for testing :)
More info about DSCP values in relation to other values can be found [HERE].
m00nie