Skip to content
Snippets Groups Projects
  1. Nov 03, 2021
  2. Jun 11, 2021
  3. Jun 18, 2020
  4. May 13, 2019
  5. Jan 13, 2019
  6. Oct 19, 2018
  7. Jan 29, 2018
    • Mao Zhongyi's avatar
      colo: compare the packet based on the tcp sequence number · f449c9e5
      Mao Zhongyi authored
      
      Packet size some time different or when network is busy.
      Based on same payload size, but TCP protocol can not
      guarantee send the same one packet in the same way,
      
      like that:
      We send this payload:
      ------------------------------
      | header |1|2|3|4|5|6|7|8|9|0|
      ------------------------------
      
      primary:
      ppkt1:
      ----------------
      | header |1|2|3|
      ----------------
      ppkt2:
      ------------------------
      | header |4|5|6|7|8|9|0|
      ------------------------
      
      secondary:
      spkt1:
      ------------------------------
      | header |1|2|3|4|5|6|7|8|9|0|
      ------------------------------
      
      In the original method, ppkt1 and ppkt2 are different in size and
      spkt1, so they can't compare and trigger the checkpoint.
      
      I have tested FTP get 200M and 1G file many times, I found that
      the performance was less than 1% of the native.
      
      Now I reconstructed the comparison of TCP packets based on the
      TCP sequence number. first of all, ppkt1 and spkt1 have the same
      starting sequence number, so they can compare, even though their
      length is different. And then ppkt1 with a smaller payload length
      is used as the comparison length, if the payload is same, send
      out the ppkt1 and record the offset(the length of ppkt1 payload)
      in spkt1. The next comparison, ppkt2 and spkt1 can be compared
      from the recorded position of spkt1.
      
      like that:
      ----------------
      | header |1|2|3| ppkt1
      ---------|-----|
               |     |
      ---------v-----v--------------
      | header |1|2|3|4|5|6|7|8|9|0| spkt1
      ---------------|\------------|
                     | \offset     |
            ---------v-------------v
            | header |4|5|6|7|8|9|0| ppkt2
            ------------------------
      
      In this way, the performance can reach native 20% in my multiple
      tests.
      
      Cc: Zhang Chen <zhangckid@gmail.com>
      Cc: Li Zhijian <lizhijian@cn.fujitsu.com>
      Cc: Jason Wang <jasowang@redhat.com>
      
      Signed-off-by: default avatarMao Zhongyi <maozy.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: default avatarZhang Chen <zhangckid@gmail.com>
      Reviewed-by: default avatarZhang Chen <zhangckid@gmail.com>
      Tested-by: default avatarZhang Chen <zhangckid@gmail.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      f449c9e5
  8. Nov 13, 2017
  9. Jul 17, 2017
  10. Sep 27, 2016
Loading