CORE: A collaborative reputation mechanism to enforce node cooperation in mobile adhoc networks