you might want to look into tools like SNORT:
[link|http://www.snort.org/|http://www.snort.org/]

They might help you.