implements packet sniffing