找出距离的工具。 UNIX 中的跳数
我正在编写一个用于视频流的应用程序。在应用程序服务器中,需要知道客户端与其自身之间的跳数距离。我的问题是,除了traceroute之外,还有什么工具/方法可以在unix环境中找到它? 我还需要找出客户的地理位置。那么他们也有这方面的工具/方法吗? 在这方面的任何帮助将受到高度赞赏。 提前致谢。
马维亚
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 appreciated.
Thanks in advance.
Mawia
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于几个原因,这有点复杂。首先,每个方向的跳数可能不相同。不管这一点,您也许可以查看收到的 IP 数据包的 TTL 字段。这是比 UDP 低一层,所以我不完全确定如何通过普通套接字接口访问它。但是,如果您可以获得该值,则可以将其与客户端/服务器通常发送的值(通常是 64 或 255)进行比较,并推断出它所经过的跳数。
对于地理信息,可以在线使用许多 geoip 数据库,但通常是商业数据库。数据的精度也可能有所不同。
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.
您可以尝试 tracepath 作为 traceroute。
You might try tracepath as an alternative to traceroute.
如果您还没有读过本文,您现在必须阅读:
“500 英里的案例电子邮件。”
If you haven't read this yet, you must do so now:
"The case of the 500 mile email."