write a function to allocate a range of ports for each node
write a function to allocate a range of ports for each node