Better naming/logging for send side bwe (#3264)

* Better naming/logging for send side bwe

* Check BWE congestion state before doing optimal allocation.

It is possible that BWE declares congestion, but the estimated bandwidth
may still be enough to accommodate all tracks. So, stream allocator
would still not in DEFICIENT state. On a new track allocation, it will
get optimal allocation although BWE is in congested state.

Take BWE congestion state into consideration before doing any track
allocation.

* get congestion state from BWE rather than caching it in stream allocator

* get states from update

* log contributing groups only when they are small in number

* get oldest group always

* notify only when estimate is dropping

* require stronger CTR down trend

* maintain min/max group

* relax thresholds to declare congestion a bit
This commit is contained in:
Raja Subramanian
2024-12-18 21:38:13 +05:30
committed by GitHub
parent 90804c553e
commit b6e99e249b
8 changed files with 177 additions and 132 deletions
+11 -11
View File
@@ -39,7 +39,7 @@ type PacketGroupConfig struct {
var (
defaultPacketGroupConfig = PacketGroupConfig{
MinPackets: 20,
MinPackets: 30,
MaxWindowDuration: 500 * time.Millisecond,
}
)
@@ -142,18 +142,18 @@ type packetGroup struct {
lost classStat
snBitmap *utils.Bitmap[uint64]
aggregateSendDelta int64
aggregateRecvDelta int64
queuingDelay int64
aggregateSendDelta int64
aggregateRecvDelta int64
inheritedQueuingDelay int64
isFinalized bool
}
func newPacketGroup(params packetGroupParams, queuingDelay int64) *packetGroup {
func newPacketGroup(params packetGroupParams, inheritedQueuingDelay int64) *packetGroup {
return &packetGroup{
params: params,
queuingDelay: queuingDelay,
snBitmap: utils.NewBitmap[uint64](params.Config.MinPackets),
params: params,
inheritedQueuingDelay: inheritedQueuingDelay,
snBitmap: utils.NewBitmap[uint64](params.Config.MinPackets),
}
}
@@ -231,8 +231,8 @@ func (p *packetGroup) SendWindow() (int64, int64) {
}
func (p *packetGroup) PropagatedQueuingDelay() int64 {
if p.queuingDelay+p.aggregateRecvDelta-p.aggregateSendDelta > 0 {
return p.queuingDelay + p.aggregateRecvDelta - p.aggregateSendDelta
if p.inheritedQueuingDelay+p.aggregateRecvDelta-p.aggregateSendDelta > 0 {
return p.inheritedQueuingDelay + p.aggregateRecvDelta - p.aggregateSendDelta
}
return max(0, p.aggregateRecvDelta-p.aggregateSendDelta)
@@ -290,7 +290,7 @@ func (p *packetGroup) MarshalLogObject(e zapcore.ObjectEncoder) error {
})
ts.Merge(p.Traffic())
e.AddObject("trafficStats", ts)
e.AddInt64("queuingDelay", p.queuingDelay)
e.AddInt64("inheritedQueuingDelay", p.inheritedQueuingDelay)
e.AddInt64("propagatedQueuingDelay", p.PropagatedQueuingDelay())
e.AddBool("isFinalized", p.isFinalized)