Frame-based matching algorithms for input-queued switches