pathping

提供有关源和目标之间中间跃点的网络延迟和网络丢失的信息。 此命令在一段时间内向源和目标之间的每个路由器发送多条回显请求消息,然后根据从每个路由器返回的数据包计算结果。 由于此命令显示任何给定路由器或链接的数据包丢失程度,因此可以确定哪些路由器或子网可能存在网络问题。 如果在没有参数的情况下使用,此命令会显示帮助。

Note

仅当 Internet 协议 (TCP/IP) 协议作为组件安装在网络连接的网络适配器的属性中时,此命令才可用。

Additionally, this command identifies which routers are on the path, same as using the tracert command. 但是,此命令还会定期向指定时间段内的所有路由器发送 ping,并根据从每个路由器返回的数字计算统计信息。

Syntax

pathping [/n] [/h <maximumhops>] [/g <hostlist>] [/p <Period>] [/q <numqueries> [/w <timeout>] [/i <IPaddress>] [/4 <IPv4>] [/6 <IPv6>][<targetname>]

Parameters

Parameter Description
/n Prevents pathping from attempting to resolve the IP addresses of intermediate routers to their names. This might expedite the display of pathping results.
/小时 <maximumhops> 指定搜索目标的路径中的最大跃点数。 默认值为 30 个跃点。
/克 <hostlist> 指定回显请求消息使用 IP 标头中的“松散源路由”选项,它带有 hostlist 中指定的一组中间目标。 使用松散源路由时,连续的中间目标可由一个或多个路由器分隔。 The maximum number of addresses or names in the host list is 9. The hostlist is a series of IP addresses (in dotted decimal notation) separated by spaces.
/p <period> 指定在连续 ping 之间等待的毫秒数。 默认值为 250 毫秒(1/4 秒)。 此参数将单个 ping 发送到每个中间跃点。 Because of this, the interval between two pings sent to the same hop is period multiplied by the number of hops.
/q <numqueries> 指定发送到路径中每个路由器的回显请求消息数。 默认值为 100 个查询。
/w <timeout> 指定等待每个答复的毫秒数。 默认值为 3000 毫秒(3 秒)。 此参数并行发送多个 ping。 Because of this, the amount of time specified in the timeout parameter isn't bounded by the amount of time specified in the period parameter for waiting between pings.
/我 <IPaddress> 指定源地址。
/4 <IPv4> 指定 pathping 仅使用 IPv4。
/6 <IPv6> 指定 pathping 仅使用 IPv6。
<targetname> 指定目标,该目标由 IP 地址或主机名标识。
/? 在命令提示符下显示帮助。

Remarks

  • 所有参数都区分大小写。

  • 若要避免网络拥塞并尽量减少突发损失的影响,应以足够慢的速度发送 ping。

pathping 命令输出的示例

D:\>pathping /n contoso1
Tracing route to contoso1 [10.54.1.196]
over a maximum of 30 hops:
  0  172.16.87.35
  1  172.16.87.218
  2  192.168.52.1
  3  192.168.80.1
  4  10.54.247.14
  5  10.54.1.196
computing statistics for 125 seconds...
            Source to Here   This Node/Link
Hop  RTT    Lost/Sent = Pct  Lost/Sent = Pct  address
  0                                           172.16.87.35
                                0/ 100 =  0%   |
  1   41ms     0/ 100 =  0%     0/ 100 =  0%  172.16.87.218
                               13/ 100 = 13%   |
  2   22ms    16/ 100 = 16%     3/ 100 =  3%  192.168.52.1
                                0/ 100 =  0%   |
  3   24ms    13/ 100 = 13%     0/ 100 =  0%  192.168.80.1
                                0/ 100 =  0%   |
  4   21ms    14/ 100 = 14%     1/ 100 =  1%  10.54.247.14
                                0/ 100 =  0%   |
  5   24ms    13/ 100 = 13%     0/ 100 =  0%  10.54.1.196
Trace complete.

When pathping is run, the first results list the path. 接下来,一条繁忙消息会显示大约 90 秒(时间因跃点数而异)。 在此期间,将从之前列出的所有路由器以及它们之间的链接中收集信息。 在此时间段结束时,将显示测试结果。

In the above sample report, the This Node/Link, Lost/Sent = Pct and address columns show that the link between 172.16.87.218 and 192.168.52.1 is dropping 13% of the packets. 跃点 2 和 4 处的路由器也会删除寻址到它们的数据包,但这种丢失不会影响它们转发未寻址到它们的流量的能力。

The loss rates displayed for the links, identified as a vertical bar (|) in the address column, indicate link congestion that is causing the loss of packets that are being forwarded on the path. 路由器(由其 IP 地址标识)显示的丢失率表明这些路由器可能过载。