Network topologies using Java socket