Skip to contentSkip to conversation

Speed of the network card

DISCUSSION Sourav Ghosh 4 participants 5 messages Jan 7, 2001

lore
Share & tools
lore
#0 lore raw

Hello,

I was wondering how I can determine the speed of a network device inside the kernel.

In case of ethernet, the "name" field of device structure will only give eth0 or something. But the speed could be either 10Mbps or 100Mbps.

Thanks,

--
Sourav

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw

On Sat, Jan 06, 2001 at 08:20:02PM -0500, Sourav Ghosh wrote:

I was wondering how I can determine the speed of a network device inside the kernel.

what kind of network card?

In case of ethernet, the "name" field of device structure will only give eth0 or something. But the speed could be either 10Mbps or 100Mbps.

we don't have a good was on doing this sort of thing, you could try mii-tool though; it supports many cards

--cw
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 12 lines · Sourav Ghosh

I was wondering how I can determine the speed of a network device inside the kernel.

what kind of network card?

In case of ethernet, the "name" field of device structure will only give eth0 or something. But the speed could be either 10Mbps or 100Mbps.

Well, I need to clarify the question.

I would like to determine the banwidth the card is getting from the network.
For an ethernet, it could be either 10Mbps or 100Mbps, is there any way of knowing from inside the kernel how much is the bandwidth the card is actually receiving from the network, especially when it is capable of getting either 10Mbps or 100Mbps?

Quoted 6 lines

we don't have a good was on doing this sort of thing, you could try mii-tool though; it supports many cards

--cw

Signature · 7 lines
Sourav


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#3 lore raw
In reply to Chris Wedgwood

On Sun, Jan 07, 2001 at 04:30:30AM -0500, Sourav Ghosh wrote:

I would like to determine the banwidth the card is getting from the network.

/proc/net/dev exports counters; you can monitor those -- I'm sure there are perfomance program that do exactly this.

For an ethernet, it could be either 10Mbps or 100Mbps, is there any way of knowing from inside the kernel how much is the bandwidth the card is actually receiving from the network, especially when it is capable of getting either 10Mbps or 100Mbps?

The kernel counts packets and bytes; you need to work out bandwidth in userland from that.

--cw
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
Quoted 4 lines · Chris Wedgwood

I would like to determine the banwidth the card is getting from the network.
/proc/net/dev exports counters; you can monitor those -- I'm sure there are perfomance program that do exactly this.

I have this little script for monitoring interfaces' speed on 132 wide textmode console w/ niche histogram. It is not perfect but 'it works for me' (tm).

--------------------------> cut here
if [ "$1" = "" ]
then
echo "Please specify the sampling rate."
exit
fi

while true
do
cat /proc/net/ip_fwnames &
sleep $1
done |
awk '

    BEGIN {
     s=0
     d='$1'*1024*1024
     wd=d/15
    }

    /^input /	{o=s
		 s=$7}
    /^output /	{s+=$7
                 w=(s-o)/wd
		 if(w>130)w=0
                 printf "%fMB/s %0*c\n",(s-o)/d,w,">"}

'
--------------------------> cut here

Signature · 7 lines
SaPE - Peter, Sasi - mailto:[email protected] - http://sape.iq.rulez.org/


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/