Analysis and Design of Handoff Algorithms