java straight forward network implementation