The integration research of pre-multicast method and adaptive routing protocol with random network coding based on the OMNeT++ platform

In this paper, both the pre-multicast method and the adaptive routing protocol are proposed. The random network coding with these protocols are not only more stable and reliable, but also improves the utilization of network resources. According to the function of the nodes in the network, this paper establishes the source node model, the intermediate node model and the sink node model based on the OMNeT++ simulation platform. In particular, in this paper, both pre-multicast and adaptive routing modules are combined in the node model. By the simulation, using or not using both pre-multicast module and adaptive routing module in the network transmission module, the network transmission reliability is analyzed. The network performance, such as delay and effective throughput, is evaluated to verify the expected results. Because the designed node models are independent of each other, they can be applied to most real network topologies. Researchers can also modify a module of a model or improve an algorithm to achieve more complex functions according to their own needs.


Introduction
The initial network coding is centralized [1], it is difficult to adapt to changes in the network topology, it can only stay in the theoretical stage.Until the random network coding [2] proposed, the network coding began to apply, no longer limited to determine the network topology.However, at this moment, most network coding theories are all based on the comparison with the route transmission to reflect its superiority [3,4], and do not consider the compatibility and coordination between them.In fact, routing focuses on the storage and forwarding function of the node, while network coding tends to compute, which is not only non-contradictory, but also can be effectively combined to achieve the best transmission performance.These two methods are not only inconsistent, but also combine effectively to achieve the best transmission performance.Based on this idea of integration, Zhu Lin [5] put forward a routing protocol based on network coding for underwater acoustic network and simulated the network using NS2.However, it did not have a modular design and was difficult to expand.Subsequently, Hu Peng [6] designed a network node model embedded with random network coding module on the OMNeT++ simulation platform, which effectively solved the problem of modular expansion.However, in the transmission process, the number of packets was not optimized and was difficult to achieve by manmade settings ideal effect, and its breadth-first search method to find the shortest path routing module, failed to make full use of other nodes in the network resources, it is difficult to fully embody the superiority of network coding.On the basis of this, we make three improvements: First, we propose a pre-multicast algorithm that can approximate the multicast rate of the network before transmission so as to get the optimized packet number and improve the transmission reliability.The second is to improve the transmission process In order to be more conducive to the application of modular expansion.In this paper, the OMNeT++ simulation platform is used to refine the network node model into three types of node models: source node, intermediate node and sink node.The pre-multicast module and adaptive routing module proposed in this paper are also applied.The simulation results show that the algorithm implemented in this paper does improve the network characteristics such as network packet transmission reliability, effective throughput and network resource utilization.

