Improvement and Performance Evaluation for Multimedia Files Transmission in Vehicle-Based DTNs

In recent years, P2P file sharing has been widely embraced and becomes the largest application of the Internet traffic. And the development of automobile industry has promoted a trend of deploying Peer-to-Peer (P2P) networks over vehicle ad hoc networks (VANETs) for mobile content distribution. Due to the high mobility of nodes, nodes' limited radio transmission range and sparse distribution, VANETs are divided and links are interrupted intermittently. At this moment, VANETs may become Vehicle-based Delay Tolerant Network (VDTNs). Therefore, this work proposes an Optimal Fragmentation-based Multimedia Transmission scheme (OFMT) based on P2P lookup protocol in VDTNs, which can enable multimedia files to be sent to the receiver fast and reliably in wireless mobile P2P networks over VDTNs. In addition, a method of calculating the most suitable size of the fragment is provided, which is tested and verified in the simulation. And we also show that OFMT can defend a certain degree of DoS attack and senders can freely join and leave the wireless mobile P2P network. Simulation results demonstrate that the proposed scheme can significantly improve the performance of the file delivery rate and shorten the file delivery delay compared with the existing schemes.


Introduction
The applications of peer-to-peer (P2P) networks have been growing at tremendous speed these past few years.The P2P traffic was about 37.9% of the global Internet traffic [1].P2P file sharing uses multiple peers to distribute contents, which can solve the bandwidth bottleneck highlighted by the C/S mode where multiclients download files from the same server simultaneously [2].Therefore, multisource transmission is a popular architecture in P2P networks to increase the scalability and robustness.For large multimedia files, multisource transmission plays an irreplaceable role.
Although originally developed for the wired Internet, these P2P-based content distribution networks (also referred to as P2P-based file-sharing systems) now transcend network boundaries (wired or wireless).This is because a large number of wireless handheld devices introduced to the market in recent years have enhanced the trend of file distribution among the mobile users.Moreover, instead of the conventional cellular networks, low-cost wireless connectivity such as Bluetooth and IEEE 802.11 offers the mobile devices an alternative way to communicate with each other.By exploiting such low-cost wireless connectivity, MANETs, the automatically self-organized wireless networks without any preconfigured infrastructure, can be established to enable independent mobile users to interact with each other.Due to the common characteristics such as decentralized architecture, self-organization, and self-healing features between P2P networks and MANETs, this structure makes the P2P applications over MANETs feasible and popular [3][4][5][6][7].
Vehicular ad hoc networks (VANETs) are special MANETs in which the nodes are vehicles.In VANETs, vehicles establish temporary network connections and communicate with each other under self-organization.They can also International Journal of Distributed Sensor Networks perform the distribution of data quickly and efficiently for the benefit of passengers' safety and comfort.However, there are many limitations preventing nodes communicating with others steadily.For example, the fast changing topology of vehicles, limited radio range, and so on, all result in that the amount of time nodes in radio range of one another is reduced.Accordingly, the duration of time that nodes are able to transfer data between one another as they pass is limited in VANETs.So, vehicle-based delay tolerant networks (VDTNs) are invited by all these issues.VANETs links are always intermittent and this interruption last longer, so that the path between the source node and destination node may not exist at any time; then VANETs become VDTNs [8].VDTNs perform routing functions through store-and-forward mechanism [9][10][11][12], where a source node forwards messages to intermediate nodes moving into its transmission radio coverage.Meanwhile, these intermediate nodes store the received messages and forward them when an appropriate forwarding opportunity rises.Therefore, VDTNs enable nodes to be temporarily unreliable and long-standing disconnections.However, all of these characteristics affect the efficiency of P2P sharing.Therefore, the characteristic that at any time the path between the source node and destination node may not exist limits the P2P application over VDTNs.Fortunately, this paper presents a reasonable and effective solution.
Although some work has been done in the multi-source transmission of wireless mobile P2P networks [13][14][15][16][17][18], one of the key assumptions of the current solutions in the literature is the existence of end-to-end routing path between any two nodes.In this paper, we propose an optimal fragmentationbased multimedia transmission scheme (OFMT) based on P2P lookup protocol, which allows multimedia files to be transmitted to the receiver fast and reliably in the mobile P2P networks over VDTNs.In addition, there is no need for a centralized control point, and senders can freely join and leave from the wireless mobile P2P network.The distinct features of the proposed scheme include the following.
(1) It is common to split such big multimedia files into several fragments.However, the size of each fragment directly affects the efficiency of file transmission, for example, fragment delivery rate, transmission delay, network load, and so on.This point can be proved by the simulation results in Section 5. Therefore, we propose a method that the receiver calculates the size of multimedia files' fragments according to the realtime features of the networks.
(2) We present a multimedia transmission mechanism named optimal fragmentation-based multimedia transmission scheme (OFMT) based on P2P lookup protocol, which can be applied to VDTNs.In the meantime, it explores the full potential of each source nodes; thus the performance of multimedia file transmission achieves significant results including improving the fragment delivery rate and reducing the transmission delay.
(3) All that is needed is that the receiver calculates the size of fragment  in our OFMT scheme.So the algorithm complexity is (1).
(4) The node churn has small impact on the performance of OFMT.
The rest of the paper is organized as follows.In Section 2 we describe the related work about P2P lookup protocol and multi-source transmission in wireless mobile P2P networks; we present a distributed multi-source parallel coadjutant transmission method in Section 3. Section 4 provides the security analysis of our protocol.The simulation results are presented in Section 5. Section 6 concludes the paper.

