4

I am trying to make a script to test behavior of network switches and routers. The idea is to run a scapy-based script on a host with multiple network adapters connected to different router ports. The script will send probe packets on one port and watch how the probe packets get distributed to other ports.

In the past I used multiprocessing python package do to things in parallel with scapy. Behind the scene multiprocessing uses forked process and provides convenient interprocess communication primitives. I suppose I could do the same this time: create a bunch of subprocesses each sniffing on its own interface and pushing sniffed packets into a Queue to the parent process. As a bonus this approach will allow run sniffers on remote hosts too.

But since the last time I played with multiprocessing and scapy, I've discovered Automaton scapy module and would prefer to use it if possible. This module has receive_condition method decorator, but I can't figure out how to

  1. Set what interfaces Automaton module sniffs on
  2. Determine what interface packet was received at

Also it would be nice to know if the packet is ingress or egress, but I suspect it might be not possible.

Any suggestions?

abb
  • 141
  • 3

0 Answers0