Add the UDP handshake and packet re-arrange code