Network with intree data routing - Java program