Related Work
Multi-source transmission is a popular architecture in P2P networks to increase the scalability.A good example of multisource architecture is the BitTorrent system [19].In [5], a multi-source transmission protocol using network coding is presented.Multi-source real-time video transmission is studied in [13,14,16].
In a cooperative network with multiple potential relays and multiple simultaneous transmissions, the selection cooperation is presented in [15], wherein each source pairs with a single "best" relay.In [13], a peer-to-peer (P2P) service for the transmission of real-time video content is introduced, exploiting the contemporary usage of multiple network paths over the current Internet.Reference [16] presents a multisource streaming approach to increase the robustness of real-time video transmission in MANETs.For that, video coding as well as channel coding techniques on the application layer is introduced.Reference [14] shows how video streaming applications can benefit from the diversity offered by P2P systems and implement distributed streaming and scheduling solutions with multipath packet transmission.An asynchronous multi-source streaming (AMSS) model [20,21] is discussed to realize the scalable multimedia streaming service.Here, each of multiple sources sends only a part of a multimedia fragment to a receiver.
In [22], a heterogeneous asynchronous multi-source streaming (HAMS) model is discussed, where multiple sources transmit packets of a multimedia file to a requesting receiver to increase the throughput, reliability, and scalability in P2P overlay networks.The source nodes send fragments not in distributed manner, although parallel transmission mechanism is used in HAMS model.It needs to send some control packets among all the source nodes to determine which file fragments should be sent by each of them.Obviously, this model is only suitable for good network connectivity such as the Internet.It is impracticable that the control packets determine how to send fragments in VDTNs with high transmission delay and low message delivery rate.In the case of loss of control packets, the performance of this protocol almost cannot be guaranteed.In addition, the complexity of this model is high.
The literature [18] presents a multisource selection mechanism in MANETs.In this protocol, the time period of the multimedia transmission is divided into time slots.Each time slot corresponds to one file fragment.In each time slot, it finds a source node with the best performance as the sender of this time slot and repeats the process until all the fragments are transmitted.Apparently, this method has low reliability.If the selected sender leaves the network or disconnects with the receiver, then the file cannot be transmitted normally.Therefore, it is only suitable for the networks with good connectivity.In [17], the author has improved the previous scheme by selecting  senders in each time slot to increase the reliability of the system.However, all the selected  senders still transmit fragments serially according to the time slots.That is, each time slot corresponds to one file fragment.As a result, the transmission delay is relatively high.Moreover, this protocol is only suited to the condition that the connection between the source node and the destination node exists.And it is not feasible in VDTNs.
All the multi-source transmission mechanisms discussed above only apply to the networks with good connectivity.In addition, most of them do not employ parallel idea to improve the throughput of network.Only [22] proposes a parallel transmission mechanism, but its application scenarios are limited.To address the problems and issues discussed above, it is desirable to develop a fast and reliable transmission scheme of the multimedia files which can apply to some special networks.Thus, in Section 3, we propose a distributed multi-source parallel coadjutant transmission of multimedia based on P2P lookup protocol in VDTNs.

