traceroute使用_如何使用Traceroute识别网络问题

traceroute使用

traceroute使用

image

Traceroute is a command-line tool included with Windows and other operating systems. Along with the ping command, it’s an important tool for understanding Internet connection problems, including packet loss and high latency.

Traceroute是Windows和其他操作系统附带的命令行工具。 与ping命令一起,它是了解Internet连接问题 (包括数据包丢失和高延迟)的重要工具。

If you’re having trouble connecting to a website, traceroute can tell you where the problem is. It can also help visualize the path traffic takes between your computer and a web server.

如果您在连接网站时遇到问题,traceroute可以告诉您问题出在哪里。 它还可以帮助可视化计算机和Web服务器之间的通信路径。

Traceroute如何工作 (How Traceroute Works)

When you connect to a website – say, howtogeek.com – the traffic has to go through several intermediaries before reaching the website. The traffic goes through your local router, your Internet service provider’s routers, onto larger networks, and so on.

当您连接到网站(例如howtogeek.com)时,流量必须经过多个中介方才能到达网站。 流量通过您的本地路由器,Internet服务提供商的路由器,到达较大的网络,等等。

Traceroute shows us the path traffic takes to reach the website. It also displays the delays that occur at each stop. If you’re having issues reaching a website and that website is working properly, it’s possible there’s a problem somewhere on the path between your computer and the website’s servers. Traceroute would show you where that problem is.

Traceroute向我们显示了访问网站的流量。 它还显示每个停靠点发生的延迟。 如果您在访问网站时遇到问题,并且该网站正常工作,则可能是计算机与网站服务器之间的路径上存在问题。 Traceroute将向您显示问题所在。

We’ve used traceroute to explain – and demonstrate — who provides the Internet service for your Internet service provider.

我们已经使用traceroute解释了并演示了谁为您的Internet服务提供商提供Internet服务

In more technical terms, traceroute sends a sequence of packets using the ICMP protocol (the same protocol used for the ping command.) The first packet has a time-to-live (also known as TTL, or hop limit) of 1, the second packet has a TTL of 2, and so on. Each time a packet is passed to a new router, the TTL is decreased by 1. When it reaches 0, the packet is discarded and the router returns an error message. By sending packets in this manner, traceroute ensures that each router in the path will discard a packet and send a response.

用更专业的术语来说,traceroute使用ICMP协议(用于ping命令的协议)发送一系列数据包。第一个数据包的生存时间(也称为TTL或跳数限制)为1,即第二个数据包的TTL为2,依此类推。 每次将数据包传递到新路由器时,TTL都会减小1。当它达到0时,该数据包将被丢弃,并且路由器会返回一条错误消息。 通过以这种方式发送数据包,traceroute可以确保路径中的每个路由器都将丢弃数据包并发送响应。

如何使用Traceroute (How to Use Traceroute)

Traceroute is run from a command prompt or terminal window. On Windows, press the Windows key, type Command Prompt, and press Enter to launch one.

Traceroute是从命令提示符或终端窗口运行的。 在Windows上,按Windows键,键入Command Prompt,然后按Enter启动一个。

To run a traceroute, run the tracert command followed by the address of a website. For example, if you wanted to run a traceroute on How-To Geek, you’d run the command:

要运行traceroute,请运行tracert命令,后跟网站地址。 例如,如果要在How-To Geek上运行traceroute,则可以运行以下命令:

tracert howtogeek.com

tracert howtogeek.com

(On Mac or Linux, run traceroute howtogeek.com instead.)

(在Mac或Linux上,请运行traceroute howtogeek.com 。)

You’ll gradually see the route take form as your computer receives responses from the routers along the way.

随着计算机一路上收到路由器的响应,您将逐渐看到路由的形式。

image

If you run a traceroute for another website – particularly one hosted in a different region of the world – you’d see how the paths differ. The first “hops” are the same as the traffic reaches your ISP, while the later hops are different as the packets go elsewhere. For example, below you can see the packets travelling to Baidu.com in China.

如果您为另一个网站(尤其是托管在世界其他地区的网站)运行跟踪路由,您将了解路径之间的差异。 第一个“跃点”与到达您的ISP的流量相同,而后一个跃点则与数据包到达其他位置的跃点不同。 例如,在下面,您可以查看在中国Baidu.com传播的数据包。

image

了解输出 (Understanding the Output)

The basic idea is self-explanatory. The first line represents your home router (assuming you’re behind a router), the next lines represent your ISP, and each line further down represents a router that’s further away.

基本思想是不言自明的。 第一行代表您的家用路由器(假设您在路由器后面),下一行代表您的ISP,而每行向下的每一行代表距离更远的路由器。

The format of each line is as follows:

每行的格式如下:

Hop RTT1 RTT2 RTT3 Domain Name [IP Address]

跃点RTT1 RTT2 RTT3域名[IP地址]

  • Hop: Whenever a packet is passed between a router, this is referred to as a “hop.” For example, in the output above, we can see that it takes 14 hops to reach How-To Geek’s servers from my current location.

    跃点:每当在路由器之间传递数据包时,这称为“跃点”。 例如,在上面的输出中,我们可以看到从我当前的位置到达How-To Geek服务器需要14跳。
  • RTT1, RTT2, RTT3: This is the round-trip time that it takes for a packet to get to a hop and back to your computer (in milliseconds). This is often referred to as latency, and is the same number you see when using ping. Traceroute sends three packets to each hop and displays each time, so you have some idea of how consistent (or inconsistent) the latency is. If you see a * in some columns, you didn’t receive a response – which could indicate packet loss.

    RTT1,RTT2,RTT3:这是数据包到达跃点并返回到计算机所需的往返时间(以毫秒为单位)。 这通常称为延迟,与使用ping时看到的数字相同。 Traceroute会向每个跃点发送三个数据包,并在每次显示时进行显示,因此您对延迟的一致性(或不一致)有所了解。 如果在某些列中看到*,则表示您未收到响应-这可能表示数据包丢失。
  • Domain Name [IP Address]: The domain name, if available, can often help you see the location of a router. If this isn’t available, only the IP address of the router is displayed.

    域名[IP地址]:域名(如果可用)通常可以帮助您查看路由器的位置。 如果此选项不可用,则仅显示路由器的IP地址。


You should now be able to use the tracert command and understand its output.

您现在应该可以使用tracert命令并了解其输出。

翻译自: https://www.howtogeek.com/134132/how-to-use-traceroute-to-identify-network-problems/

traceroute使用

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值