udt
Class UDTCongestionControl

java.lang.Object
  extended by udt.UDTCongestionControl
All Implemented Interfaces:
CongestionControl
Direct Known Subclasses:
SimpleTCP

public class UDTCongestionControl
extends Object
implements CongestionControl

default UDT congestion control.
The algorithm is adapted from the C++ reference implementation.


Field Summary
protected  long ackInterval
           
protected  double congestionWindowSize
           
protected  long estimatedLinkCapacity
           
protected  long packetArrivalRate
           
protected  double packetSendingPeriod
           
protected  long roundTripTime
           
protected  UDTSession session
           
protected  UDTStatistics statistics
           
 
Constructor Summary
UDTCongestionControl(UDTSession session)
           
 
Method Summary
 void close()
          Callback function to be called when a UDT connection is closed.
 long getAckInterval()
          get the ACK interval.
 double getCongestionWindowSize()
          congestionWindowSize
 long getEstimatedLinkCapacity()
          get the current value of the estimated link capacity
 long getPacketArrivalRate()
          get the current value of the packet arrival
 double getSendInterval()
          get the current value of the inter-packet interval in microseconds
 void init()
          Callback function to be called (only) at the start of a UDT connection.
 void onACK(long ackSeqno)
          Callback function to be called when an ACK packet is received.
 void onLoss(List<Integer> lossInfo)
          Callback function to be called when a loss report is received.
 void onPacketReceive(long packetSeqNo)
          Callback function to be called when a data packet is received.
 void onPacketSend(long packetSeqNo)
          Callback function to be called when a data packet is sent.
 void onTimeout()
          Callback function to be called when a timeout event occurs
 void setAckInterval(long ackInterval)
          set the ACK interval.
 void setRTT(long rtt, long rttVar)
          set roundtrip time and associated variance
 void updatePacketArrivalRate(long rate, long linkCapacity)
          update packet arrival rate and link capacity with the values received in an ACK packet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected final UDTSession session

statistics

protected final UDTStatistics statistics

roundTripTime

protected long roundTripTime

packetArrivalRate

protected long packetArrivalRate

estimatedLinkCapacity

protected long estimatedLinkCapacity

packetSendingPeriod

protected double packetSendingPeriod

congestionWindowSize

protected double congestionWindowSize

ackInterval

protected long ackInterval
Constructor Detail

UDTCongestionControl

public UDTCongestionControl(UDTSession session)
Method Detail

init

public void init()
Description copied from interface: CongestionControl
Callback function to be called (only) at the start of a UDT connection. when the UDT socket is conected

Specified by:
init in interface CongestionControl

setRTT

public void setRTT(long rtt,
                   long rttVar)
Description copied from interface: CongestionControl
set roundtrip time and associated variance

Specified by:
setRTT in interface CongestionControl
Parameters:
rtt - - round trip time in microseconds
rttVar - - round trip time variance in microseconds

updatePacketArrivalRate

public void updatePacketArrivalRate(long rate,
                                    long linkCapacity)
Description copied from interface: CongestionControl
update packet arrival rate and link capacity with the values received in an ACK packet

Specified by:
updatePacketArrivalRate in interface CongestionControl
Parameters:
rate - - packet rate in packets per second
linkCapacity - - estimated link capacity in packets per second

getPacketArrivalRate

public long getPacketArrivalRate()
Description copied from interface: CongestionControl
get the current value of the packet arrival

Specified by:
getPacketArrivalRate in interface CongestionControl

getEstimatedLinkCapacity

public long getEstimatedLinkCapacity()
Description copied from interface: CongestionControl
get the current value of the estimated link capacity

Specified by:
getEstimatedLinkCapacity in interface CongestionControl

getSendInterval

public double getSendInterval()
Description copied from interface: CongestionControl
get the current value of the inter-packet interval in microseconds

Specified by:
getSendInterval in interface CongestionControl

getAckInterval

public long getAckInterval()
Description copied from interface: CongestionControl
get the ACK interval. If larger than 0, the receiver should acknowledge every n'th packet

Specified by:
getAckInterval in interface CongestionControl

setAckInterval

public void setAckInterval(long ackInterval)
Description copied from interface: CongestionControl
set the ACK interval. If larger than 0, the receiver should acknowledge every n'th packet

Specified by:
setAckInterval in interface CongestionControl

getCongestionWindowSize

public double getCongestionWindowSize()
congestionWindowSize

Specified by:
getCongestionWindowSize in interface CongestionControl
Returns:

onACK

public void onACK(long ackSeqno)
Description copied from interface: CongestionControl
Callback function to be called when an ACK packet is received.

Specified by:
onACK in interface CongestionControl
Parameters:
ackSeqno - - the data sequence number acknowledged by this ACK. see spec. page(16-17)

onLoss

public void onLoss(List<Integer> lossInfo)
Description copied from interface: CongestionControl
Callback function to be called when a loss report is received.

Specified by:
onLoss in interface CongestionControl
Parameters:
lossInfo - - list of sequence number of packets

onTimeout

public void onTimeout()
Description copied from interface: CongestionControl
Callback function to be called when a timeout event occurs

Specified by:
onTimeout in interface CongestionControl

onPacketSend

public void onPacketSend(long packetSeqNo)
Description copied from interface: CongestionControl
Callback function to be called when a data packet is sent.

Specified by:
onPacketSend in interface CongestionControl
Parameters:
packetSeqNo - - the data packet sequence number

onPacketReceive

public void onPacketReceive(long packetSeqNo)
Description copied from interface: CongestionControl
Callback function to be called when a data packet is received.

Specified by:
onPacketReceive in interface CongestionControl
Parameters:
packetSeqNo - - the data packet sequence number.

close

public void close()
Description copied from interface: CongestionControl
Callback function to be called when a UDT connection is closed.

Specified by:
close in interface CongestionControl


Copyright © 2013 LittleShoot. All Rights Reserved.