helper dhcp function