Sunday, April 3, 2011

Find the closest server in the network

Given a list of servers & a list of clients, how to find a server that is closest to a particular host using "traceroute"? The program should be in java.

From stackoverflow
  • What do you define as "closest"? Lots of hops in a traceroute do not indicate closeness just devices the packet routes through. Ping is also not too great as it just shows latency.
    What I would suggest is if you are on the web use BGP to work out closeness. If you are on a lan or you get a tie with BGP then fall back to Traceroute.

    Those links go to Java implementations of BGP and traceroute.

  • I don't think it can be done using only the standard Java API, since it does not support the ICMP protocol sufficiently. You may be able to do it using Jpcap.

0 comments:

Post a Comment