It all depends on what is already known and how you define nearest neighbor. If the nearest neighbor server is the one that is the least number of TCP hops away from you and the list of servers available is known I would suggest you use this Traceroute implementation found here on CodeProject:
http://www.codeproject.com/KB/IP/tracert.aspx[
^].
With the help of this component you can determine how many hops another computer is away from you.
Best Regards,
Manfred