corrected rtt estimation
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Jake Hillion 2021-03-22 19:35:24 +00:00
parent 5adc2c608e
commit ee5395629e
2 changed files with 22 additions and 16 deletions

View File

@ -161,7 +161,7 @@ func (c *NewReno) receivedSequence(seq uint32) {
time: time.Now(),
sequence: seq,
})
return // if this seq doesn't change the ack field, awaitingAck will still not do anything useful
return // if this seq doesn't change the ack field, updateAck will still not do anything useful
}
sort.Sort(c.awaitingAck)
@ -261,7 +261,7 @@ func (c *NewReno) receivedAck(ack uint32) {
return
}
c.inFlight = c.inFlight[i-1:]
c.inFlight = c.inFlight[i:]
if c.slowStart {
c.windowSize += uint32(i)
} else {

View File

@ -97,14 +97,17 @@ func (n *newRenoTest) RunSideA(ctx context.Context) {
}
seq := n.sideA.AwaitEarlyUpdate(500 * time.Millisecond)
if seq == 0 { // discard keepalives
p := congestionPacket{
seq: seq,
nack: n.sideA.NextNack(),
ack: n.sideA.NextAck(),
}
n.aOutbound <- p
if seq != 0 {
// skip keepalive
// required to ensure AwaitEarlyUpdate terminates
continue
}
p := congestionPacket{
seq: seq,
nack: n.sideA.NextNack(),
ack: n.sideA.NextAck(),
}
n.aOutbound <- p
}
}()
}
@ -129,14 +132,17 @@ func (n *newRenoTest) RunSideB(ctx context.Context) {
}
seq := n.sideB.AwaitEarlyUpdate(500 * time.Millisecond)
if seq == 0 { // discard keepalives
p := congestionPacket{
seq: seq,
nack: n.sideB.NextNack(),
ack: n.sideB.NextAck(),
}
n.bOutbound <- p
if seq != 0 {
// skip keepalive
// required to ensure AwaitEarlyUpdate terminates
continue
}
p := congestionPacket{
seq: seq,
nack: n.sideB.NextNack(),
ack: n.sideB.NextAck(),
}
n.bOutbound <- p
}
}()
}