在tcpreplay
中有一个非常有用的功能,根据official FAQ's ,使用参数 -T
调用:
The packet length (in this case 8892 bytes) is greater then the maximum transmition unit (MTU) on the outgoing interface. Tcpreplay must skip the packet. Alternatively, you can specify the -T option and tcpreplay will truncate the packet to the MTU size, fix the checksums and send it.
不幸的是,-T
在手册页中似乎有所不同:
-T string, --timer=string
Select packet timing mode: select, ioport, rdtsc, gtod, nano, abstime. This option may appear up to 1 times. The default string for this option is:
gtod
Allows you to select the packet timing method to use:
nano - Use nanosleep() API
select - Use select() API
ioport - Write to the i386 IO Port 0x80
rdtsc - Use the x86/x86_64/PPC RDTSC
gtod [default] - Use a gettimeofday() loop
abstime - Use OS X's AbsoluteTime API
此选项在最新版本的 tcpreplay 中是否被删除?
最佳答案
是的,它被分成tcprewrite
(转换捕获文件),然后选项被合并回命令tcpreplay-edit
中。
FAQ显示 tcpreplay-edit --mtu-trunc
现在相当于之前的 -T
选项,并且应该暗示 -C
来更正校验和,但如果您不处理标准 1500,则可能需要 --mtu=n
,或者如果问题的一部分是 header 和集合时的实际长度不一致,则可能需要 -F
时间。
关于tcpreplay : -T option,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17723157/