<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>CRC Check in a High-Speed Connectionless File Transfer System∗</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Robert Tornai</string-name>
          <email>tornai.robert@inf.unideb.hu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dalma Kiss-Imre</string-name>
          <email>imre.dalma99@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zoltán Gál</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>AMS Subject Classification: 68M10</institution>
          ,
          <addr-line>68M12</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Proceedings of the 1</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Debrecen, Faculty of Informatics</institution>
        </aff>
      </contrib-group>
      <fpage>226</fpage>
      <lpage>232</lpage>
      <abstract>
        <p>This paper describes the usage of CRC checking in an application named FMFT (Fast Manager of File Transfer) that is based on Xinan Liu's Reliable File Transfer Protocol. The system consists of a server and a client C++ program utilizing UDP connection. The aim is to transfer big files quickly by using this program on busy network connections. The   -based minimum viable product relying on Xinan Liu's solution was rewritten in C++ and enhanced by adding control over chunk size. To make this program available for as many platforms as possible, WebAssembly programming language was used. This article introduces the performance results of the utilization of CRC checking of sent and received packages. Finally, it will be discussed that thanks to an advanced scheduling, our application can utilize the network more eficiently.</p>
      </abstract>
      <kwd-group>
        <kwd>CRC checking</kwd>
        <kwd>high-speed networking</kwd>
        <kwd>high-performance computing</kwd>
        <kwd>Internet</kwd>
        <kwd>parallel communication</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Transferring a huge amount of data between workstations and supercomputer nodes
