You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2017/11/28 12:10:00 UTC

[trafficserver] branch quic-latest updated: Remove timestamp section from ACK frame

This is an automated email from the ASF dual-hosted git repository.

maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new 7db8876  Remove timestamp section from ACK frame
7db8876 is described below

commit 7db88767ddcabfd3e03f5ff6944309f94869eea0
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Nov 28 21:09:22 2017 +0900

    Remove timestamp section from ACK frame
---
 iocore/net/quic/QUICFrame.cc           | 66 ++++------------------------------
 iocore/net/quic/QUICFrame.h            | 14 --------
 iocore/net/quic/test/test_QUICFrame.cc | 25 +++++--------
 3 files changed, 16 insertions(+), 89 deletions(-)

diff --git a/iocore/net/quic/QUICFrame.cc b/iocore/net/quic/QUICFrame.cc
index 4fb864b..a9b4520 100644
--- a/iocore/net/quic/QUICFrame.cc
+++ b/iocore/net/quic/QUICFrame.cc
@@ -316,8 +316,9 @@ size_t
 QUICAckFrame::size() const
 {
   if (this->_buf) {
-    return this->_get_timestamp_section_offset() + this->timestamp_section()->size();
+    return this->_get_ack_block_section_offset() + this->ack_block_section()->size();
   } else {
+    // TODO Not implemented
     return 0;
   }
 }
@@ -339,9 +340,6 @@ QUICAckFrame::store(uint8_t *buf, size_t *len) const
     p += 1;
   }
 
-  *p = this->_timestamp_section->count();
-  p += 1;
-
   // "LL" of "101NLLMM"
   if (this->_largest_acknowledged <= 0xff) {
     QUICTypeUtil::write_uint_as_nbytes(this->_largest_acknowledged, 1, p, &n);
@@ -367,9 +365,6 @@ QUICAckFrame::store(uint8_t *buf, size_t *len) const
   this->_ack_block_section->store(p, &n);
   p += n;
 
-  this->_timestamp_section->store(p, &n);
-  p += n;
-
   *len = p - buf;
 }
 
@@ -387,12 +382,6 @@ QUICAckFrame::num_blocks() const
   }
 }
 
-uint8_t
-QUICAckFrame::num_timestamps() const
-{
-  return this->_buf[this->_get_num_timestamp_offset()];
-}
-
 QUICPacketNumber
 QUICAckFrame::largest_acknowledged() const
 {
@@ -439,22 +428,6 @@ QUICAckFrame::ack_block_section() const
   return this->_ack_block_section;
 }
 
-const QUICAckFrame::TimestampSection *
-QUICAckFrame::timestamp_section() const
-{
-  return this->_timestamp_section;
-}
-
-size_t
-QUICAckFrame::_get_num_timestamp_offset() const
-{
-  if (this->has_ack_blocks()) {
-    return 2;
-  } else {
-    return 1;
-  }
-}
-
 /**
  * LL of 101NLLMM
  */
