ifconfig data interpretation
Lennart Sorensen
lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Apr 2 22:16:53 UTC 2009
On Thu, Apr 02, 2009 at 11:47:24AM -0400, William Muriithi wrote:
> Morning,
>
> I have noticed that the ifconfig tool is being deprecated and will be
> replaced by the ip tool. However, so far I have not been able to find
> a way of getting all the information generated by ifconfig from ip
> tool. By that I mean details like packets received, packet sent out,
> collision statistics and sent/receive errors are impossible to get
> from /sbin/ip. Now, is that a tool limitation or is it me who have
> not done my homework well?
ip -s link
For example:
# ifconfig eth0;ip -s link show dev eth0
eth0 Link encap:Ethernet HWaddr 00:1A:64:D4:9F:18
inet addr:10.128.10.2 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::21a:64ff:fed4:9f18/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:755756697 errors:0 dropped:0 overruns:0 frame:0
TX packets:570504212 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:871419712393 (811.5 GiB) TX bytes:316608994072 (294.8 GiB)
Interrupt:16 Memory:ce000000-ce012100
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:1a:64:d4:9f:18 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
3836318601 755756697 0 0 0 13
TX: bytes packets errors dropped carrier collsns
3076381464 570504212 0 0 0 0
Not sure why ip is showing 32bit truncated values for the bytes.
Possible because I am using a 32bit binary with a 64bit kernel.
Adding a second -s gives you:
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:1a:64:d4:9f:18 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
3836494484 755758605 0 0 0 13
RX errors: length crc frame fifo missed
0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
3076741152 570505260 0 0 0 0
TX errors: aborted fifo window heartbeat
0 0 0 0
> Second, I have noticed one details that is not straight forward to
> understand as I thought - frame. When I googled, I got the feeling its
> a flag raised when the NIC can not detect connectivity. That is not
> the case though as none of the network based seem affected. It could
> also be the frame is larger than 1500, but I have not seen it in any
> other system. It make no sense to assert that only one system is
> experiencing giant frames.
To a large extent, the errors have whatever meaning the driver gives them.
Not all chips report all different types of errors seperately, so the
driver may or may not be able to detect everything. Sometimes the chip
reports errors that have no flag and the driver ixes it in with another
error type.
In general though, crc errors are just that, packets with a crc checksum
that didn't match the packet. So it get messed up somewhere. missed is
whenever the network hardware for some reason could not receive a packet
because it was out of buffer space or the pci bus was busy or whatever
else could cause it to not keep up with incoming data. I have never seen
fifo error. overrun I believe are when packets are longer than permitted.
frame errors simply means there was something wrong with the ethernet
packet that meant it was simply not a valid ethernet packet, which is
sometimes caused by truncated packets. dropped tends to be a packet
that was received by the chip, but thrown away, or possible thrown away
by the driver for whatever reason. Not sure I have ever seen one.
As you can see though, ip -s link shows a lot more info that ifconfig
ever did. It also gets it through netlink, rather than trying to parse
/proc files, which is a lot more efficient and allows future extensions.
I will be happy to see ifconfig go.
> That got me thinking that I may actually be misinterpretation what the
> word frame mean and therefore the post. Any idea why the frame counter
> keep going up?
>
> Link encap:Ethernet HWaddr 00:14:22:3E:8F:79
> inet addr:172.16.1.139 Bcast:172.16.3.255 Mask:255.255.252.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:37156044 errors:172679 dropped:0 overruns:0 frame:172678
> TX packets:54908637 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:313517308 (298.9 MiB) TX bytes:2734438868 (2.5 GiB)
> Base address:0xecc0 Memory:fe6e0000-fe700000
Well almost certainly something on your network is unhappy. It may
be that you have a device on your network sending packets your network
card thinks are invalid. Maybe someone is using jumbo frames, or non
802.3 frames. In any case your card is treating them as errors and
throwing them away most likely.
> - Interesting dmesg information
> * e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex
> * Intel(R) PRO/1000 Network Driver - version 6.0.54-k2-NAPI
>
> The nic card is:
> lspci output
> * 06:07.0 Ethernet controller: Intel Corp. 82541GI/PI Gigabit Ethernet
> Controller (rev 05)
>
> ethtool output
>
> Settings for eth0:
> Supported ports: [ TP ]
> Supported link modes: 10baseT/Half 10baseT/Full
> 100baseT/Half 100baseT/Full
> 1000baseT/Full
> Supports auto-negotiation: Yes
> Advertised link modes: 10baseT/Half 10baseT/Full
> 100baseT/Half 100baseT/Full
> 1000baseT/Full
> Advertised auto-negotiation: Yes
> Speed: 1000Mb/s
> Duplex: Full
> Port: Twisted Pair
> PHYAD: 0
> Transceiver: internal
> Auto-negotiation: on
> Supports Wake-on: umbg
> Wake-on: d
> Current message level: 0x00000007 (7)
> Link detected: yes
--
Len Sorensen
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list