corrected rtt estimation
This commit is contained in:
parent
5adc2c608e
commit
ee5395629e
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user