The application used in our study is a simple data transmission application (Fig. 2). It has two functions: compression and transmission, with the cooperation of the following three modules:
To send out a large amount of data, the application first splits it into multiple chunks, and processes each chunk separately. For each chunk of data, it first calculates the total execution time with and without compression using the parameters from Network Module and Compression Module, compares them and makes the decision how to transfer the data. Network Module provides the available bandwidth information, which is used to compute the network transmission time; Compression Module maintains the empirical data related with the specific compression algorithm - compression speed and compression ratio, which are used to calculate the local compression time.
If the application decides not to use compression, the original data will be simply sent out. Otherwise, it will be "forwarded" to the Compression Module, where it is compressed, before being sent to the server. During that procedure, a simple application protocol is used to tell the server the transmitted data needs decompression. The pseudocode for the application is shown in Fig. 3.