Listing 5. Usage patterns for the tcpdump tool.
清单5. tcpdump工具的用法模式。
Start the tcpdump command in the server as follows.
在服务器上启动tcpdump命令。
A couple of usage patterns for tcpdump are shown in Listing 5.
清单5显示tcpdump的两个用法模式。
With tcpdump, you can also limit the amount of data to be traced.
使用tcpdump,您还可以限制要跟踪的数据的总量。
The Net::TcpDumpLog parses the raw network data saved by tcpdump.
TcpDumpLog 会解析tcpdump 所保存的原始网络数据。
This is where tracing tools come in handy, such as iptrace, ipreport, and tcpdump.
在这种情况下,可以使用各种跟踪工具,比如iptrace、ipreport和tcpdump。
To do this, you will use a tool called tcpdump (see the Resources section below for a link).
为此,您将使用一个名为tcpdump的工具(请参阅下面的参考资料部分以获得一个链接)。
Then, use tcpdump to display packets sent to the host using the example shown in Listing 16.
然后,使用tcpdump显示发送到目标主机的数据包,见清单16中的示例。
The message packets between client and server can be traced using the tcpdump command in AIX.
在AIX中,可以使用tcpdump命令跟踪客户机和服务器之间传输的消息包。
The article describes these utilities, including tools such as iptrace, ipreport, and tcpdump.
本文将描述这些实用工具,包括iptrace、ipreport和tcpdump。
Then, use tcpdump to display packets received from the host using the example shown in Listing 17.
然后,使用tcpdump显示从此主机接收的数据包,见清单17。
The transaction between the client and server should be completed and then the tcpdump can be killed.
客户机和服务器之间的事务完成之后,可以停止tcpdump进程。
The process for downloading and installing tcpdump will vary based on your OS, so we will not cover that here.
下载和安装tcpdump的过程将根据您的操作系统有所不同,所以我们在此不作介绍。
One important difference with tcpdump is that, unlike iptrace, it can look at only one network interface at a time.
tcpdump与iptrace的一个重要区别是,它一次只能查看一个网络接口。
If you want tcpdump to keep only a set number of bytes per packet, enter the number of bytes desired in place of zero here.
如果您想让tcpdump只保持每个数据包一定数量的字节,请输入所期望的字节数来代替此处的零。
The tcpdump and tcpflow tools give you a huge number of options, including the ability to create complex filter expressions.
tcpdump和tcpflow工具有大量的选项,包括创建复杂过滤表达式的能力。
Use tcpdump to display packets sent to and received from the host on the specified port using the example shown in Listing 12.
使用tcpdump显示发送到主机上的指定端口或从其接收的数据包,见清单12中的示例。
As shown in this article, using tools like tcpdump, snoop or iptrace, you can extract a wide range of data at the command line.
如本文所述,通过使用诸如tcpdump、snoop或iptrace的工具,您可以在命令行上提取大量的数据。
Note that the command line above is for a Linux machine, and that you may need to run tcpdump with root or administrator permissions.
请注意,上面的命令行适用于Linux机器,并且您可能需要拥有root权限或管理员权限才能运行tcpdump。
When you are testing the applications, you will use the following options on tcpdump to siphon the messages off into a temporary file.
当您测试应用程序时,您将使用下列tcpdump选项将消息抽取出来保存到临时文件中。
Suppose you execute the following command on your localhost, 192.168.2.64: tcpdump -i eth0 -X -s 3000 host 192.168.2.100 and port 5432.
假设您在自己的本地主机 192.168.2.64 上执行以下命令:tcpdump-ieth0 -X-s 3000host 192.168.2.100 and port 5432。
The tcpdump tool is an older tool that "sniffs" network packets from a network and either prints them to stdout or logs them to a file.
tcpdump工具是一个比较老的工具,它从网上“嗅探”网络数据包,打印到stdout或记录在一个文件中。
To test the message overhead, you will use tcpdump; run it in a third window, then run the script size-client.py (with the server still running).
要测试消息开销,您要使用tcpdump ;在第三个窗口中运行它,然后运行脚本size-client.py (此时服务器仍在运行中)。
There are a number of modules in different languages that provide functionality for reading and decoding the data captured by tcpdump and snoop.
有许多使用不同语言编写的模块具有读取和解码tcpdump 和snoop捕捉的数据的功能。
The tcpdump command is much more feature rich than the simple examples shown here, so I recommend that you familiarize yourself with its man pages.
tcpdump命令的特性比这些简单的示例丰富得多,所以我建议您熟悉它的手册页。
The main benefit of tcpdump is that you can specify filters so that you can select only particular protocols, sources, destinations, ports and other combinations.
tcpdump的主要好处是可以指定过滤器,这样您就可以仅选择特定的协议、源、目标和端口等。
Another way to process the content from tcpdump is to save the raw network packet data to a file and then process the file to find and decode the information that you want.
处理来自tcpdump的另一个方法是将原始网络数据包数据保存到一个文件中,然后处理这个文件以便查找和解码出您想要的信息。
Depending on the nature of the problem, it is sometimes good practice to run a tcpdump for a period of time while capturing packet information to a file using the -w switch.
根据问题的性质,有时候最好运行tcpdump一段时间,同时使用- w选项把数据包信息捕捉到文件中。
Although, as already mentioned, tools like tcpdump, iptrace and snoop provide basic network analysis and decoding, there are GUI-based tools that make the process even easier.
虽然,正如之前提到的,诸如tcpdump、iptrace和snoop等工具都提供了基本的网络分析和解码功能,但是还有一些基于GUI的工具使这个过程更简单。
应用推荐