Leader election and group management in vehicular ad hoc network