This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
TCP/IP does not support a way to query a network to find host addresses. Iterating through IP addresses, pinging to find active addresses is usually seen by network administrators as a threat, and is frowned upon. There are protocols built on top of TCP/IP,Jini, for example , which do make it possible to discover network resources.