- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想以低时间分辨率(以毫秒为单位)而不是默认的微秒获取 tcpdump。
在 tcpdump 手册中,我得到了 -j
参数,其精度可以接受为“host_lowprec”和“host_hiprec”
tcpdump -i any -n -j host_lowprec "tcp"
我有两个问题:
host_lowprec = ?精确和host_hiprec =?精度
我可以将精度设置为毫秒或纳秒吗?如果是怎么办?
最佳答案
回答你的第一个问题:
The tcpdump man page说到 -j
选项:
-j
tstamp_type
--time-stamp-type=
tstamp_type
Set the time stamp type for the capture to tstamp_type. The names to use for the time stamp types are given in pcap-tstamp(7); not all the types listed there will necessarily be valid for any given interface.
pcap-tstamp(7) 手册页说:
... The time stamp types are listed here; the first value is the
#define
to use in code, the second value is the value returned bypcap_tstamp_type_val_to_name()
and accepted bypcap_tstamp_type_name_to_val()
.
PCAP_TSTAMP_HOST
-host
Time stamp provided by the host on which the capture is being done. The precision of this time stamp is unspecified; it might or might not be synchronized with the host operating system's clock.
PCAP_TSTAMP_HOST_LOWPREC
-host_lowprec
Time stamp provided by the host on which the capture is being done. This is a low-precision time stamp, synchronized with the host operating system's clock.
PCAP_TSTAMP_HOST_HIPREC
-host_hiprec
Time stamp provided by the host on which the capture is being done. This is a high-precision time stamp; it might or might not be synchronized with the host operating system's clock. It might be more expensive to fetch thanPCAP_TSTAMP_HOST_LOWPREC
.
PCAP_TSTAMP_ADAPTER
-adapter
Time stamp provided by the network adapter on which the capture is being done. This is a high-precision time stamp, synchronized with the host operating system's clock.
PCAP_TSTAMP_ADAPTER_UNSYNCED
-adapter_unsynced
Time stamp provided by the network adapter on which the capture is being done. This is a high-precision time stamp; it is not synchronized with the host operating system's clock.
host_lowprec
和 host_hiprec
都没有指定精确的精度。使用 -j
设置的精度不会影响时间戳在捕获文件中的存储方式;它们将以秒和微秒的形式存储,除非您有支持 --time-stamp-precision
选项的更新版本的 tcpdump 并且操作系统可以提供纳秒时间戳,在这种情况下,它们将存储为秒和纳秒,并且文件将具有不同的“魔数(Magic Number)”,以便 tcpdump/Wireshark/etc.可以正确读取时间戳。
所有 -j
选项控制的是多少微秒(或纳秒)值是重要的。
第二个问题的回答:
pcap 文件中没有将时间存储为秒和毫秒的机制,也没有明确的选项要求微秒(或纳秒)值只有 3 位有效数字。
有一个选项可以请求将时间戳存储为秒和纳秒。如果您正在进行实时捕获,则仅当操作系统支持在捕获时提供秒和纳秒时间戳时才有效;这目前仅适用于较新版本的 Linux。
你想在这里完成什么?
关于tcpdump的时间精度怎么来的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25619631/
如何告诉tcpdump解析名称并保留未解析的端口号? 来自人: -n Don’t convert host addresses to names. This can be used to a
我正在使用 tcpdump 通过 wlan0 收集数据包数据。但是我发现很多数据包的长度为 0,如下图所示。嗯,长度为 0 的数据包...... tcpdump 可靠还是我错过了什么? 最佳答案 好的
运行“tcpdump -w 1.pcap”时需要限制文件大小。我尝试使用键“-C”来执行此操作,但是当我添加它时,我收到错误“权限被拒绝”。所以: > sudo tcpdump -w 1.pcap t
我正在通过网络适配器捕获 tcp/udp 数据包,并尝试分析数据包以获得一些统计指标,例如带宽速率或协议(protocol)效率。无论如何,我需要使用一些 CLI 工具来监视特定链路(源、目标、端口,
使用 tcpdump 在接口(interface)上捕获 LLDP 数据包的格式是什么? 我尝试了以下格式,但它不起作用: tcpdump -w test.pcap -i eth0 lldp -vv
我想使用 tcpdump 捕获网络流量,如果捕获的数据包增加为 10mb,我想创建另一个文件。我如何使用 tcpdump 安排此操作。请善意地帮助我。谢谢。 最佳答案 tcpdump -W 5 -C
使用 tcpdump 时,我似乎无法看到捕获的所有数据。具体来说,我似乎从帧头丢失了 6 个字节,我想知道是否有人可以解释原因。 为了说明这一点,我在 VMWare 上以仅主机网络配置设置了一个 Ub
我在使用 Android 应用程序中的 TCPDump 时遇到问题。它应该逐行读取 tcpdump 的输出并在我的应用程序中处理它。 问题是: 有时代码工作正常,它会立即读取捕获的数据包。但有时,Re
我都使用过,我的结论是我可以使用 tcpflow 从网页中读取 html 数据,但不能使用 tcpdump 这样做。我得到的最好的结果是一些丑陋的 ASCII 文本,其中有很多句点符号。 我的理解是
我需要在我的 Android 设备上执行 tcpdump 跟踪。 我的设置: 将tcpdump文件推送到sdcard adb push filepath/tcpdump /sdcard/tcpdump
我的电脑上有两个网络接口(interface)。 netstat -i Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-
Linux中是否有诸如tcpdump之类的实用程序来捕获通过RDMA channel 传输的流量? (Infiniband/RoCE/iWARP) 最佳答案 旧线程,但仍然: 正如Roland指出的那
我有一个巨大的pcap文件(100GB),我对一小部分数据包感兴趣,我知道这些数据包的数量为5,000,000至5,000,020。 如何使用tcpdump读取pcap文件,按数据包编号(或范围)过滤
如何使用 tcpdump 捕获以太网帧并显示本地 PC 使用 UDP、ARP 和 ICMP 协议(protocol)之一发送或接收的任何帧。 我正在尝试这个命令: sudo tcpdump -e ud
我正在使用 tcpdump 捕获网络数据包,当我开始丢弃数据包时遇到问题。我运行了一个通过网络快速交换数据包的应用程序;导致网络带宽较高。 >> tcpdump -i eno1 -s 64 -B 91
是否可以指定tcpdump 测量接收和发送数据包的时间?我知道命令 tcpdump -c 100 指定 tcpdump 在收到 10 个数据包后应该停止。我想指定 tcpdump 在例如 5 分钟后停
运行以下命令时出现错误: sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/tcpdump* 这提供了以下错误: Failed to set cap
我可以为dst指定1个以上的tcpdump IP地址吗? 如果没有,如果我只想要两个特定目的地的流量,该如何很好地过滤信息? 非常感谢你! 最佳答案 是的,您可能有一个过滤器,其中包含多个通过“或”连
我正在寻找在 openwrt 上运行的 tcpdump 二进制文件。该网站仅显示必须构建的源代码。有人指向我包含预构建二进制文件的位置吗?谢谢。 最佳答案 我建议建立一个工作存储库,即: https:
在服务器 # nc -lp 2424 hi server hi client 1 2 3 在客户端 ➜ ~ nc 139.224.xxx.xx 2424 hi server hi client 1
我是一名优秀的程序员,十分优秀!