I have a Python process on one Linux machine server1 that receives and processes raw UDP packets. I want to have another Linux machine server2 capable of listening to the same UDP packets server1 is receiving.
Is there any Python solution capable of sniffing UDP packets addressed to the another (Linux) machine?
If you want more than one machine to process the same data, you’d be better off going to mulitcast (if you can control the sender and the infrastructure)
Else, http://sourceforge.net/projects/pylibpcap/ will enable packet capture via python. You will still have to configure the infrastructure to get the packets to the machine you want to sniff them. Either by iptables (if is a Linux machine) or a mirror port on the switch etc.
Edit:
If you want the processes on different machines (you think one machine can’t do it all) I would have a Linux machine receive the data, and using iptables, send it to multiple other machines. Maybe to a different socket on the same machine. This is possible because its UDP. If you want it all on the same machine, I would have a single process that spawns subprocesses with connected PIPEs, binds the UDP socket and copies the data to each subprocess’ pipe; maybe after some input validation