Methods for Priority Relaying of Multi-Stream Data at the Application Layer in the UAV Networks *

The article presents methods for relaying Multi-Stream data at the application layer of OSI model through a relay node in UAV networks - MS-AL-ARQ Relaying methods. MS-AL-ARQ method is taken as the principal one. One of the basic operating principles of Application Layer ARQ-based Multi-Streaming (MS-AL-ARQ) is to determine a lost fragment from one of the source nodes based on a sequence number with an IP address ID. After determination of the lost data fragment, a negative non-acknowledgment NACK is sent to the source node. A round trip time RTT is set, after each NACK to schedule the requesting process. This action is performed until data fragment is received or the data fragment timeout RTO expires. The main difference between MS-AL-ARQ and MS-AL-ARQ Relaying is that MS-AL-ARQ Relaying works with buffers on the source and destination nodes as well as working with a buffer on the relay node. To describe the methods, the definition of a leading/priority source node with sending video priority, was introduced. The core metrics for determination of the leading node is the packet delivery ratio (counter PDR), which calculates the value at the relay node in a given interval and only then transmits data to the recipient node. There are several options to define the leading/priority source node: default, static, and dynamic definition. In this case, the situation with the flying relay node and the ground relay node is considered separately. The choice of relay node position is related to the characteristics of the node. Thus, a ground-based relay node could be a laptop, where the computing resources are often higher and the memory capacity can allow storing incoming data for longer time periods and a flying relay node is represented by a UAV with limited productive resources. The final part presents a test bench for further laboratory testing of the MS-AL-ARQ Relaying method and the re-sults of laboratory tests confirming the relevance of developing algorithms based on MS-AL-ARQ Relaying methods.

Introduction oday, UAVs have become part of our daily life. Increasingly, one can observe the use of several UAVs in one network, mainly in the field of entertainment, where the drone show is the most striking example [1][2][3][4][5][6][7][8]. At the same time, the use of a swarm may also be of interest to UAV manufacturers, however, one should keep in mind the specifics of the task difficulty and deployment cost. As an example, the most justified scenario is the use of several UAVs as source nodes when monitoring the area in emergency situations. However, mountains, forests and other obstacles can produce difficulties to direct data transmission. The solution to the problem can be the use of one or more flying nodes as relay node(s), as shown in Figure 1.
The presence of one or more relay nodes can increase the network coverage and allow the inspection of large areas in a shorter time. In addition to the flying node-relay, an option with a groundbased relay node can also be considered. The use of a ground relay-node will allow using large computing resources, but the network coverage area will be reduced in comparison with a flying relay-node. In both cases considered: with the air and ground relay-node, the same problem can occur due to the overload of the input data buffer at the relay-node. Congestion will cause data packets to be dropped and degrade video QoS metrics. To solve the above T problem, the paper presents several methods for recovering lost data fragments through a relay node, while the basic principles of operation are taken from the previously proposed method MS-AL-ARQ.

Principles of operation of MS-AL-ARQ
The proposed relaying methods are based on the algorithm MS-AL-ARQ and AL-ARQ [9,10]. One of the basic principles of the algorithm is the determination of a lost fragment from one of the source nodes based on a sequence number with an IP address of node-densder. After determining the lost fragment, a NACK is sent to the source node. At the same time, the round trip time RTT is set, after which the NACK is sent again. This action will be repeated until: a data fragment is received or the data fragment timeout RTO expires. When running MS-AL-ARQ, it is necessary to create several buffers: on the source nodes and the base station (destination). In addition, MS-AL-ARQ has several implementations on the destination node: with multiple input buffers and with one common input buffer. At the same time, at the start of transmission, each data stream is sent to a separate application, i.e. for each source node, it is necessary to allocate a separate port. The RTO is calculated based on an approximation of the statistics about the round RTT (Round Trip Time) trip time, and is also given the value of the current smoothed cycle time SRTT (Smoothed Round Trip Time). These values were taken from the TCP protocol [11]. TCP uses a sender-initiated retransmission scheme that uses retransmission timeouts RTO and duplicate acknowledgment (ACK).

