Example below uses Python Scapy module to generate an ICMP Request with the TOS value 184 (DSCP 46/EF) which is useful for testing QOS.
from scapy.all import *
send(IP(dst=’192.168.1.200′,tos=184)/ICMP(id=1,length=256,seq=57))
Can run from Python 3 in Windows. Open two Python 3 instances and send an ICMP packet with tos=184.
In the second session use the following to see sniff and filter on the interface and check the TOS field of the ICMP response.
from scapy.all import *
sniff(iface=’eth0′, filter=’icmp’, prn=lambda x: x.show())
Type show_interfaces() to list the network adapter names and replace “eth0” with the description of the adapter you wish to sniff.
If you get an undefined literal error it maybe due to the way the above example is copied and pasted so pay attention to the use of double or single quotes.