code to send and receive UDP packets.