RE: Received Bytes, transmited bytes and connection speed

2010-03-18 Thread Dan Williams
On Thu, 2010-03-18 at 20:17 -0700, Nguyen Canh Toan wrote:
> Dear Dan,
> 
> I only want to get an approximate connection speed but not a actual
> connection speed. 
> As you mention, with 3G devices, I only get a general access technology, but
> I don't care what is this. All things I interest in the speed and/or total
> bytes transmitted and received. How can I get it?

Until we implement it through the NM D-Bus API, you can always either:

1) scrape /proc/net/dev, which is what /sbin/ifconfig does

2) talk directly to netlink, which is what NM will do too

Dan

> Toannc.
> 
> -Original Message-
> From: Dan Williams [mailto:d...@redhat.com] 
> Sent: Wednesday, March 17, 2010 5:29 PM
> To: Nguyen Canh Toan
> Cc: networkmanager-list@gnome.org
> Subject: Re: Received Bytes, transmited bytes and connection speed
> 
> On Thu, 2010-03-18 at 03:40 -0700, Nguyen Canh Toan wrote:
> > Dear all,
> > 
> >  
> > 
> > I am wondering how to get current connection speed. Or, alternatively,
> > how to get total bytes received and transmited (so current speed ~
> > RX[n]-RX[n-1]).
> 
> Using bytes received and transmitted won't really get you a connection
> speed, since devices are usually not transmitting at full capacity all
> the time.  It'll give you a "current DL/UL rate", but certainly not the
> actual connection speed of the device.
> 
> Current connection speed is tricky, and depends on the specific device
> and the technology that the device is using.
> 
> For Ethernet, you have the 'Speed' property in the D-Bus interface,
> which reports the current network device speed (10Mb, 100Mb, 1000Mb,
> etc) in Mb/s.
> 
> For Wifi, there's the 'Bitrate' property in the D-Bus interface, which
> while the device is associated to an access point, reports the device's
> current rate in Kb/s (since wifi devices can transmit in odd rates, we
> can't just use Mb/s).
> 
> For 3G, you can only get the general access technology that the device
> is using, not a raw bitrate.  ModemManager reports current access
> technology for devices that support it via the AccessTechnology property
> of the device for GSM devices, which we'll also probably use for CDMA
> when that support gets folded in.
> 
> For Bluetooth, it'll be the same as either Ethernet or 3G depending on
> how you're using the bluetooth device.
> 
> Dan
> 
> 
> 


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


RE: Received Bytes, transmited bytes and connection speed

2010-03-17 Thread Nguyen Canh Toan
Dear Dan,

I only want to get an approximate connection speed but not a actual
connection speed. 
As you mention, with 3G devices, I only get a general access technology, but
I don't care what is this. All things I interest in the speed and/or total
bytes transmitted and received. How can I get it?

Toannc.

-Original Message-
From: Dan Williams [mailto:d...@redhat.com] 
Sent: Wednesday, March 17, 2010 5:29 PM
To: Nguyen Canh Toan
Cc: networkmanager-list@gnome.org
Subject: Re: Received Bytes, transmited bytes and connection speed

On Thu, 2010-03-18 at 03:40 -0700, Nguyen Canh Toan wrote:
> Dear all,
> 
>  
> 
> I am wondering how to get current connection speed. Or, alternatively,
> how to get total bytes received and transmited (so current speed ~
> RX[n]-RX[n-1]).

Using bytes received and transmitted won't really get you a connection
speed, since devices are usually not transmitting at full capacity all
the time.  It'll give you a "current DL/UL rate", but certainly not the
actual connection speed of the device.

Current connection speed is tricky, and depends on the specific device
and the technology that the device is using.

For Ethernet, you have the 'Speed' property in the D-Bus interface,
which reports the current network device speed (10Mb, 100Mb, 1000Mb,
etc) in Mb/s.

For Wifi, there's the 'Bitrate' property in the D-Bus interface, which
while the device is associated to an access point, reports the device's
current rate in Kb/s (since wifi devices can transmit in odd rates, we
can't just use Mb/s).

For 3G, you can only get the general access technology that the device
is using, not a raw bitrate.  ModemManager reports current access
technology for devices that support it via the AccessTechnology property
of the device for GSM devices, which we'll also probably use for CDMA
when that support gets folded in.

For Bluetooth, it'll be the same as either Ethernet or 3G depending on
how you're using the bluetooth device.

Dan



___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Received Bytes, transmited bytes and connection speed

2010-03-17 Thread Dan Williams
On Thu, 2010-03-18 at 03:40 -0700, Nguyen Canh Toan wrote:
> Dear all,
> 
>  
> 
> I am wondering how to get current connection speed. Or, alternatively,
> how to get total bytes received and transmited (so current speed ~
> RX[n]-RX[n-1]).

Using bytes received and transmitted won't really get you a connection
speed, since devices are usually not transmitting at full capacity all
the time.  It'll give you a "current DL/UL rate", but certainly not the
actual connection speed of the device.

Current connection speed is tricky, and depends on the specific device
and the technology that the device is using.

For Ethernet, you have the 'Speed' property in the D-Bus interface,
which reports the current network device speed (10Mb, 100Mb, 1000Mb,
etc) in Mb/s.

For Wifi, there's the 'Bitrate' property in the D-Bus interface, which
while the device is associated to an access point, reports the device's
current rate in Kb/s (since wifi devices can transmit in odd rates, we
can't just use Mb/s).

For 3G, you can only get the general access technology that the device
is using, not a raw bitrate.  ModemManager reports current access
technology for devices that support it via the AccessTechnology property
of the device for GSM devices, which we'll also probably use for CDMA
when that support gets folded in.

For Bluetooth, it'll be the same as either Ethernet or 3G depending on
how you're using the bluetooth device.

Dan



___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Received Bytes, transmited bytes and connection speed

2010-03-17 Thread John Mahoney
On Thu, Mar 18, 2010 at 6:40 AM, Nguyen Canh Toan wrote:

>  Dear all,
>
>
>
> I am wondering how to get current connection speed. Or, alternatively, how
> to get total bytes received and transmited (so current speed ~
> RX[n]-RX[n-1]).
>
>
>

I do not know if it is build into NM, but bwm-ng is a simple nice tool to
accomplish such or the iptables RATEEST target can do some fancy stuff.
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Received Bytes, transmited bytes and connection speed

2010-03-17 Thread Nguyen Canh Toan
Dear all,

 

I am wondering how to get current connection speed. Or, alternatively, how
to get total bytes received and transmited (so current speed ~
RX[n]-RX[n-1]).

 

Thanks.

Toannc

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list