OFMT Scheme Based on P2P Lookup Protocol
VDTN is a network model abstracted out of ad hoc, wireless sensor network (WSN) and other self-organizing wireless networks.Its typical characteristic is the link between nodes that is intermittently interrupted and usually the interruption lasts longer, so that at any time the path between the source node and destination node may not exist [8].Therefore, the transmission mechanism of the multimedia files in the mobile wireless P2P networks over VDTNs is different in the current scheme.
In wireless mobile P2P networks, due to nodes joining and leaving the networks, the system performance may be dramatically affected.We call this phenomenon node churn [23,24].As a result, under the situation of unstable links, if a single source node is used, the churn of this source node will cause a sharp drop in the efficiency of files transmission.For this reason, in this work, we use multi-source transmission first.On the one hand, it increases the robustness of the system.On the other hand, it can provide multimedia file sharing at the same time and enhance the capacity and efficiency of real-time transmission [17].Second, in our scheme, the fragments of a multimedia file are transmitted to a receiver from multiple sources in parallel to increase the throughput.Thirdly, multiple source nodes transmit their fragments in a fully distributed way.Finally, the proposed coadjutant transmission mechanism is implemented by letting the source nodes that have finished their own tasks automatically help the node that has sent the least fragments.
It is worth emphasizing that the mechanism is still executed in a distributed manner.
Before the detailed description of the OFMT, we first introduce three types of nodes of the networks: the receiver node, the source node, and common intermediate node.
(i) The receiver node , defined as the node that requests files.
(ii) The source node , defined as the node storing the desired file found by the receiver executing a P2P lookup protocol.
(iii) The common intermediate node IN, defined as the nodes other than the receiver nodes and the source nodes, which are mainly responsible for storing and forwarding the messages.

Fragment
Distribution to Multiple Sources.The intermittent connectivity of VDTNs means there may be no persistent existence of connections between the source node and the destination node.That is, the links among nodes are very unstable and the duration of connections is very short.During packet transmission, if the link is down then the part of the fragment that has already been sent will be dropped.Therefore, to improve the fragment delivery rate, it is necessary to divide such big multimedia files into fragments with suitable size based on the actual link condition of the networks.Meanwhile, these fragments must be indexed.
In this paper, we propose to determine the fragment size according to the mean duration of the network links.
First, the receiver node  collects the historical information of the networks including the number of network connections  and the total duration of network connections .
Second, before sending the fragment request, the receiver node  calculates the mean duration of the network links that equals / and then calculates the size SM of total packets transmitted during the lifetime of a link using the nodes' average transmission speed (bandwidth).However, in the best cases, that is to divide SM into several packets in VDTNs.In our experiments, we found that fragment's size of SM/5 allows for reasonable results in a variety of networks.
Third, in our method, the task list Stask[] of each source node  is the fragments with id , +, +2, . . ., , where  is the ordinal of  in the address list of the source nodes searched by ,  is the number of the source nodes found by , and  is the largest integer satisfying =  +  ≤ the biggest fragment id ( = 0, 1, 2 . ..).
As described above, each node is assigned as many tasks as each other.We adopt coadjutant transmission mechanism in OFMT; thus, the good-performance nodes will finish tasks earlier than the nodes with poor-performance, and then those nodes with earlier completion help the unfinished nodes until the entire file is transmitted.Therefore, our scheme takes into account nodes with various properties while not reducing the throughput of the system.

Data Structure.
Here, we set the size of the entire multimedia file as  Size, the number of source nodes as , the fragment size as , the address list of source nodes as International Journal of Distributed Sensor Networks Saddrs = [ 1 ,  2 ,  3 , . . .,   ] (suppose the th source node address searched by the receiver is   ,  = 1, 2, 3 . . .), the fragment ID as  Id = 0, 1, . . .,  = Math.ceil(Size/M), and the requested file ID as F Id .

ACK.
In OFMT, all the nodes of the networks need to maintain a global success list ACK[0 ⋅ ⋅ ⋅ −1][0 ⋅ ⋅ ⋅ Num−1] to store the fragment IDs that have been sent to the receiver  successfully, where  Num = Math.ceil(Size/( * )).

