网络工具(Network tools)对于解决运行不正常的计算机网络问题至关重要。有很多事情可以帮助将网络恢复到其合法状态,其中两个选项是Ping和Traceroute。
这两种工具都旨在对网络进行故障排除,并且它们的工作方式相似。然而,从宏观上看,这些工具是非常不同的。现在,我们可以使用其他工具对性能不佳的网络进行故障排除,但今天,我们将只关注这两个。
Ping 和 Traceroute 网络工具
需要指出的是,在Windows 11/10上,Traceroute被称为Tracert,而在Cisco和Unix平台上,则使用Traceroute一词。但是,由于网络与Cisco平台的连接更紧密,我们选择使用更常见的名称。
Windows 中的 Ping 工具
当涉及到网络故障排除时,Ping工具是最常用的。Ping,也称为Packet Internet Groper,几乎包含在所有操作系统中。
要激活它,需要 ping 命令。从那里,它将调用ICMP(Internet 控制消息协议(Internet Control Message Protocol))来报告错误并向 IP 数据包处理提供重要数据。
现在,Ping的工作方式非常有趣。首先(First),您必须指定一个 IP 地址,然后您必须从那里向该地址发送ICMP回显请求消息。(ICMP)如果目标计算机能够接收到该消息,它将与ICMP回显回复消息进行通信。
发出Ping命令时,通常会输出有关网络性能的相关信息。您可以通过上图了解我们正在谈论的内容。
Windows 中的 Tracert Traceroute 工具
就Traceroute而言,它是一个基于命令行界面的故障排除工具。此工具的主要目的是确定数据包到达其目标所使用的路径。与Ping类似,我们了解到Traceroute也使用ICMP(Internet 控制消息协议(Internet Control Message Protocol))。
但是Traceroute与ICMP所关注的 Ping 的不同之处在于它通过数据包所采用的路径来精确定位每个路由器。你看,我们相信Traceroute非常适合解决网络问题,因为它能够更好地检测问题的确切位置。
Traceroute 如何识别其路径中的所有路由器:故障排除工具倾向于将一堆ICMP回显数据包消息请求发送到特定目的地。现在,前几条消息的生存时间(Time to Live)( TTL ) 限制设置为 1。这意味着路径中的第一个路由器将采取行动丢弃数据包并传递ICMP Time Exceeded消息。
最后,TTL参数加 1,直到到达目的主机并接受ICMP回显应答消息。从那里,原始主机现在可以轻松地使用收到的ICMP消息来识别路径中的所有路由器。
您需要在提升的 CMD 中运行此命令:
tracert www.<sitename>.com
Unix操作系统上的 Traceroute 怎么样?
与Windows(Windows)操作系统相比,该命令的工作方式略有不同。它利用UDP包以及从 33434 到 33534 的庞大目标端口。这些端口号不太可能被位于目标主机的任何应用程序使用。
READ : Ping Transmit failed 一般失败错误。(Ping Transmit failed General failure error.)
Ping and Traceroute Network tools explained in detail
Network tools are essential for solving issues with a computer network that is not performing as it should. There are quite a few things can do to aid in returning a network to its rightful state, and two of those options are Ping and Traceroute.
Both tools are designed to troubleshoot a network, and they work in similar ways. However, in the grand scheme of things, these tools are very different. Now, there are other tools we can use to troubleshoot a bad-performing network, but today, we will only focus on these two.
Ping and Traceroute Network tools
We should point out that on Windows 11/10, Traceroute is known as Tracert, while on Cisco and Unix platforms, the term Traceroute is used instead. However, since networking is more connected to Cisco platforms, we’ve chosen to go with the more common name.
Ping tool in Windows
When it comes down to troubleshooting a network, the Ping tool is the most commonly used. Ping, also known as Packet Internet Groper, is included with almost all operating systems.
To activate it, a ping command is required. From there, it will invoke ICMP (Internet Control Message Protocol) to report errors and provide important data to IP packet processing.
Now, the way Ping works is quite interesting. First, you will have to specify an IP address, and from there, you must send an ICMP echo request message to that address. Should the destination computer be able to receive the message, it will communicate back with an ICMP echo reply message.
When a Ping command is made, it usually outputs relevant information regarding the network’s performance. You can have an idea of what we’re talking about via the image above.
Tracert Traceroute tool in Windows
In terms of what Traceroute is, well, it is a troubleshooting tool that is based on a command-line interface. The primary purpose of this tool is to determine the path used by a packet to reach its target. In a similar way to Ping, we understand that Traceroute also uses ICMP (Internet Control Message Protocol) as well.
But where Traceroute differs from Ping where ICMP is concerned is that it pinpoints each router by the path taken by the packets. You see, we believe Traceroute is excellent for troubleshooting network problems because it is better able to detect the exact location of the problem.
How Traceroute identifies all routers in its path: The troubleshooting tool tends to send a bunch of ICMP echo packets message requests to a particular destination. Now, the first couple of messages have a Time to Live (TTL) limit set to 1. This means the first router in the path will make a move to discard the packet and deliver an ICMP Time Exceeded message.
Finally, the TTL parameter is increased by 1 until the destination host is reached and the ICMP echo reply message is accepted. From there, the original host can now easily use the received ICMP messages to identify all routers in a path.
You need to run this command in an elevated CMD:
tracert www.<sitename>.com
What about Traceroute on Unix operating systems?
The command works a bit differently when compared to Windows operating systems. It takes advantage of the UDP package along with a vast destination port along the lines of 33434 to 33534. These port numbers are unlikely to be used by any application located at the destination host.
READ: Ping Transmit failed General failure error.