copied basic udp functionalities