Riccardo Manfrin wrote:
> Hi NG,
> I hope not to be OT.
> Given a TCP stream from node A to node B (in terms of [SRCIP:SRCPORT -
> DSTIP
STPORT], I'd like to know at a given time T the number of bytes
> sent (since the link setup time, up to time T) by querying some fs or
> kernel struct.
> Is this possible? (if so how?)
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?