I cannot tell you *how* exactly - as I've never had the need to
investigate this - but it is possible, yes. I distinctly remember from
a few years ago that the KDE System Guard for instance had the ability
to show you this graphically by querying its "network sensors", and as
such, there must be a hook into "/proc" somewhere to get that
information from.
--
*Aragorn*
(registered GNU/Linux user #223157)
Addendum...: Check the output of...
/sbin/ifconfig
You need not be root in order to use this command for querying only.
Look at the tcp_probe module
http://www.linuxfoundation.org/collaborate/workgroups/networking/tcp_testing
You get time and sequence number.
This may be sufficient for your need.
Regards
The last time I needed to do this, I had to make kernel modifications.
As I recall, I modified the structure that tracks a flow
(nf_conntrack?) to include the time the flow entry was created. That
way, you could divide the number of bytes in each direction by the
number of seconds the flow entry has been around.
DS
You can setup accounting rules with iptables. I don't know how because
someone else here did it.
You should define more precisely what you mean. What do you do with, for
example, lost or retransmitted segments?
And, what do you include in the calculation? TCP header + payload, or
payload only? (or do you want to include lower level headers as well?)
Each side of the connection may have a different idea of how many bytes have
been "sent". And, btw, what is "sent" here? The number of bytes the
application wrote to the socket, or the bytes that have actually been sent
on the wire, or yet something else?