Pre-multicast principle
Pre-multicast refers to the use of Monte Carlo method to set a different multicast rate to test the best multicast rate.Since the purpose of pre-multicast is to find the best multicast rate, the content of transmission can be null and void, greatly improving the transmission efficiency.It is noteworthy that the pre-multicast is based on the trial broadcast method put forward by Pu Baoxing [7], and combined with the requirement of this article, the buffer for storing the global coding vector is removed, the buffer for storing the multicast rate is reserved, while realizing the function , the cache is reduced to the utmost extent , so that the running time is reduced , and the running efficiency is improved .In order to put forward the following algorithm, we first introduce a theorem.
Theorem 1 [8]: For a single-source multicast network, using random linear network coding method to transmit data at multicasting rate H , remember that the encoding scheme is denoted as  .After receiving all the data packets, the sink r T  decodes the global encoding matrix according to equation (1), and then according to equation (2), then: (a)     does not exceed C ; (b) when the finite field is large enough, the probability of representing the rank of the matrix,     indicating the optimal multicast rate of the coding scheme  .The meaning of equation ( 1) is: For any sink r , look for the largest rank h , and the rank of the matrix satisfying the preceding h columns of the global coding matrix   , M r  is h .You can calculate equation (1) by performing a matrix transformation of the matrix into the upper triangular form.
Using Theorem 1, we propose a pre-multicast algorithm that uses the maximum coding throughput of distributed test throughput.The specific steps are as follows:  Initialization: set two buffers named buffer1 and buffer2, select the Galois field, set the corresponding initial value ( After receiving data packets from all input channels, each coding node detects the value of mark from the packet header of the data packet, and if the value is 1, then copies the contents of buffer1 to buffer2; otherwise, it does not copy;  Each coding node randomly generates a local coding vector for all of its output channels, calculates the global coding vectors of output channels by the formula and forwards the experimental packets;  Each sink r receives data packets from all of its input channels, detects the value of mark from the packet header of the data packet, and if it has a value of 1, then copies the contents of buffer1 into buffer2;  Each sink r finds out global vectors from received data packets and stores it in buffer1, then calculates the source message   , r   and sends it to the source through the feedback path.


Source according to the corresponding formula to calculate the minimum value


; otherwise remain mf unchanged and set to 0;  UNTIL pre-multicast stop condition is true, store the best mf value; When the pre-multicast is over, the best multicast rate saved in mf .From Theorem 1, we can see that the probability that a single test can measure the multicast capacity is P q that the probability is close to 1 when the order of the finite field is relatively large.Therefore, the pre-multicast algorithm using Monte-Carlo method for multiple tests, by Bernoulli formula, if do n pre-multicasts, you can find the multicast capacity , when the finite field is large and the number of pre-multicast is high, the multicast capacity is found to be a large probability event, and the algorithm is validated.Due to the empty transmission content, the space complexity of the pre-multicast transmission can be neglected compared with the pilot-broadcast method proposed by Pu Baoxing [7].In terms of time complexity, the time complexity of pre-multicast mainly depends on the decoding ability of random network coding, that is, it has polynomial time complexity.

Adaptive routing protocol -adaptive maximum flow algorithm
At present, most of the algorithms that solve the maximum flow in the network are mainly based on the selection of augmented chains, and seldom consider the combination with the actual network.The proposed adaptive maximum flow algorithm can be based on the actual needs, step by step to select the number of augmented chains, the maximum saving of network resources and improve utilization.
The main idea of the adaptive maximum flow algorithm is based on the fact that the ford-fulkerson algorithm needs to be labeled and adjusted many times when solving the maximum flow in the network.By introducing the concept of stratification, an algorithm for solving the maximum flow is proposed.It finds out all the augmented chains by fordfulkerson algorithm, and stores them in the routing table in the order of increasing path length, and then calls the augmented chain layer by layer.Until the actual network transmission requirements stop calling.
Adaptive maximum flow algorithm steps are as follows (due to space, omitted Ford-Fulkerson specific algorithm):  Initialize the directed network, set the initial feasible flow to 0;  Uses the Ford-Fulkerson algorithm to find all edge separation paths for a feasible maximum flow, and sets a priority vector, a counter, and a linked list that separates each node in the path.The counter records the length of each side separation path, the same path length is set to the same priority, the shorter the path is, the higher the priority is, and the node list stores the next node ID;  From the highest priority path in turn call the edge of the separation path, until the given transmission data to meet the requirements, stop calling, and then according to the node list for data transmission.Under the assumption that the edge capacity is unit capacity, the time complexity of the Ford-Fulkerson algorithm using linked list storage is ( ,which is the same as the breadth-first search algorithm(BFS) adopted by Hu Peng [6], where V is the number of nodes, E is the number of edges in the graph.However, the space complexity of BFS is ( ) ,where B is the maximum branch factor, and M is the longest path length of the graph.Due to the large amount of space required, BFS is not suitable for solving complex network problems.

Simulation models
Based on the different functions of network nodes, in this paper, three types of node models are constructed on OMNeT ++ platform: source node model, intermediate node model and sink node model.Among them, there are two core functional modules: one is the PMC, which exists in the source node model; the other is the routing module based on the adaptive maximum flow algorithm in each node model.Because of the same function, it is mainly discussed in the source node model.

Source node model
The source node model (SNode model in figure 1) consists of a PMC, an APP and an A-Routing.In order to be neat, this paper incorporates the pre-multicast module into the source node model.In fact, the pre-multicast module is independent of the node model and functions mainly in the network initialization phase.Its main function is to generate an optimal multicast rate.Adaptive routing module exists in all three types of node model, its main function is to find out the edge of the network to meet the maximum separation of the path, and according to the length of the path hierarchical classification, and then call the actual demand level.Source node model workflow: The pre-multicast module finds the approximate optimal multicast rate h to be transmitted to the application module by pre-multicast.The application module generates the original data packet and splits it into h small data packets according to the pre-multicast multicast rate, and finally, transmitted to the intermediate node via the adaptive routing module.The function of the application module is to generate data packets.The function of the adaptive routing module is to distribute the data packets generated by the application module to each intermediate node according to the network topology obtained from the adaptive maximum flow algorithm.

Intermediate node model
The intermediate node model (INode model in figure 1) includes three parts: Queue, NetworkCoding and A-Routing.Among them, the queue module acts as a cache, and the function of the adaptive routing module is the same as that of the source node model.Network coding module is the key node of the middle node, which realizes the random network coding function.
Intermediate node model workflow: After receiving the data packets transmitted by other nodes, the queue module transmits the data packets to the network coding module for coding, and then transmits the data packets to other intermediate nodes or sink nodes through the adaptive routing module.

Sink node model
The sink node model (DNode model in figure 1) consists of four parts: Queue, NetworkCoding, Application Module (APP) and Adaptive Routing Module (A-Routing).The functions of Queue modules and adaptive routing module are the same as above.The purpose of the application module is to generate a feedback message.
Sink node model workflow: The Queue module receives enough encoded data packets transmitted by other nodes, passes it to the network decoding module for decoding, and then passes it to the application module to generate an ACK message, which is reverse transmitted to the nodes on the link through the adaptive routing module to notify them that the original data packet has been transmitted, so that the source node no longer generates the same data packet and the intermediate node also no longer transmits the same data packet.

Simulation test
This experiment is carried out on OMNeT ++ 5.1.1 platform, and the network topology is established by NED language.As shown in figure 2, we simulate the real connection of a network in a rectangular area.The network has 30 nodes, of which Node0 is the source node, node28 is the sink node, and the rest are intermediate nodes.
The simulation parameters are set as follows: the file size is 2 MB, the link transmission bandwidth is 2 Mb/s, the length of a single original packet is 1024 Bytes, the link delay is 10 ms, and the link error rate is set from 1 × 10 -5 ~9 × 10 -5 .
According to the same network, in multi-path transmission mode, being compared before and after the application of pre-multicast module and adaptive routing module, the statistical results of the reliability of packet transmission, delay and effective throughput are shown in figure 3(a), (b) and (c).
Then, the file size is changed to 4 MB, and the remaining parameters are the same, only the transmission delay of the routing module used by the adaptive routing module is compared with Hu Peng [6] as shown in figure 3(d).

Result analysis
Overall, the simulation results verify that the PMC-NCMAR (Pre-Multicast Network Coding and Multi-path Adaptive Routing) method after applying the pre-multicast and adaptive routing module is superior to both two transmission methods of random network coding(NCMR) and multi-path routing(MR) in terms of network transmission reliability and effective throughput.As can be seen from figure 3(a), with the increase of the link bit error rate, the transmission reliability of network packets decreases.However, the degradation of MR is obviously greater than the other two.In terms of overall transmission reliability, the PMC-NCMAR is superior to NCMR without adding the pre-multicast and the adaptive routing module, and with the link bit error rate increases, this advantage has an expanding trend.
Figure 3(b) shows that as the link bit error rate increases, the average end-to-end throughput of the network decreases, but the degree of pure routing drops significantly more than the other two.For the same link bit error rate, the effective throughput of PMC-NCMAR is slightly higher than that of NCMR, mainly because the pre-multicast module to join the random encoding process to avoid the loss of effective throughput due to improper selection of multicast rate.
In figure 3(c), the average packet transmission delay using the MR is almost unaffected by the link bit error rate and remains essentially constant.However, the average packet transmission delay of the PMC-NCMAR and the NCMR are higher than that of the MR.This is due to the result of the coding node applying the caching mechanism and increases the error rate of the data packet in the link as the link bit error rate increases, and therefore, based on the data packet retransmission mechanism, making PMC-NCMAR and NCMR packet transfer average delay is also increasing.Meanwhile, the PMC-NCMAR transmission mode adds the pre-multicast phase based on the NCMR transmission mode, so that the PMC-NCMAR transmission mode takes more time than the NCMR transmission mode for the same link bit error rate, and this time-difference maintain a constant, which is due to the use of the Monte-Carlo method.
It is noteworthy that the application of pre-multicast module, due to the need to find the optimal multicast rate through multiple pre-multicast, which increases the total packet transmission time.But before the actual transmission, you can find the optimal multicast rate, do not actually need to spend more transmission time than the traditional random network coding.
As can be seen from figure 3(d), for the same network resources, the average packet transmission delay of NCMR module nearly become doubled after the size of the transmission file is changed from 2MB to 4MB.However, the average delay of PMC-NCMAR transmission method used in this paper remains basically unchanged.This is because the NCMR transmission method using only the shortest path for transmission regardless of the size of the transmission file.The adaptive routing module will enable alternate edge separation paths according to the transmission needs, so the transmission time will be greatly shortened, and the advantage will be more obvious as the size of the transmission file increases within the maximum flow range.

Conclusion
The integration of pre-multicast adaptive routing protocol and random network coding technology is proposed in this paper.On the one hand combines the advantages of the two methods proposed by Hu Peng and Pu Baoxing not only ensure the universal applicability of random network coding, because of the pre-multicast method , but also avoids the performance deviation caused by random selection of random network coding and multicast rate.On the other hand, it improves the routing algorithm of network transmission and proposes adaptive routing algorithm to maximize the use of network resources.In this paper, the source node model, the intermediate node model and the sink node model within the pre-multicast and the adaptive routing module are respectively designed on the OMNeT ++ simulation platform.The simulation results show that " integration of premulticast method , adaptive routing protocol and random network coding technology MATEC Web of Conferences 189, 04007 (2018) https://doi.org/10.1051/matecconf/201818904007MEAMT 2018 "method does improve the network characteristics such as network packet transmission reliability, effective throughput and network resource utilization.
It is noteworthy that different types of nodes are designed separately and all kinds of node models are independent from each other, which is conducive to the expansion of subsequent functional modules of each node.It can be applied to simulate different types of actual networks and realize more complicated functions as well.It also lays the foundation for the simulation of the subsequent algorithm optimization of each module.