about transmitting speed - Unix

This is a discussion on about transmitting speed - Unix ; 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...

+ Reply to Thread
Results 1 to 7 of 7

Thread: about transmitting speed

  1. about transmitting speed

    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

  2. Re: about transmitting speed

    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.

  3. Re: about transmitting speed

    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?
    >


  4. Re: about transmitting speed

    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.

  5. Re: about transmitting speed

    "Tony, Zhang" 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
    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

  6. Re: about transmitting speed

    James Carlson writes:
    > "Tony, Zhang" 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.

  7. Re: about transmitting speed

    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

+ Reply to Thread