Group: comp.os.linux.networking
From: pramodsharma08@gmail.com
Date: Saturday, April 12, 2008 1:54 AM
Subject: Re: Calculating subnet distance.

On Apr 12, 12:54=A0am, ibupro...@painkiller.example.tld (Moe Trin)
wrote:
> On Thu, 10 Apr 2008, in the Usenet newsgroup comp.os.linux.networking, in
> article >,
>
> pramodsharm...@gmail.com wrote:
>
> NOTE: Posting from groups.google.com (or some web-forums) dramatically
> reduces the chance of your post being seen. =A0Find a real news server.
>
> >I have a requirement to do in my application as below.
> >1. I have a list of Sites from where I can download.
> >2. Calcualte the nearest site from the host , which can be used to
> >download.
> >3. Nearest site can be calcualted on the basis of geogriphical
> >distance and bandwidth.
>
> The nearest site is RARELY based on geographical distance. It depends
> on who your upstream connects to, and who the upstream of the remote
> connects to. =A0A few seconds playing with the 'ping' command (yes,
> many sites block ping) and looking at the TTL of the responses will
> provide such a clue. =A0Try a ping to Mission College, verses one to
> yahoo, google, DeAnza or Bezerkeley.
>
> >Problems:
> >- I cannot use ICMP protocol as may be some sites have disabled ping.
> >- I cannot use raw socket over UDP as came to know that raw sockets on
> >windows will be over soon.
>
> windoze is not our problem. =A0I wouldn't recommend UDP as that may also
> be blocked, or routed with lower priority.
>
> >- I have to write multiplatform common code (windows , UNIX type).
>
> Look at the TTL of the returning packets. Generally speaking, most O/S
> use one of five initial TTLs on a TCP packets: 32 (rare, but some
> versions of windoze), 60 (some old IRIX and True64 boxes), 64, 128, or
> 255. Few places on the Internet are more than 30 hops away. =A0 Thus, if
> you receive a packet with a TTL of 46, it _PROBABLY_ came from a box
> 18 hops away with an initial TTL of 64.
>
> >Can anyone suggest me simple and effective method to determine the
> >nearest site ?
>
> You _are_ posting from a search engine - and it's not as if this idea
> is brand new. While TTL is universal, it's not the only thing in the
> packet headers that can be used. Looking at RFC1323 _might_ be worth
> the effort.
>
> =A0 =A0 =A0 =A0 Old guy



Yes , Ping is not an option for me and it's already rejected because
of the same reason.

So If I understand correctlly ,
- you are saying do socket with TCP instead of UDP ?
- Look at the TTL value of the returning packet . I am not an expert
of network programming . Will I be abe to look at the TTL value
writing a C program and opening a TCP socket and sending data ?

I am going through this RFC and trying to understand what you said and
how will I implement. Will update.

Thanks,
Pramod

Safety Articles | Usenet Groups | Usenet News | Bluegrass