get_ip function and usage