PERFECT UDP implementation