Comparison of proactive and reactive resource and service discovery in mobile ad hoc networks