On Fri, 11 Apr 2008, in the Usenet newsgroup comp.os.linux.networking, in
article <045cce39-79d3-4557-8174-(E-Mail Removed)>,
(E-Mail Removed) wrote:
NOTE: Posting from groups.google.com (or some web-forums) dramatically
reduces the chance of your post being seen. Find a real news server.
>Yes , Ping is not an option for me and it's already rejected because
>of the same reason.
Still, using ping will demonstrate the principle of looking at TTLs to
determine distance.
>So If I understand correctlly ,
>- you are saying do socket with TCP instead of UDP ?
I'm suggesting TCP rather than UDP, because when you reach a decision,
you will be using TCP to do the data transfer, not UDP. Therefore, what
happens to UDP (or even ICMP) is not of relevance to your eventual data
transfer.
>- 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 ?
TTL is in the IP header, so you will need to be able to view that header
by what-ever method you use. Plenty of other applications have done this,
such as ping, tcpdump, traceroute, hping2 (and hping3), mtr, and so on,
so there is plenty of code to use as a reference.
>I am going through this RFC and trying to understand what you said and
>how will I implement. Will update.
You may want to look at the Usenet newsgroup 'comp.protocols.tcp-ip'
where it's probably closer to "on target".
comp.protocols.tcp-ip TCP and IP network protocols.
RFC1323 discusses using timestamps, which can give you absolute time
of transmission. TTLs are normally decremented at each router, giving
you the number of hops to the destination.(RFC1812 section 5.2.1). A
problem with this is that there is nothing that guarantees the the
route taken from "you" to some remote host will be the same as the
route taken from the remote host back to "you". Routing is NOT
symmetrical.
Old guy