Algorithm - UDP Throughput Calculation



Hi all,

Wonder can anyone help. After using perl happily i am turning my
attention to Java as a better language for GUI development. However i
came across a strange thing that i'm sure i'll come up against in Java
given that i'll be using the same algorithm. I had written a udp tool
that streams x packets/sec of x bytes long to a server i also wrote.
The server basically listens to the relevent port and calculates the
average receive rate of the UDP packets.

The way i did this in the server was to essentially take a time tick
when the first packet was received - the start time. Using an averaging
window of 10 packets, once the 10th packet is received (not including
the very first one) the time is ticked again. The elapsed time is then
the difference in the 2 ticks. The received throughput is then the
total number of bytes in the 10 packets divided by the elapsed time.

When i run this it works fine and the transmit rate versus the received
rate match up pretty well for any packet size. The trouble is as i
increase the sent packet rate the calculated receive rate in the server
gets progressively less than the real throughput. There are no dropped
packets however. So lets say i choose a send rate of 1000 bytes/sec by
sending
1 x 1000byte UDP packet every second, the measured rate at the server
is very close.
If i keep the same rate but this time use 20 x 50byte UDP packets every
second the measured rate is much lower abut again i know there are no
dropped packets.

I guess my question is, is there a particular algorithm programmers use
to calculate this?

Thanks in advance

.



Relevant Pages

  • Re: Diagnose co-location networking problem
    ... it was from the client. ... Actually there's significant indication of lost packets and clues that ... 540 retransmit timeouts ... are you using any packetfiltering on the server? ...
    (freebsd-net)
  • Re: Problem with writing fast UDP server
    ... > I wrote a simple case test: client and server. ... > packets within 0.137447118759 secs. ... I've used this script to test sending UDP packets. ... Uses port %d. ...
    (comp.lang.python)
  • Re: Improving FreeBSD NFS performance (esp. directory updates)
    ... >> I don't think the network is at fault, nor is the server really going ... 155645171 data packets ... discarded for bad header offset fields ... 790 connections established ...
    (freebsd-questions)
  • Re: IP Spoofing
    ... That would be enough if the purpose of the request was e.g. to delete a database by SQL injection. ... You would not need to keep it in 7 packets, merely to send in a TCP window - pretty large these days, BUT you would also need to cut in on an existing ESTABLISHED session. ... it is quite possible to send packets to the server without anything. ...
    (comp.lang.php)
  • Re: Problem with writing fast UDP server
    ... UDP packets per second. ... socket and threads. ... I wrote a simple case test: client and server. ... The maximum theoretical limit is 14,880 frames per ...
    (comp.lang.python)