Skip to content

Application Layer Rate Limiting

Description

PrrtSocket_send should not take an indefinite number of packets.

Iterations

1) Introduce a socket option and limit queue

  • Add the following application parameter
PrrtSocket_set_opt("app_queue_size", 1000)
  • Block on List_push if List_size() is >= app_queue_size.

2) Move outQueue and condition variables in separate struct

  • Add PrrtApplicationQueue store (under proto/stores)
  • Move condition variable and mutexes to this.
  • Rename mutex outQueueFilled into something that indicates "NonEmpty".
  • Add condition variable that indicates "NotFull".
  • Ensure that PrrtSocket_send is pushing and gets blocked if full (subscribing to NotFullCV).
  • Ensure that dataTransmitter pops and blocks if empty (subscribing to NonEmptyCV).

3) Automatically set parameters

  • The channel state information "bottleneck bandwidth" and "rtt" are measured.
  • Based on these, it is possible to calculate the BDP.
  • Using the BDP, the size of the ApplicationQueue can be limited (subtracting the packets already saved to the block store).

Note: This might also be influenced by joint work on cross-layer pacing (idea: OS throttles the application directly).