Application Layer Rate Limiting
PrrtSocket_send should not take an indefinite number of packets.
1) Introduce a socket option and limit queue
- Add the following application parameter
- Block on
2) Move outQueue and condition variables in separate struct
- 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).