Enhanced intrusion detection systems in ad hoc networks using a grid based agnostic middleware