simulate dhcp function