Safeguarding ad hoc networks with a self-organized membership control system