@@ -474,7 +447,11 @@ QUICAckFrame::_get_largest_acknowledged_length() const
 size_t
 QUICAckFrame::_get_largest_acknowledged_offset() const
 {
-  return this->_get_num_timestamp_offset() + 1;
+  if (this->has_ack_blocks()) {
+    return 2;
+  } else {
+    return 1;
+  }
 }
 
 /**
@@ -505,12 +482,6 @@ QUICAckFrame::_get_ack_block_section_offset() const
   return this->_get_ack_delay_offset() + 2;
 }
 
-size_t
-QUICAckFrame::_get_timestamp_section_offset() const
-{
-  return this->_get_ack_block_section_offset() + this->ack_block_section()->size();
-}
-
 QUICAckFrame::AckBlockSection::AckBlockSection(const uint8_t *buf, uint8_t num_blocks, uint8_t ack_block_length)
 {
   this->_buf              = buf;
@@ -637,29 +608,6 @@ QUICAckFrame::AckBlockSection::const_iterator::const_iterator(uint8_t index, con
   }
 }
 
-uint8_t
-QUICAckFrame::TimestampSection::count() const
-{
-  return 0;
-}
-
-size_t
-QUICAckFrame::TimestampSection::size() const
-{
-  return 0;
-}
-
-void
-QUICAckFrame::TimestampSection::store(uint8_t *buf, size_t *len) const
-{
-  if (this->count() == 0) {
-    *len = 0;
-    return;
-  }
-
-  // TODO: Store timestamp data
-}
-
 //
 // RST_STREAM frame
 //
diff --git a/iocore/net/quic/QUICFrame.h b/iocore/net/quic/QUICFrame.h
index 87509aa..43c52b5 100644
--- a/iocore/net/quic/QUICFrame.h
+++ b/iocore/net/quic/QUICFrame.h
@@ -170,15 +170,6 @@ public:
     std::vector<QUICAckFrame::AckBlock> _ack_blocks;
   };
 
-  class TimestampSection
-  {
-  public:
-    uint8_t count() const;
-    size_t size() const;
-    void store(uint8_t *buf, size_t *len) const;
-    void add_timestamp();
-  };
-
   QUICAckFrame() : QUICFrame() {}
   QUICAckFrame(const uint8_t *buf, size_t len);
   QUICAckFrame(QUICPacketNumber largest_acknowledged, uint16_t ack_delay, uint64_t first_ack_block_length);
@@ -188,26 +179,21 @@ public:
   virtual size_t size() const override;
   virtual void store(uint8_t *buf, size_t *len) const override;
   uint8_t num_blocks() const;
-  uint8_t num_timestamps() const;
   QUICPacketNumber largest_acknowledged() const;
   uint16_t ack_delay() const;
   const AckBlockSection *ack_block_section() const;
   AckBlockSection *ack_block_section();
-  const TimestampSection *timestamp_section() const;
   bool has_ack_blocks() const;
 
 private:
-  size_t _get_num_timestamp_offset() const;
   size_t _get_largest_acknowledged_offset() const;
   size_t _get_largest_acknowledged_length() const;
   size_t _get_ack_block_length() const;
   size_t _get_ack_delay_offset() const;
   size_t _get_ack_block_section_offset() const;
-  size_t _get_timestamp_section_offset() const;
   QUICPacketNumber _largest_acknowledged = 0;
   uint16_t _ack_delay                    = 0;
   AckBlockSection *_ack_block_section    = nullptr;
-  TimestampSection *_timestamp_section   = nullptr;
 };
 
 //
diff --git a/iocore/net/quic/test/test_QUICFrame.cc b/iocore/net/quic/test/test_QUICFrame.cc
index 434ef93..1e2969c 100644
--- a/iocore/net/quic/test/test_QUICFrame.cc
+++ b/iocore/net/quic/test/test_QUICFrame.cc
@@ -237,50 +237,44 @@ TEST_CASE("Store STREAM Frame", "[quic]")
 
 TEST_CASE("Load Ack Frame 1", "[quic]")
 {
-  // 0 Ack Block, 0 Timestamp, 8 bit packet number length, 8 bit block length
+  // 0 Ack Block, 8 bit packet number length, 8 bit block length
   uint8_t buf1[] = {
     0xA0,       // 101NLLMM
-    0x00,       // NumTS
     0x12,       // Largest Acknowledged
     0x34, 0x56, // Ack Delay
     0x00,       // Ack Block Section
   };
   std::shared_ptr<const QUICFrame> frame1 = QUICFrameFactory::create(buf1, sizeof(buf1));
   CHECK(frame1->type() == QUICFrameType::ACK);
-  CHECK(frame1->size() == 6);
+  CHECK(frame1->size() == 5);
   std::shared_ptr<const QUICAckFrame> ackFrame1 = std::dynamic_pointer_cast<const QUICAckFrame>(frame1);
   CHECK(ackFrame1 != nullptr);
   CHECK(ackFrame1->has_ack_blocks() == false);
-  CHECK(ackFrame1->num_timestamps() == 0);
   CHECK(ackFrame1->largest_acknowledged() == 0x12);
   CHECK(ackFrame1->ack_delay() == 0x3456);
 
-  // TODO: 1 Ack Block, 0 Timestamp
-  // TODO: 1 Ack Block, 1 Timestamp
+  // TODO: 1 Ack Block
 }
 
 TEST_CASE("Load Ack Frame 2", "[quic]")
 {
-  // 0 Ack Block, 0 Timestamp, 8 bit packet number length, 8 bit block length
+  // 0 Ack Block, 8 bit packet number length, 8 bit block length
   uint8_t buf1[] = {
     0xAA,                   // 101NLLMM '0b10101010' { N: 0, LL: 10, MM:10 }
-    0x00,                   // NumTS
     0x00, 0x00, 0x00, 0x01, // Largest Acknowledged
     0x01, 0x71,             // Ack Delay
     0x00, 0x00, 0x00, 0x01, // ACK Block
   };
   std::shared_ptr<const QUICFrame> frame1 = QUICFrameFactory::create(buf1, sizeof(buf1));
   CHECK(frame1->type() == QUICFrameType::ACK);
-  CHECK(frame1->size() == 12);
+  CHECK(frame1->size() == 11);
   std::shared_ptr<const QUICAckFrame> ackFrame1 = std::dynamic_pointer_cast<const QUICAckFrame>(frame1);
   CHECK(ackFrame1 != nullptr);
   CHECK(ackFrame1->has_ack_blocks() == false);
-  CHECK(ackFrame1->num_timestamps() == 0);
   CHECK(ackFrame1->largest_acknowledged() == 0x01);
   CHECK(ackFrame1->ack_delay() == 0x0171);
 
-  // TODO: 1 Ack Block, 0 Timestamp
-  // TODO: 1 Ack Block, 1 Timestamp
+  // TODO: 1 Ack Block
 }
 
 TEST_CASE("Store Ack Frame", "[quic]")
@@ -288,20 +282,19 @@ TEST_CASE("Store Ack Frame", "[quic]")
   uint8_t buf[65535];
   size_t len;
 
-  // 0 Ack Block, 0 Timestamp, 8 bit packet number length, 8 bit block length
+  // 0 Ack Block, 8 bit packet number length, 8 bit block length
   uint8_t expected[] = {
     0xA2,                   // 101NLLMM
-    0x00,                   // NumTS
     0x12,                   // Largest Acknowledged
     0x34, 0x56,             // Ack Delay
     0x00, 0x00, 0x00, 0x00, // Ack Block Section
   };
   QUICAckFrame ackFrame(0x12, 0x3456, 0);
   ackFrame.store(buf, &len);
-  CHECK(len == 9);
+  CHECK(len == 8);
   CHECK(memcmp(buf, expected, len) == 0);
 
-  // TODO: Add ack blocks and timestamps
+  // TODO: Add ack blocks
 }
 
 TEST_CASE("Load RST_STREAM Frame", "[quic]")

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].