Now you say ... sorry ...

I dont think it can be done the way you want it, unless all the traffic is somehow routed through your application, and your application analyses all the incoming packets from each machine.

Good luck with it anyway...