Message.
In our scheme, three types of messages are introduced in the multi-source transmission process.
(i) Initial-multicast-notification-request (IMIR) message is a multicast-notification message sent to all the source nodes from the receiver after  executes a P2P lookup protocol to find the desired file.IMIR mainly includes the address of , the address list SAddrs of  source nodes, the requested file id F Id , and the fragment size .
(ii) Unicast-notification-request (UIR) message is a unicast-notification message sent to the node  from  when  checks ACK[][] and finds there is a node  sending none of the fragments.UIR mainly includes the address of , the address of the node , the requested file id F Id , and the fragment size .
(iii) Source-fragment (SF) message is a fragment-message sent to the receiver  from a source node  after this source node receives a notification message from .SF mainly includes the address of the source node, the address of , the requested file id F Id , the fragment id  Id , and the relevant multimedia file content.

Timeout Timer.
In our scheme, each node needs to maintain a timeout timer.
(i) The timeout timer at : each source node  starts the timer after sending an SF message.When the timer expires,  starts to send the next file fragment until all fragments have been successfully sent.
(ii) The timeout timer at :  starts the timer each time it sends an IMIR or UIR message.When the timer expires, it checks ACK[][].If there is an uninformed source node, then  sends UIR message to this node.This process is repeated until all the source nodes are notified or the number of the timer expiring exceeds a certain threshold.
(iii) The timeout timer at IN: each intermediate node IN starts the timer at the beginning of transmitting the file.When the timer expires, they check whether the current carried messages are successfully transmitted.

