switch for protocol