1

i'm trying to get the TX re-transmission amount for a specific network interface on a Linux 2.6.33.3 kernel.
is there any Linux raw data i can use in order to get/calculate this kind of information?
i've tried netstat, but i couldn't find a way to get the retransmissions value for a specific interface.
with no other "quick" choice, what would it require from me in order to build a small app especially for that? listen to all outgoing packets using any capturing library and count.. what? duplicate packets? by some kind of a packet id?
i'm not a network pro.. am i suppose to find troubles in this kind of mission? (btw, i'll probably try to do it with python. any reason why not to?)

4

2 回答 2

1

您可以使用以下命令检查您的接口是如何配置的:

mii-tool eth0
ethtool eth0
mii-diag eth0

并非所有 Linux 系统都默认安装它们,但它们绝对是可分发和可安装的。

当你想测量你的界面到底有多快时,你可以使用dd+ netcat

host1$ cat /dev/zero | nc -l -p 3000
host2$ nc host1 3000 | dd of=/dev/null
^C

ddhost1会写给你和之间的重传速度host2

于 2012-07-15T19:32:45.423 回答
0

如果您想要每个接口,请尝试 ifconfig eth0,您可能在那里拥有您想要的东西。只需通过python解析它。

于 2012-07-15T19:05:26.333 回答