MS-AL-ARQ Relaying Methods
This section presents several methods based on MS-AL-ARQ with recommendations for their further application in UAV networks with multiple source nodes. In this case, it is worth considering separately the cases with the use of a ground relay node (Fig. 2, a) and a flying relay node (Fig. 2, b). The scenario works not with two playback buffers as in the MS-AL-ARQ, but with three buffers. The first on the source nodes to save the generated packets, the second at the relay-node to store the received packets and the last buffer on the destination node to ensure packet reordering, as shown in Figure 3. Today, UAV manufacturers use communication channels of domestic manufacturers. A communication channel works at the physical and data link layers of the OSI model. At the same time, the tasks of the network levels and other (higher) levels of the OSI model are solved on microcomputers as part of UAVs, for example, Raspberry or Jetson. The paper considers the construction of a UAV network model based on standard, built-in antennas in RaspberryPi and/or Jetson, i.e. the considered methods implementation is based on omnidirectional antennas, for example, M620720. Moreover, they operate at the application layer and in the future can be implemented as part of on-board computing systems independently on the communication channels mentioned above.
To describe the proposed methods, it is necessary to clarify the expression of the leading/priority source node, which will be given priority for sending video under a predefined criteria. The main metric for determining the leading node is the measured PDR, which calculates the value at the relay node in a given interval and only after that transmits data to the recipient node. There are several options for defining the leading/priority source node: default, static, and dynamic definition.

MS-AL-ARQ Default Relaying (MS-AL-ARQ DefR)
When the relay method works, all incoming requests will be processed, as shown in Figure 4. The execution of this method to the relay-node is a FIFO queue [12].

Fig. 4. Request processing scheme
When the method is running, all incoming requests are processed, after which NACK is sent as it arrives. Data from the relay node is transmitted to the ground station when the buffer timeout expires. Thus, the decision on the priority node is not made and all operations are carried out on the relay-node. It follows from this that when implementing a method based on the FIFO queue, it is more logical to use a ground relay-node, which can have large power characteristics. But the use of a flying relaynode with a small buffer size can also be considered.
This model works on the basis of a singlechannel queuing system with failure. The scheme of operation of such a system is shown in Figure 5. The state of the system S 0 indicates that the channel is free, and S 1 indicates that the channel is busy serving the application. The main characteristics of this system are the intensity of the flow of requests λand the intensity of service μ. You can also determine the relative (Q) and absolute (A) throughput, which are calculated using the following formulas [13]: .

MS-AL-ARQ Static Relaying (MS-AL-ARQ SR)
The main idea of this static relay method is the static determination of the leading/priority source node, i.e. before the transmission is completed, one of the source nodes becomes the leader, and in case of deterioration, the PDR priority always remains with the leading/priority source node, an example of operation is shown in Figure 6. It should be noted that the Priority Queuing is taken as the basis of the method. This method will be simultaneously implemented on the relay node and the recipient node. At the same time, like MS-AL-ARQ DefR, the static method can be implemented both on the flying relay-node and on the ground relay-node. When working with a flying relay-node, more attention should be paid to the time of storing packets in the buffer.
In this method, the queuing system with a limited queue should be taken as a basis, in which the number of places in the queue (m) is limited. Consequently, a request that arrives at the time when all places in the queue are occupied is rejected and leaves the system unserved. The graph of a singlechannel system with a limit on the length of the queue is shown in Figure 7.   7. The state graphof a single-channel queuing system with a limited queue: S 0 -the service channel is free; S 1 -the service channel is busy, but there is no queue; S 2 -the service channel is busy, there is one request in the queue; S k + 1 -the service channel is busy, there arein the queue k requests; S m + 1 -service channel is busy, all m places in the queue are occupied The analysis of the activity of single-channel systems with a limited queue is carried out according to the following formulas [14]: Probability of failure:

MS-AL-ARQ Dynamic Relaying (MS-AL-ARQDynR)
In contrast to the static relay method, in the dynamic relay method, the values calculated in real time on the relay node PDR for the source nodes will determine the source node priority based on the lowest PDR measured. Dynamic implementation of MS-AL-ARQRelaying is the most complex, as it requires computational resources on the relay node. In addition, the node priority decision can be made both at the relay node and at the destination node, which, accordingly, will cause large delays in comparison with other methods [15]. In this case, a certain operation of the buffers is implemented, shown in Figure 8.
The principle of operation of such systems lies in the preliminary processing of incoming packets by the system. First of all, the source with the lowest PDR measured is determined as leading/priority node. This will give a priority in the transmission of NACKs from the source node to the destination through raley-node. Only after pre-processing, received packets are queued in FIFO order. In this case, the model works on the basis of a singlechannel queuing system without restrictions, since the queue of priority-set packets should not be violated in order to ensure maximum signal quality. The scheme of operation of this system is shown in Figure 9.  9. The state graph of a single-channel QS without restrictions: S 0 -service channel is free; S 1 -the service channel is busy, but there is no queue; S 2 -the service channel is busy, there is one request in the queue; S k + 1 -service channel is busy, there are k requests in the queue In this case, provided that all applications are accepted without exceptions and the queue length is not limited, the relative throughput is [16]: where obl P is the probability of service. Based on formulas (1) and (2), we can determine the absolute throughput, which is equal to: .
Also important parameters of this system are the average waiting time for service in the queue and the average residence time of the application in the system. These characteristics are calculated as follows [17]: where T Pts -average queue time; T smo -the average time the application stays in the queue; L och -the average number of applications in the queue; L smothe average number of applications in the system;ρ is the probability of system downtime; t service -the average time of service of the application.

