Skip to content

Commit

Permalink
Make ACK_RECEIVE_TIMESTAMPS frame Gap more efficient and QUIC-like.
Browse files Browse the repository at this point in the history
Per TBD IETF receive timestamp proposal:
https://github.com/wcsmith/draft-quic-receive-ts

   Gap:  A variable-length integer indicating the largest packet number
      in the Timestamp Range as follows:

      For the first Timestamp Range: Gap is the difference between (a)
      the Largest Acknowledged packet number in the frame and (b) the
      largest packet in the current (first) Timestamp Range.

      For subsequent Timestamp Ranges: Gap is the difference between (a)
      the packet number two lower than the smallest packet number in the
      previous Timestamp Range and (b) the largest packet in the current
      Timestamp Range.
  • Loading branch information
wcsmith committed Oct 23, 2021
1 parent 063d88c commit bc52a60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions quic/core/quic_framer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4188,10 +4188,11 @@ bool QuicFramer::ProcessIetfTimestampsInAckFrame(QuicPacketNumber largest_acked,
return false;
}
}
visitor_->OnAckTimestamp(packet_number - j,
visitor_->OnAckTimestamp(packet_number,
creation_time_ + last_timestamp_);
packet_number--;
}
packet_number = packet_number - (timestamp_count - 1);
packet_number--;
}
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions quic/core/quic_framer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4113,15 +4113,15 @@ TEST_P(QuicFramerTest, AckFrameMultipleReceiveTimestampRanges) {

// Timestamp range 2 (one packet).
{ "Unable to read receive timestamp gap.",
{ kVarInt62OneByte + 0x07 }},
{ kVarInt62OneByte + 0x05 }},
{ "Unable to read receive timestamp count.",
{ kVarInt62OneByte + 0x01 }},
{ "Unable to read receive timestamp delta.",
{ kVarInt62TwoBytes + 0x10, 0x00 }},

// Timestamp range 3 (two packets).
{ "Unable to read receive timestamp gap.",
{ kVarInt62OneByte + 0x0a }},
{ kVarInt62OneByte + 0x08 }},
{ "Unable to read receive timestamp count.",
{ kVarInt62OneByte + 0x02 }},
{ "Unable to read receive timestamp delta.",
Expand Down

0 comments on commit bc52a60

Please sign in to comment.