Get the Whitepaper called Writing a Quick Packet Sniffer with Python and Scapy.
You can download it from the following link: https://packetstormsecurity.com/files/download/158149/writing-sniffer.pdf
Source: https://packetstormsecurity.com/files/158149/Writing-A-Quick-Packet-Sniffer-With-Python-And-Scapy.html