OFMT Scheme.
With the above data structure, OFMT scheme is described below.
(1) The receiver  executes a P2P lookup protocol to find the desired file, and then the address list of the source nodes is sent to the receiver.Suppose there are  source nodes.
(2) The receiver node  collects the historical information of the networks to calculate the average duration of the network links and then calculates the size SM of total packets transmitted during the lifetime of a link based on the nodes' average transmission speed (bandwidth).In our experiments, we found that fragment's size of SM/5 allows for reasonable results in a variety of networks.
(3)  sends IMIR message to  source nodes using multicast to inform them to divide the multimedia file F Id into fragments with size  and requests the first fragment.In the meantime,  starts its timeout timer.
(4) After receiving IMIR or UIR message, each node in the networks compares its address with the destination address list of the message: if this node is a common intermediate node, then it continues to forward this message.
If this node is one of  source nodes, then it divides the file F Id into fragments with size  and sends the first fragment of its task list Stask[]; meantime, it starts its timeout timer after sending the fragment.
(5) After receiving a fragment successfully, the receiver  puts its fragment id into ACK[][], which means that this fragment has been successfully transmitted.
(6) When the timeout timer expires, do the following actions until all the fragments have been transmitted successfully.
(i) The receiver : check ACK[][] whether the fragments whose ids are from 0 to  − 1 have been successfully sent.
(1) If any fragment with id ranging from 0 to  − 1 is missing in ACK[][] and the number of timer expirations exceeds 3, then either the relevant source node is dead or has left the networks.Therefore,  no longer sends notification messages and waits for the assistance of the other nodes and removes the timer.
(2) If any fragment with id ranging from 0 to −1 is missing in ACK[][] and the number of timer expirations is less than 3, then  sends UIR to the relevant source nodes.(3) If the fragments whose ids are from 0 to  − 1 have all been sent to , then  removes the timer, which means that then  source nodes have already been notified and the next step is to rely on them to complete fragments transmission in a distributed manner.
(ii) The source node : here, we suppose the prior file fragment id sent by  is .
( From the above steps, it can be drawn that even lowperformance and low-reliability mobile nodes can also be a sender in our scheme.This is due to the coadjutant mechanism, which makes good-performance nodes account for more fragments and poor-performance nodes send fragments as possible as it can.Therefore, the throughput of the system is not affected.In addition, our OFMT scheme tries best to reduce the redundant transmission of packets and increase the reliability and availability.We also have the highest file delivery rate and the lowest transmission delay.

Denial of Service (DoS).
The transmission of the multimedia file depends on the cooperation of each source node.Therefore, one of the most worrisome results is the possibility of a denial of service (DoS) attack where malicious nodes refuse to transfer file fragments to the requesting node.Selfish nodes performing this attack attempt to benefit from the resources of others without offering their own resources in exchange [25].The selfish nodes attempt to stop, or at least slow, file delivery rate [26].
In this case, the performance is equivalent to the cases that fewer senders are selected or the selected senders leave the network.However, as a result of using coadjutant mechanism in our scheme, even in such circumstances that if not all source nodes are selfish nodes, these surviving nodes still can finish the transmission of the files while system performance does not fall a lot, which can be seen from Figures 7 and 9.

Impacts of Nodes Churn.
In OFMT, all nodes can be divided into three categories: source nodes, common intermediate nodes, and the receiver nodes.Therefore, 6 cases are presented to discuss the effect on system performance due to node churn.
(1) The case of a source node leaving the networks: if the leaving node has good performance, the system is like losing a right-hand man, resulting in increased delay.However, the system can still rely on other nodes to complete the transmission of all fragments.In contrast, if a poor-performance node leaves the network, it can mandate other good-performance nodes to help to complete the transmission.Meanwhile, the system performance is not significantly decreased.
(2) The case of a source node joining the networks: if a source node rejoins the network after it left the network, and then at the time when it rejoins, it can continue its task.Thus the completion of the file transmission can be accelerated.
(3) The case of the common intermediate nodes leaving the networks: this case makes VDTNs nodes sparser and often leads to network fragmentation.Therefore, it will have an impact on VDTNs routing such as reducing the message delivery rate.The system performance is also affected.
(4) The case of the common intermediate nodes joining the networks: VDTNs nodes are denser in this case.Therefore, the message delivery rate of VDTNs routing is improved as well as the system performance.
(5) The case of the receiver node leaving the networks: in this case, because of the absence of the receiver, it does not matter whether the network performance is good or bad.This is a usual case in VDTNs.
(6) The case of the receiver node joining the networks: if the receiver node rejoins the network after it left the network, the system is back to normal.The source nodes continue to transmit the file fragments and the system performance will not be affected.

Simulation Results and Discussions
To begin this section, we simply introduce the existing algorithm multi-source serial transmission (MST) based on time slot.In MST, the time period of the multimedia transmission is divided into time slots.Within each time slot, all source nodes or only the good-performance nodes send the same file fragment.Moreover, in this algorithm, the fragment size totally depends on the receiver, not the actual situation of the networks.In this section, we simulate OFMT and MST.The transmission structures of OFMT and MST are shown in Figures 1 and 2.

Simulation Settings.
In our simulation, we use extended MChord [24] P2P lookup protocol, and the transmission protocol is simulated by the opportunistic network environment simulator (ONE) [27,28].We assume interpersonal communication between mobile users in a city using modern mobile phones or similar devices, using Bluetooth at 2 Mbit/s net data rate with 10 m radio range [29].The mobile devices have up to 100 MB of free buffer space for storing and forwarding messages.Therefore, based on the above scenario, the simulation parameters are set as in Table 1.There are three types of nodes in the networks which are used to simulate the movement of pedestrians, cars, and buses.All trajectories are based on the Helsinki map.In the following simulation, we compare OFMT with two cases of MST: MST (Fragment size = 1 M) and MST (fragment size = 2 M).

Simulation Results.
In Figure 3, we show the relationship between file delivery rate (FDR) and fragment size  under 5 different movements.As can be seen from the figure, the fragment size can greatly affect FDR in the networks.We find that when the seed of the movement model is set to 1, 2, and 4, the corresponding curves can obtain the maximum at the third point where the fragment size is 100 KB and the curves whose movement seed is 3, 5 can obtain the maximum at the second point where the fragment size is 50 KB, while the fourth point where the fragment size is about 150 KB in every curves is found by our OFMT scheme ( = the average duration of the network links/5).When the file size is a multiple of megabyte or even gigabyte, the difference between the value found by our OFMT scheme and the value where FDR is the highest is less than 100 KB.Meanwhile, the corresponding FDR of the two differs within 0.05.Obviously, our method can get the approximate optimal value of  to get a much larger FDR.Therefore, Figure 3 shows that our proposed method provides an effective way to look for the value of .In the following simulation, the value of  in OFMT scheme equals the average duration of the network links/5.Figure 4 shows the changing tendency of FDR over time both in OFMT and MST.We can see that the FDR of both algorithms is increasing over time, and the FDR in OFMT is much higher than two cases of MST.One reason for this is that OFMT scheme can calculate the fragment size  according to the actual situation of the networks.Another is due to OFMT scheme using parallel coadjutant transmission.As a result, on the one hand, parallel transmission can improve the throughput of the system.On the other hand, coadjutant transmission can solve the problem that the message delivery rate is low in VDTNs; that is, it helps to resend those dropped packets due to disconnected links.Therefore, OFMT scheme improves FDR.
We plot the overhead ratio (OR) against the time in Figure 5.The OR is defined as the ratio of the number of the messages that failed to reach the destination and the messages that are transmitted to the destination successfully.The larger the OR is, the more overhead is required in every transmission of a packet.As can be seen from the figure, the changing tendency of OR over time is not obvious, and the OR of the three is very comparable.Before 60 Ks, OFMT has a larger OR than MST.However, after 60 Ks, the situation is exactly opposite.Therefore, we consider a composite metric FDR/OR which takes FDR and penalizes it for having a poor OR.So we maintain the standard of "higher is better." It is very clear that the performance of OFMT is better than MST from Figure 6.At the same time, it also demonstrates that OFMT can achieve a higher FDR while maintaining a lower OR.
Figure 7 provides the relationship between FDR and the number of the source nodes.We can see that the FDR of OFMT is always higher than both two cases of MST.Meanwhile, the FDR of both OFMT and MST does not change much while the number of the source nodes ranges from 2 to 10, which illustrates that the source node churn have small impact on the performance of networks.
Figure 8 shows the relationship between the number of the source nodes and the time of both schemes achieving the largest FDR when the transmitting range is 100 m.Two curves of MST whose fragment sizes are 2 M and 1 M, respectively, overlap.Measured by our experiments, the largest FDR of OFMT is 100%.However, two cases of MST can only achieve 96.32% and 97.4%, respectively.This is because MST transmits the packets based on time slots and each time slot corresponds to one file fragment.However, VDTNs can neither guarantee the message delivery time nor guarantee that each fragment in each time slot be successfully transmitted to the receiver.In addition, from the figure, we can see that OFMT achieves the highest FDR earlier than MST.This means OFMT scheme has a much lower transmission delay.
We plot the FDR of both OFMT and MST (fragment size = 1M) against time with different transmitting ranges in Figure 9.It is clear that the FDR of both algorithms increases with time under any transmitting range.What is more, OFMT's FDR is higher than that of MST.In addition, we can also observe that the larger the transmission range is, the higher the FDR is.This is because the larger transmission range results in better network connectivity and higher message delivery rate, and ultimately higher FDR.

Conclusions
This paper proposes an optimal fragmentation-based multimedia transmission scheme (OFMT) based on P2P lookup protocol in VDTNs.More specifically, three mechanisms enable the highest file delivery rate and the lowest transmission delay.In addition, we design a method to get a best suitable fragment size which allows for reasonable results in a variety of networks.Moreover, we show the safety analysis of OFMT scheme including DoS attack and node churn.Finally, the results of simulation demonstrate that the proposed scheme significantly improves the performance of file delivery rate and file transmission delay compared with the existing scheme.Therefore, OFMT provides higher level of securities.

Figure 4 :
Figure 4: The relationship between file delivery rate and transmission time ( = 10, transmitting range = 10 m).

𝑁Figure 8 :
Figure 8: The relationship between the time of achieving the max FDR and the number of source nodes .

Figure 9 :
Figure 9: The relationship between file delivery rate and transmission time ( = 10).
the receiver  successfully receives a file fragment (fragment ID is  Id ), it checks ACK[][] to see if ACK[][] exists, where  =  Id % ,  =  Id /.If ACK[][] exists, it means the fragment  Id has already been received and then this fragment will be dropped.On the contrary, if ACK[][] does not exist, it means the receiver  has not received this fragment before and starts to receive it immediately.At the same time, set ACK[][] =  Id .By using this data structure, a fragment id  Id can be directly targeted to its storage location ACK[][] in ACK[][] by any nodes, where  =  Id % ,  =  Id /.As a result, this data structure reduces the algorithm complexity.
If  does not finish the transmission of the fragments in 's task list Stask[].
(iii) The common intermediate node IN checks ACK[][].If a current-carried fragment has been sent successfully to the receiver , then IN removes this fragment and stops forwarding.If on the contrary, IN continues to forward this fragment to the next hop according to DTNs' routing protocols.
if (All the fragments of Stask[] have been successfully transmitted to the receiver ) { Find the source node min that has sent the least fragments in ACK[][].Check the task list of min reversely and find the first fragment that isn't sent successfully.Then  helps min  to send this fragment.