Optiver interview question

Design an algorithm to sort UDP packets