Scapy QOS Ping

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 *


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:

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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s