MS-AL-ARQ Relaying laboratory test bench
To further implement MS-AL-ARQ Relaying and define the requirements to develop its algorithm, a laboratory bench was assembled and tested, which included several micro-computers Raspberry Pi 3B source nodes and a relay node, and one laptop as destination node (base station). The operating system Ubuntu Mate was installed on the microcomputers, and Ubuntu 16.04 on the laptop. The following settings were made on all nodes: Static IP addresses were set on each node in accordance with Figure 10. Source nodes could not directly establish a connection with the recipient host, the check was carried out using the ping command. The choice of the distance between the source nodes and the relay node, as well as between the relay node and the receiving node was based on the analysis of log files with values of PDR1, which guaranteed high-quality data transmission.

Laboratory bench
For data relaying, the OLSR routing protocol was enabled on all nodes. The following scenario was investigated: source nodes simultaneously transmitted data to the destination node through the relay node. Video resolution 640x360 was chosen as a data stream, which simulated video from the UAVs. To study the QoS characteristics on the relay node and the recipient node, log files were recorded using the Wireshark network traffic analyzer program. A total of 5 tests were performed, the duration of each test was one minute. The results of the laboratory experiment are presented in Figure 11 as a dependence of PDR on the number of source nodes on relay-node and destination node.
From the graph in Figure 11. It shows that the quality of transmission from relay-node to the destination node is reduced according to PDR values, which may be related to the settings of the physical connections (frequency, channel, standard), software features (using VLC v.2), and buffer overflow on the relay node. The solution to the problem can be a software implementation of the proposed MS-AL-ARQ Relaying methods.
In addition to PDR, the relationship between the number of source nodes and the QoS measurement values was Goodput. Goodput determines the throughput of a communication channel at the ap-plication level, i.e. the number of payload bits delivered by the network to a particular destination in a unit of time. The following formula was used for the calculation: 8 , buff Goodput time where buff is the number of packets in the buffer at the destination/relay node; time -transmission time.
It follows from the results in Figure 12 that, as the number of source nodes increases, the Goodput metric increases. A decrease in the Goodput metric at the destination node is due to packet loss at the relay node, as indicated by the graph in Figure  11, which is caused by input buffer congestion with discarding data packets. The tests carried out on the bench demonstrated the need to develop algorithms based on the MS-AL-ARQ Relaying methods. In addition, the stand and the created configuration will serve as the basis for further testing of algorithms based on MS-AL-ARQ Relaying methods. Fig. 11. Graph of PDR measurement the number of nodes sources at node relay and node recipient

Conclusion
The article presents several methods for retransmission of lost fragments on the application layer through a relay node: MS-AL-ARQ DefR, MS-AL-ARQ SR, MS-AL-ARQ DynR. All of the above methods are based on the three queuing mechanisms. They do not apply to a specific video stream, but to sending NACKs. Recommendations are made based on the description presented. With software implementation of the MS-AL-ARQ DefR and MS-AL-ARQ SR methods, it can be implemented both on the ground relay-node and on the flying relay-node. MS-AL-ARQ DynR is most adapted to work with the ground relay-node, or with a flying relay-node [18][19][20].
It is also worth highlighting that an important advantage of using MS-AL-ARQ Relaying methods with source priority is to improve the quality of communication without the use of expensive equipment with high technical characteristics. The need for algorithm development has been demonstrated through a series of laboratory tests. A test bench was assembled, which included several Raspberry Pi 3B microcomputers as source nodes and a relay node, as well as one laptop as a destination node (base station). The scenario was investigated: the source nodes simultaneously transmitted data to the destination node through the relay node. During the experiments, the PDR and Goodput metrics were measured. It follows from the results of the experiments that with an increase in the number of source nodes, the PDR decreases. In particular, the number of successfully delivered packets on the recipient node is less than on the relay node. In addition, latency and useful bandwidth requirements increase. Thus, the methods proposed in the first part of the article can help solve the above problems. The software implementation of the algorithms will make it independent on the chosen communication channels and the on-board computing device.