使用BestTrace追踪路由

使用BestTrace追踪路由

Windows

BestTrace 是 ipip.net 开发的使用很广泛的路由追踪工具,可以用于查看线路走向,方便判断 VPS 路线情况,以图形化的形式在地图上显示经过的路径。

Windows下的使用就不用多说了都是图形界面化的,输入IP或者域名就可以进行追踪

image-20210101163429550

在本地追踪路径的缺点就是只能看到去程走向,然而去程走向其实参考价值是比较低的,虽然软件对于有的线路也会显示预测的回程线路,但准确性也不高。所以实际就需要从 VPS 那边的服务器端来发起路径追踪,才能准确的了解服务器的真实线路情况。

Linux

Linux 版的 BestTrace 程序因为是使用 GO 语言写的,所以使用起来是十分的简单,SSH 登陆 VPS,直接下载并解压即可:

# yum install -y wget unzip
# wget https://cdn.ipip.net/17mon/besttrace4linux.zip
# unzip besttrace4linux.zip
# chmod +x besttrace
# chmod +x besttrace32
# ./besttrace -q 1 目标 IP

例如一台Google的HongKong -VPS追踪临沂的一个IP地址

image-20210101163750554

程序全部命令可以使用./besttrace -help 命令查看:

[root@hongkong ]# ./besttrace -help
Usage of ./besttrace:
  -6, --ipv6
    	Use ipv6.
  -J, --json
    	Print traceroute result with JSON format.
  -g, --lang string
    	Language only supported cn and en now.
  -m, --maxhop int
    	Specifies the maximum number of hops (max time-to-live value) traceroute will probe. The default is 30. (default 30)
  -a, --noas
    	Do not try to map IP addresses to AS when displaying them.
  -n, --nodomain
    	Do not try to map IP addresses to host names when displaying them.
  -l, --nolocation
    	Do not try to map IP addresses to location when displaying them.
  -q, --queries int
    	Sets the number of probe packets per hop. The default is 3. (default 3)
  -z, --sendtime int
    	Minimal time interval between probes (default 0). 
    	If the value is more than 10, then it specifies a number in milliseconds, else it is a number of seconds (float point values allowed too). 
    	Useful when some routers use rate-limit for ICMP messages.
  -f, --starthop int
    	Specifies with what TTL to start. Defaults to 1. (default 1)
  --sync
    	Send icmp package by sync.
  -T, --tcp
    	Use TCP SYN for probes.
  -V, --version
    	Print the version and exit.
  -w, --waittime int
    	Set the time (in seconds) to wait for a response to a probe. (default 3)

Linux 版本 BestTrace 虽然没有 Windows 下的图形界面,但对于查看回程路线也是足够了,IP 库也基本挺新,除了部分内网 IP 基本都能正确识别。

辨别CN2

路由中有 ip 开头为 59.43.AS4809,首先即判断有一段为 CN2 网络。CN2 上承载了两个较为常见的套餐,那怎么判断是哪一种呢,我们来分析几种特殊情况。 CN2 GT 的省级出口为 202.97 节点(163骨干网节点),在跨境时才进入 CN2 骨干网,国际跨境节点为 59.43 开头。即使处在 CN2 节点城市,如上海,也会先走 202.97 节点。以此类推其他城市,不再列出。可见目前所有的 CN2 GT 路由都会有 202.97 开头的 ip

根据中国电信国际有限公司官网数据提供的 2018 年 5,6,7 月三个月的 CN2 质量平均情况(未知端点城市,看着像上海,也可能是几个城市平均下来的数据),理论上可看作为最佳情况下,常见 CN2 节点城市与中国连接延迟排序(ms)

香港 | 首尔 | 东京 | 新加坡 | 莫斯科 | 圣何塞 | 洛杉矶 | 法兰克福 |西雅图

28.27 | 60.37 | 67.32 | 67.65 | 134.78 | 166.44 | 175.62 | 180.65 | 185.47

原文地址:https://www.cnblogs.com/cuianbing/p/14469489.html