net.i2p.client.streaming.impl

## Class SimpleBandwidthEstimator

- java.lang.Object
- - net.i2p.client.streaming.impl.SimpleBandwidthEstimator

- All Implemented Interfaces:
    BandwidthEstimator

      class SimpleBandwidthEstimator
      extends Object
      implements BandwidthEstimator

  A Westwood+ bandwidth estimator with a first stage anti-aliasing low pass filter based on RTT, and the time-varying Westwood filter based on inter-arrival time. Ref: TCP Westwood: End-to-End Congestion Control for Wired/Wireless Networks Casetti et al (Westwood) Ref: End-to-End Bandwidth Estimation for Congestion Control in Packet Networks Grieco and Mascolo (Westwood+) Adapted from: Linux kernel tcp_westwood.c (GPLv2)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleBandwidthEstimator(I2PAppContext ctx, ConnectionOptions opts)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSample(int acked)` Records an arriving ack.
    `float` | `getBandwidthEstimate()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleBandwidthEstimator

          SimpleBandwidthEstimator(I2PAppContext ctx,
                                   ConnectionOptions opts)

  - ### Method Detail

    - #### addSample

          public void addSample(int acked)

      Records an arriving ack.
      Specified by:
        `addSample` in interface `BandwidthEstimator`
      Parameters:
        `acked` - how many packets were acked with this ack

    - #### getBandwidthEstimate

          public float getBandwidthEstimate()

      Specified by:
        `getBandwidthEstimate` in interface `BandwidthEstimator`
      Returns:
        the current bandwidth estimate in packets/ms.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`