for processing introduces new problems: not only the upload process is slow, but
the result can be huge also to download. Even gigabit connections can slow down
to a few megabit range in a busy network in real-life use cases having even packet
loss or damage [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], as we experienced this at file transfers forth and back with a
server hosted in the Gyires supercomputer’s data center [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. This paper will focus
on the integrity of the transferred packages and the performance hit caused by the
handling algorithm. Furthermore, the scheduling of packages will be discussed too.
      </p>
      <p>Transmission Control Protocol (TCP) based solutions have a lot of problems
with trafic control. Usually, the transfer rate fluctuates a lot, even having just
a small extra data transfer on the network from other nodes. A User Datagram
Protocol (UDP) based software handles big data transfers a way better. Albeit,
they have a challenge of the feedback of the unsuccessfully transferred packages.
By creating a UDP based high-speed file transfer system, the demand to quickly
move huge data between supercomputer nodes and workstations could be satisfied.</p>
      <p>
        The UFTP and UFTPD software pair mostly accomplishes our needed features
[
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. However, it is not available in browsers, which is a basic requirement in our
project. The whole source code of the two applications of UFTP and UFTPD
should be modified to be able to compile for WebAssembly. Instead of this, we
decided to write an own implementation designed for WASM from scratch, this
way it can be run in modern browsers [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        Xinan Liu’s Reliable File Transfer Protocol was chosen for the starting point of
the development work, because beside its small code base it achieved the first place
in CS2105 (Introduction to Computer Networks) Speed Contest AY15/16 Sem1.
Moreover, we implemented the Stream Control Transmission Protocol (SCTP [
        <xref ref-type="bibr" rid="ref4 ref9">4,
9</xref>
        ]) in our software, which is able to handle the data transfer and control feedback
by utilizing both TCP and UDP protocols.
      </p>
      <p>The structure of the paper consists of four main chapters. The development
environment of the Fast Manager of File Transfer application is described in
chapter two. In chapter three CRC checking is presented. Performance hints related
to scheduling of packages are given in chapter four. The achievements, possible
continuation, future research and development aims are enlisted in chapter five.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Developing Environment</title>
      <p>
        We chose Qt 5.15.1 stable version for the platform-independent development. The
work was carried out on a Debian 10.5 workstation. Mobile equipment as Android
and iOS has Qt support. Furthermore, it has a lot of desktop operating system
targets as Windows, Linux and macOS. In recent years one of the most interesting
new platform is WebAssembly [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], through this technology almost native speed
program running is available from modern web browsers.
      </p>
      <p>
        The chosen programming language is the highly portable  ++11, on the
contrary of QML. The server was created for command line usage. The client was
designed to have a native GUI on the actual operating system (see Figure 1). The
WebAssembly client is lacking SCTP support right now. After we had tested our
SCTP file transfer system for desktop operating systems, we found that the
performance of the TCP based FTP transfer and our SCTP and UDP based file transfer
implementations need more comprehensive investigations [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Diferent message
sizes shall be examined to find an optimal value for later use as default.
      </p>
      <p>
        Tests were carried out on a gigabit network. Firstly, we worked with the
TCPbased FTP protocol. Then the initial approach in our software was to have a UDP
data channel with a TCP control channel similar to SABUL [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] which lived on as
UDT until it was abandoned in 2013 [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Solutions based on UDP, especially by
adopting rate-based algorithms, give better performance than other alternatives
according to the work of Cosimo Anglano and Massimo Canonico [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Then we
decided to use a UDP channel in our software for the control messages also [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
On lost of either the data packet or the acknowledge packet, a resend is needed. It
is also true for the case when the integrity of the package is damaged. For the data
transfer we used QNetworkDatagram and QUdpSocket classes. We could observe
that the CPU usage of the  ++ version was less than the burden of our original
  code [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. CRC Checking</title>
      <p>The testing was carried over with a test file of 100 MB, we transferred data between
a desktop workstation and the test server which is in the Gyires supercomputer’s
server room. Figure 2 shows values of the successive transfers starting from 200
bytes to 4000 bytes of chunk sizes. It can be seen that without computing CRC-16
for data packets, the transfer rate maintains over 800 Mbps from chunk size of 1100
bytes up to 4000 bytes.</p>
      <p>1,000
]
s 800
p
b
M
[
e
t
a
r 600
r
e
f
s
n
a
r
T 400
200</p>
      <sec id="sec-3-1">
        <title>Transfer without computing CRC-16 Transfer with computing CRC-16</title>
        <p>200
1,000
2,000
3,000
4,000</p>
      </sec>
      <sec id="sec-3-2">
        <title>Chunk size [bytes]</title>
        <p>By computing CRC-16 for data packets, the transfer rate cross the 800 Mbps
boundary with 824 Mbps just at chunk size of 2400 bytes. The curve of results of
transfer rates with computing CRC-16 values stays almost entirely under the curve
of raw transfer of packages. This was consistent over various sized test data with
the diference being around 5% with higher than 2400 bytes chunk sizes. For small
chunk sizes as 900 bytes the diference can be as high as 37%. During our test runs
we have not encountered any package to fail the CRC-16 check. The reason for
this was maybe the fact that the packages had to travel a relatively few hops. For
longer data transfer paths having more hops it is potential to start having failing
packages at CRC-16 checking.</p>
        <p>The test server was a Cisco UCS C240 M5 having gigabit Ethernet connection,
connected to the Gyires supercomputer. The applied virtual machine runs Ubuntu
18.04.5 LTS server version under VMWare’s vSphere 6.7 having 20 GB memory
and 8 cores of an Intel® Xeon® Gold 6130 CPU @ 2.10 GHz. The test machine
has an Intel® Core™ i7 CPU 920 @ 2.67 GHz with 18 GB memory having gigabit
Ethernet connection, connected to the academic Internet network running Debian
10.5 desktop version.</p>
        <p>
          Qt has a function for calculating a checksum value since version 5.9: quint16
qChecksum(const char *data, uint len), which is applied for the sent and
received data packages in our server-client pair of programs. This function is using
the CRC-16-CCITT algorithm having a 16-bit cache conserving (16 entry table)
implementation [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]. It returns the CRC-16 checksum of the first len bytes of
array data. It is calculated according to the algorithm published in ISO 3309
(Qt::ChecksumIso3309) [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. Furthermore, the checksum is independent of the byte
order (endianness). It is very important in multiplatform projects.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Scheduling of Packages</title>
      <p>
        The first solution was to send packages continuously from the client to the server. It
meant that a lot of packages got lost, while the CPU and the network stack was at
maximum stress. The best packet transmission success rate for tests was 92.6% in
the   based minimum viable product. The reimplemented  ++ pair of software
decreased the packet transmission success rate to 83.3% what is explained by the
twofold increase in eficiency to stress both the CPU and the network stack. By
introducing a transfer rate cap at software side the packet transmission success rate
was increased over 90.0% again. The scheduling was based on one second length
bursts of packages. It means that after sending out enough number of packages of a
preset chunk size for the predetermined transfer rate, there was a pause in sending
until the next one second time slot. It gives network bufers an unnecessarily heavy
load at regular intervals. The next iteration was to fine tune the time interval to
one millisecond. The backside of this solution was that the precomputed number
of packages for one slot was rather small for higher chunk sizes. This means that
the predetermined transfer rate may be achieved by only a relatively big margin,
while the success rate improvement was not that great. Although, the CPU and
network stress became smaller. The final solution was to use a nanosecond timer
for scheduling. At each timer event we check one second history of sent packages.
If it shows that the actual transfer rate is under the desired target, the required
number of packages of the given chunk size is sent out to achieve the predetermined
transfer rate. Under normal circumstances it means only one extra packet to be
sent. The predetermined transfer rate is approximated accurately at a very low
margin this way. While it has even a little more stress on the CPU side, it further
minimizes the stress on the network stack and bufers. Consequently, it leads to
fewer lost and resent packages [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions and Future Work</title>
      <p>Our first   implementation was enhanced to a high-speed connectionless file
transfer system by using UDP control channel relying on Xinan Liu’s work. File
transfers were increased over 800 Mbps on busy connections. Using WebAssembly,
the client even runs in browsers. There is a chance for malicious nodes on the
network for tampering with packets using a man in the middle attack. Besides this
the integrity of the packets can be damaged by accidental bit alternations anywhere
in the network chain.</p>
      <p>CRC checking is a good and eficient way for identifying packet modifications.
A CRC-16-CCITT algorithm based solution was implemented to mitigate this kind
of damage. The transfer ratewith packets using a man-in-the-middle attack hit is
around 5% for usable chunk sizes, while the performance hit on CPU is
negligible. We have not encountered packets failing the CRC check. However, on longer
network paths it will be a more useful tool for reducing packet retransmissions.</p>
      <p>The entire data file should have a CRC-32 or CRC-64 test for ensuring the
integrity of the process. We have started to work on encryption also. It may be
improved by utilizing DTLS for securing the whole connection. The server shall be
made fully multithreaded to have a thread for each transfer session to service more
clients eficiently. Broken transfers will be enabled to resume later. The client will
be modified to be a dual-pane file transfer and manager software.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>C.</given-names>
            <surname>Anglano</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Canonico: Performance analysis of high-performance file transfer systems for Grid applications</article-title>
          , Special Issue: First International Workshop on Emerging Technologies for
          <article-title>Next-generation GRID (ETNGRID 2004) Vol18</article-title>
          .
          <source>Issue8 (July</source>
          <year>2006</year>
          ), pp.
          <fpage>807</fpage>
          -
          <lpage>816</lpage>
          , doi: https://doi.org/10.1002/cpe.976.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <source>[2] ChecksumIso3309, September</source>
          <volume>9</volume>
          ,
          <year>2020</year>
          , url: https://doc.qt.io/qt-5/qt.html#ChecksumType-enum.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>G.</given-names>
            <surname>Gallant: WebAssembly in Action</surname>
          </string-name>
          , 1st,
          <string-name>
            <given-names>Shelter</given-names>
            <surname>Island</surname>
          </string-name>
          , New York: Manning Publications Co.,
          <source>December</source>
          <volume>7</volume>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>K.</given-names>
            <surname>Gettman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Stewart</surname>
          </string-name>
          ,
          <string-name>
            <surname>Q.</surname>
          </string-name>
          <article-title>Xie: Stream Control Transmission Protocol (SCTP): A Reference Guide, 1st edition</article-title>
          ,
          <string-name>
            <surname>Addison-Wesley</surname>
            <given-names>Professional</given-names>
          </string-name>
          , Oct.
          <year>2001</year>
          , isbn:
          <fpage>978</fpage>
          -
          <lpage>0201721867</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Gu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Hong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mazzucco</surname>
          </string-name>
          ,
          <string-name>
            <surname>R.</surname>
          </string-name>
          <article-title>Grossman: SABUL: A high performance data transfer protocol</article-title>
          ,
          <source>IEEE COMMUNICATIONS LETTERS</source>
          (
          <year>2003</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Gyires</surname>
            <given-names>supercomputer</given-names>
          </string-name>
          ,
          <source>February</source>
          <volume>19</volume>
          ,
          <year>2021</year>
          , url: https://hpc.unideb.hu/hu/node/219.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Hori</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Sawashima</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Sunahara</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y.</surname>
          </string-name>
          <article-title>Oie: Performance Evaluation of UDP Trafic Afected by TCP Flows , in: IEICE TRANSACTIONS on Communications</article-title>
          , vol.
          <source>E81-B</source>
          , 8, Aug.
          <year>1998</year>
          , pp.
          <fpage>1616</fpage>
          -
          <lpage>1623</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Java</surname>
            <given-names>performance</given-names>
          </string-name>
          ,
          <source>The page was last edited on 7 November</source>
          <year>2019</year>
          , url: https://en.wikipedia.org/wiki/Java_performance#cite_note-43.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>V. C.</given-names>
            <surname>Leung</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. P.</given-names>
            <surname>Ribeiro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Wagner</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          <article-title>Iyengar: Multihomed Communication with SCTP (Stream Control Transmission Protocol), 1st</article-title>
          , CRC Press Taylor &amp; Francis Group,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>X.</given-names>
            <surname>Liu</surname>
          </string-name>
          : ReliableFileTransferProtocol, October
          <volume>30</volume>
          ,
          <year>2015</year>
          , url: https://github.com/xinan/ReliableFileTransferProtocol/tree/master/src.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>D.</given-names>
            <surname>Madhuri</surname>
          </string-name>
          , P. C.
          <article-title>Reddy: Performance comparison of TCP, UDP and SCTP in a wired network</article-title>
          ,
          <source>in: 2016 International Conference on Communication and Electronics Systems (ICCES)</source>
          , Coimbatore, India, Oct.
          <year>2016</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          , isbn:
          <fpage>978</fpage>
          -1-
          <fpage>5090</fpage>
          -1066-0, doi: https://doi.org/10.1109/CESYS.
          <year>2016</year>
          .
          <volume>7889934</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>R.</given-names>
            <surname>Mittal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Agarwal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ratnasamy</surname>
          </string-name>
          ,
          <string-name>
            <surname>S.</surname>
          </string-name>
          <article-title>Shenker: Universal Packet Scheduling</article-title>
          , in: url: https://people.eecs.berkeley.edu/~radhika/ups_nsdi16.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <source>[13] qChecksum, September</source>
          <volume>9</volume>
          ,
          <year>2020</year>
          , url: https://doc.qt.io/qt-5/qbytearray.html#qChecksum.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <article-title>Qt for WebAssembly</article-title>
          ,
          <source>last edited on 4 December</source>
          <year>2020</year>
          , url: https://wiki.qt.io/Qt_for_WebAssembly.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <source>[15] UDP-based Data Transfer Protocol, October</source>
          <volume>13</volume>
          ,
          <year>2020</year>
          , url: https://en.wikipedia.org/wiki/UDP-based_Data_Transfer_Protocol.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>UFTP - Encrypted</surname>
            <given-names>UDP</given-names>
          </string-name>
          based FTP with multicast,
          <source>April</source>
          <volume>22</volume>
          ,
          <year>2020</year>
          , url: http://uftp-multicast.sourceforge.net/.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>