开发者

tool to find out distance in terms of no. of hops in unix

开发者 https://www.devze.com 2022-12-31 18:13 出处:网络
I am writing an application for video streaming.In the application server is required to know the distance of the client from it self in terms of hop number.My question is,is there any tool/method oth

I am writing an application for video streaming.In the application server is required to know the distance of the client from it self in terms of hop number.My question is,is there any tool/method other than traceroute available in unix environment to find it? I also need to find out the geographical location of the client.So is their any tool/method for this as well? Any help in this regard will be highly a开发者_运维问答ppreciated. Thanks in advance.

Mawia


This is slightly complex for several reasons. First of all, the number of hops might not be the same in each direction. Disregarding that, you might be able to look at the TTL field of the recieved IP packets. This is a layer lower down than UDP, so I'm not entirely sure how to access it through the normal socket interfaces. But if you can get at that value, you can compare it to what the client/server normally sends (usually 64 or 255) and deduce the number of hops it has traversed.

For geographical information there are a number of geoip databases available online, but usually commerically. The precision of the data might also vary.


You might try tracepath as an alternative to traceroute.


If you haven't read this yet, you must do so now:

"The case of the 500 mile email."

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号