read ports and ip from input