描述路由器的ICMP响应性。
IcmpTool的Python项目详细描述
icmp工具提供了一种直截了当的方式来描述您附近路由器对ttl受限探测的响应。 这个工具是基于我们在planetlab上进行大规模战役时使用的代码。有关路由器分类如何工作的详细信息, 请参阅我们的论文“描述路由器上的ICMP速率限制”:http://goo.gl/cU004b 典型用法如下:
#!/usr/bin/env python from icmptool import icmptool routers_by_hop = icmptool(dest='8.8.8.8', ttls=[1,2,3], min_rate=1, max_rate=500, n_of_rates=5, duration=8) # extract and print rate-limitation parameters for hop in routers_by_hop: for router in routers_by_hop[hop]: print "router %s at hop %s is of type %s for the tested probing rates" % ( router, hop, routers_by_hop[hop][router]['rtype_description']) if 'fr-onoff' in routers_by_hop[hop][router]['rtype_str']: print("\tOn-off parameters are:\n\t\tBurst Size: " "%s packets\n\t\tInter Burst Time: %s seconds" "\n\t\t=> max answering rate %d pps " % (routers_by_hop[hop][router]['onoff_parameters']['bsize'], routers_by_hop[hop][router]['onoff_parameters']['iat'], routers_by_hop[hop][router]['onoff_parameters']['bsize'])) elif 'fr-rl' in routers_by_hop[hop][router]['rtype_str']: #generically rate-limited print "\tMaximum answering rate is %s" % routers_by_hop[hop][router]['extra_info']['limited_ans_rate']
通过这样做,我们在8.8.8.8路径上的跳1、2、3处探测路由器,在1 pps到500 pps之间以5个指数间隔探测速率,每次探测8秒。 路由器一跳一跳将包含路由器一跳响应的详细信息。
或者,可以从shell调用脚本icmp_tool.py来执行相同的任务。上面的示例变成:
$ ./icmp_tool.py --dest 8.8.8.8 --ttls 1 2 3 --min_rate 1 --max_rate 500 --n_of_rates 5 --duration 8
ICMP工具以恒定速率将TTL限制的探测发送到指定跃点处的路由器 通过研究接收到的icmp超时响应的时间序列 它决定了附近路由器对这些探测器的响应。典型的响应路由器 按以下顺序显示3个响应阶段:
[fully-responsive] [rate-limited] [irregular]
根据选择的探测速率和路由器的配置, 并非所有阶段都可能出现。最常见的实现 速率限制为开关模式,我们提供了以下参数: 突发大小,周期长度和相应的应答率。在某些情况下, 速率限制以最大恒定应答率来实现,但没有这样的限制。 模式是可观察的。我们称之为一般速率限制路由器(rl)。 无论是否配置了速率限制,都可能出现不规则阶段(如果有的话)。 在某个阈值之后,路由器的响应可能不会遵循任何模式 变得不那么容易预测。
该工具使用tcpdump捕获传出探测和传入回复。它需要sudo权限。