分享

traceroute:“到了吗?到了和我说一声”

 偏扁豆 2020-08-11

“即使是机械,也不是没有感情的。”

——机械迷城

小E:这个又和这篇文章有什么关系?

说没有关系是不可能的,计算机科学一直都是人类社会科学的忠实粉丝,它本身就是人设计的,因此它的思考逻辑也永远都是人的思考逻辑,它的行事准则一定也是充满着人情味的。

traceroute是一个冷冰冰的测试你的网络节点、路由的工具,但是它恰恰是利用了“反馈”这个理念,你发的消息对也好不对也罢,节点是要给你反馈一个消息的,这就是它的原理。

就像是远游他乡,父母、爱人依旧会问你“到了吗?到了和我说一声。”

这时候你可以抛之脑后,但他们依旧在等。

你的脚印化作地图上的点点思念萦绕他们心头。

traceroute [-46dFITUnreAV] [-f first_ttl] [-g gate,...] [-i device] [-m max_ttl] [-p port] [-s src_addr] [-q nqueries] [-N squeries] [-t tos] [-l flow_label] [-w waittime] [-z sendwait] [-UL] [-D] [-P proto] [--sport=port] [-M method] [-O mod_options] [--mtu] [--back] host [packet_len] traceroute6 [options]
--help Print help info and exit.
-4, -6 Explicitly force IPv4 or IPv6 tracerouting. By default, the program will try to resolve the name given, and choose the appropriate protocol automatically. If resolving a host name returns both IPv4 and IPv6 addresses, traceroute will use IPv4.
-I, --icmp Use ICMP ECHO for probes 做探针
-T, --tcp Use TCP SYN for probes
-d, --debug 使用Socket层级的排错功能。
-F, --dont-fragment Do not fragment probe packets. (For IPv4 it also sets DF bit, which tells intermediate routers not to fragment remotely as well). 设置勿离断位        -f first_ttl--first=first_ttl Specifies with what TTL to start. Defaults to 1. -g gateway, --gateway=gateway Tells traceroute to add an IP source routing option to the outgoing packet that tells the network to route the packet through the specified gateway (most routers have disabled source routing for security reasons). In general, several gateway's is allowed (comma separated). For IPv6, the form of num,addr,addr... is allowed, where num is a route header type (default is type 2). Note the type 0 route header is now deprecated (rfc5095). 设置来源路由网关 -i interface, --interface=interface Specifies the interface through which traceroute should send packets. By default, the interface is selected according to the routing table.
       -m max_ttl--max-hops=max_ttl Specifies the maximum number of hops (max time-to-live value) traceroute will probe. The default is 30. -N squeries, --sim-queries=squeries Specifies the number of probe packets sent out simultaneously. Sending several probes concurrently can speed up traceroute considerably. The default value is 16. Note that some routers and hosts can use ICMP rate throttling. In such a situation specifying too large number can lead to loss of some responses. 并发发包 -n 直接使用IP地址而非主机名称。 -p 设置UDP传输协议的通信端口。 -r 忽略普通的Routing Table,直接将数据包送到远端主机上。 -s 设置本地主机送出数据包的IP地址。 -t 设置检测数据包的TOS数值。 -v 详细显示指令的执行过程。 -w 设置等待远端主机回报的时间。        -x 开启或关闭数据包的正确性检验。

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多