about transmitting speed

  • Follow


Hi,

Suppose I have an application on the network that always sending data to 
others. How can I know the speed of the sending?

Thanks a lot!

Best,
Tony
0
Reply zyzhang (10) 4/10/2008 8:50:08 AM

Tony, Zhang wrote:
> Hi,
> 
> Suppose I have an application on the network that always sending data to
> others. How can I know the speed of the sending?
> 
Measure it?

-- 
Ian Collins.
0
Reply ian-news (9882) 4/10/2008 9:12:40 AM


Thanks. But how to measure?

Ian Collins wrote:
> Tony, Zhang wrote:
>> Hi,
>>
>> Suppose I have an application on the network that always sending data to
>> others. How can I know the speed of the sending?
>>
> Measure it?
> 
0
Reply zyzhang (10) 4/10/2008 1:14:19 PM

Tony, Zhang wrote:

[please don't top-post]

> Ian Collins wrote:
>> Tony, Zhang wrote:
>>> Hi,
>>>
>>> Suppose I have an application on the network that always sending data to
>>> others. How can I know the speed of the sending?
>>>
>> Measure it?
>>
> Thanks. But how to measure?
>
Well you know how much data you have sent, just keep track of the start
time and work from there.

-- 
Ian Collins.
0
Reply ian-news (9882) 4/10/2008 7:47:46 PM

"Tony, Zhang" <zyzhang@cuhk.edu.hk> writes:
> Thanks. But how to measure?

It can be difficult, and it's often application-dependent.

One way to do it is to get the current time (using a high-resolution
timer) before sending the data, and then get the time again after some
significant event, and then subtract the two.  That significant event
might be after some known amount of data has been sent, or when the
peer responds, or perhaps using the well-known shutdown(fd, 1);
read(fd, buffer, 1); close(fd) trick to detect and wait for peer
socket close.

-- 
James Carlson, Solaris Networking              <james.d.carlson@sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
0
Reply james.d.carlson (85) 4/10/2008 9:33:36 PM

James Carlson <james.d.carlson@sun.com> writes:
> "Tony, Zhang" <zyzhang@cuhk.edu.hk> writes:
>> Thanks. But how to measure?
>
> It can be difficult, and it's often application-dependent.
>
> One way to do it is to get the current time (using a high-resolution
> timer) before sending the data, and then get the time again after some
> significant event, and then subtract the two.  That significant event
> might be after some known amount of data has been sent, or when the
> peer responds, or perhaps using the well-known shutdown(fd, 1);
> read(fd, buffer, 1); close(fd) trick to detect and wait for peer
> socket close.

Another (and IMO easier) way I have used for various application would
be to maintain a sum of all octets which have been transmitted and use
a periodic timer to calculate the (average) transmission speed during
the last timer interval, resetting the sum to zero afterwards. If the
intent is to do some 'statisical postprocessing' of the data, it may
make more sense to print the raw octet count per interval and
postprocess the resulting output file.
0
Reply rweikusat (2680) 4/11/2008 9:16:22 AM

Tony, Zhang wrote:
> Suppose I have an application on the network that always sending data to 
> others. How can I know the speed of the sending?

First step:  define "speed".  Are you talking about latency (elapsed time
to send one message), or are you talking about bandwidth (how many bits
per second)?  And once you know that, are you talking about the maximum,
the average, the minimum that can be expected given some failure rate,
or some other quantity?

   - Logan
0
Reply lshaw-usenet (926) 4/12/2008 8:15:11 PM

6 Replies
40 Views

(page loaded in 0.092 seconds)

Similiar Articles:













7/14/2012 10:47:15 AM


Reply: