Implementing routing proto : Java