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(), time: time.Now(),
sequence: seq, 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) sort.Sort(c.awaitingAck)
@ -261,7 +261,7 @@ func (c *NewReno) receivedAck(ack uint32) {
return return
} }
c.inFlight = c.inFlight[i-1:] c.inFlight = c.inFlight[i:]
if c.slowStart { if c.slowStart {
c.windowSize += uint32(i) c.windowSize += uint32(i)
} else { } else {

View File

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