udt.receiver
Class PacketPairWindow

java.lang.Object
  extended by udt.util.CircularArray<Long>
      extended by udt.receiver.PacketPairWindow

public class PacketPairWindow
extends CircularArray<Long>

a circular array that records time intervals between two probing data packets. It is used to determine the estimated link capacity.

See Also:
CircularArray}

Field Summary
 
Fields inherited from class udt.util.CircularArray
circularArray, haveOverflow, max, position
 
Constructor Summary
PacketPairWindow(int size)
          construct a new packet pair window with the given size
 
Method Summary
 double computeMedianTimeInterval()
          compute the median packet pair interval of the last 16 packet pair intervals (PI).
 long getEstimatedLinkCapacity()
          compute the estimated linK capacity using the values in packet pair window
 
Methods inherited from class udt.util.CircularArray
add, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PacketPairWindow

public PacketPairWindow(int size)
construct a new packet pair window with the given size

Parameters:
size -
Method Detail

computeMedianTimeInterval

public double computeMedianTimeInterval()
compute the median packet pair interval of the last 16 packet pair intervals (PI). (see specification section 6.2, page 12)

Returns:
time interval in microseconds

getEstimatedLinkCapacity

public long getEstimatedLinkCapacity()
compute the estimated linK capacity using the values in packet pair window

Returns:
number of packets per second


Copyright © 2013 LittleShoot. All Rights Reserved.