Weighted BATS Codes with LDPC Precoding

Batched Sparse (BATS) codes are a type of network coding scheme that use a combination of random linear network coding (RLNC) and fountain coding to enhance the reliability and efficiency of data transmission. In order to achieve unequal error protection for different data, researchers have proposed unequal error protection BATS (UEP-BATS) codes. However, current UEP-BATS codes suffer from high error floors in their decoding performance, which restricts their practical applications. To address this issue, we propose a novel UEP-BATS code scheme that employs a precoding stage prior to the weighted BATS code. The proposed precoding stage utilizes a partially regular low-density parity-check (PR-LDPC) code, which helps to mitigate the high error floors in the weighted BATS code We derive the asymptotic performance of the proposed scheme based on density evolution (DE). Additionally, we propose a searching algorithm to optimize precoding degree distribution within the complexity range of the precoding stage. Simulation results show that compared to the conventional weighted BATS codes, our proposed scheme offers superior UEP performance and lower error floor, which verifies the effectiveness of our scheme.


Introduction
Data packets may be lost during transmission in wireless network communication due to path fading and interference. Network coding [1], which allows relay nodes to encode packets, is an effective forward error correction (FEC) code in wireless erasure networks. Random linear network coding (RLNC) [2] is a typical network coding scheme, whose coding coefficients are randomly selected over a finite field. RLNC can improve throughput effectively. However, conventional RLNC has high decoding complexity and needs big cache capacity, which restrict its application. As a new network coding scheme, the BATS code [3] has been extensively studied in recent years due to its low complexity and rateless characteristic.
Input packets are encoded in batches by the BATS code, which is composed of the outer code and the inner code. The outer code adopts the matrix form of the Luby Transform (LT) code, which is a kind of fountain codes. The BATS code is rateless because the outer code can produce any number of batches. The inner code adopts RLNC in the same batch. Designing the degree distribution function for BATS codes can effectively enhance their decoding performance when employing the belief propagation (BP) algorithm. In [3,4], the design methods of degree distribution of the BATS code are given in the case of infinite code length and finite code length, respectively. The benefit of the BATS code is that only a fixed number of packets need to be buffered and processed by the relay node for the fixed batch size of the BATS code.
In order to improve the performance of BATS codes, Zhou et al. [5] investigated the design of the inner code to maximize the expected batch transfer matrix rank normalized by the total number of packets transmitted by both the source and intermediate nodes. Juan Yang et al. [6] proposed an improved algorithm which iteratively performs BP decoding and incremental Gaussian elimination for decoding finite-length BATS codes for improving the decoding performance. To achieve lower latency, a sliding window framework was analyzed in [7], which divides the information blocks into smaller sub-blocks and jointly optimizes the degree distribution and window selection probability of each sub-window. Wang et al. [8] proposed cascading LDPC codes before BATS codes.
BATS code has great application prospects in many scenarios. Gao et al. [9] proposes a joint infrastructure-to-vehicle and vehicle-to-vehicle communication scheme using batched sparse coding to efficiently distribute content to vehicles passing by roadside units, reducing transmission delay and traffic overhead. Yeung et al. [10] discussed the potential and prospects of using BATS codes for space communication. Wang et al. [11] investigated the use of batched sparse (BATS) codes in a butterfly network for multicast communication.
Conventional BATS codes can only provide equal error protection (EEP) for all data. However, in the scenarios of image and video data transmission, some data require higher reliability than others. So unequal error protection (UEP) technology is needed. Xu et al. proposed the weighted BATS code [12] and the expanding window BATS (EW-BATS) code [13] with UEP characteristics. Xiang et al. [14] proposed the feedback expanding window BATS (FEW-BATS) code, which decreases average overhead of successful decoding in the less important packets (LIP) and has no effect on the decoding performance of the more important packets (MIP) by adding a single feedback on the basis of the EW-BATS code.
The conventional UEP-BATS codes have a high error floor. This is because BATS codes randomly select input packets during encoding, which leads a small number of input packets participating in encoding only a few times or even never participating in encoding. To solve this problem, we propose a new UEP-BATS code scheme which performs LDPC precoding before the weighted BATS code. In order to obtain better UEP, we adopt partially regular LDPC (PR-LDPC) [15] as the precoding scheme. We derive the density evolution (DE) analysis when the code proposed in this paper is decoded by BP algorithm on binary erasure channel (BEC) and optimize the relevant parameters according to the DE analysis. Finally, we verify the performance of the proposed code through simulations.

BATS Code
The BATS code consists of the outer code and the inner code. We assume that there are K input packets, and the set of input packets is denoted by S = {s 1 , s 2 , . . . , s K } where s k is the kth input packet and each packet consists of L bits. The outer code encodes the input packets into batches. We assume that the batch size is M and the degree distribution is denoted by where Ω d is the probability of generating a degree value of d and D is the maximum degree. The encoding process in ith batch of the BATS code is given as follows: (1) A degree value d i is generated according to Ω(x).
(2) d i input packets in S are randomly selected to generate S i .
where G i is a random matrix with its elements on a finite field F q with size q and dimension d i × M. (4) The inner code of the BATS code is RLNC in the batch.
Then the encoded packets are sent to the downstream node. Assuming that the transmission matrix of the ith batch is A i , the packets of the ith batch received by the destination node are where A i has dimension M × M i , and M i denotes the number of packets received in the ith batch.
The number of batches generated is n = (1+γ)K M where γ is the encoding redundancy. We let µ = Ω (1) and θ = 1+γ M µ denote the average degree of output batches and input packets, respectively. Λ(x) = ∑ i Λ i x i is the degree distribution of the input packets, where BATS codes can be decoded using the BP algorithm. In [16], the AND-OR tree analysis of BATS codes using the BP algorithm is introduced in detail. In the AND-OR tree, the ORnodes denote the input data packets, and the AND-nodes denote the output batches. The root node of AND-OR tree is an OR-node. The children of OR-nodes are AND-nodes and the children of AND-nodes are OR-nodes. Suppose h = [h 1 , h 2 , . . . , h M ] denotes the channel rank distribution and h r denotes the probability that the rank of the batch received by the destination node is r. There are the following conclusions about AND-OR tree:

•
The probability that an OR-node has i children is • The probability that an AND-node has i children is An OR-node is decodable only when any of its children are decodable.

•
An AND-node is associated with rank r with probability h r where r = 1, 2, . . . , M and it is decodable if less than r − 1 children are undecodable.
The probability that the root node is undecodable in the lth iteration is where and

Weighted BATS Codes
Weighted BATS codes change the probability of being selected for encoding by setting different weight factors for input packets of different importance. We assume that there are K input packets and they are divided into m important levels. The jth level of input packets is denoted by IP j . The number of packets with the jth important level is α j K and ∑ m j=1 α j = 1. The probability of jth level packets being selected is p j = T j /K where T j is the weight factor of the jth important packets. The value of T j has to satisfy ∑ m j=1 α j T j = 1 and p i > p j (i < j). Figure 1 illustrates the encoding process of weighted BATS codes at the source node.  According to the analysis of weighted BATS codes in [12], the probability of a jth important packet undecodable after l iterations of BP is is the average degree of the input packets with jth-level importance.

Encoding Scheme
In the conventional weighted BATS coding scheme, the input packets are randomly selected with different probabilities when encoding. Therefore, some input packets are rarely selected or even never selected, which would lead to high error floor at the receiving side. In order to lower the packet error rate, we propose a novel UEP-BATS code, which performs PR-LDPC codes precoding before the weighted BATS code, and precoding phase can be utilized to mitigate errors and recover input packets that cannot be restored by weighted BATS codes. In our scheme, the encoding process of the source node is divided into a precoding phase and a weighted BATS code encoding phase. The encoding process of these two phases is as follows: Precoding phase: The PR-LDPC code [15] with UEP characteristics is used for precoding in our coding scheme. We assume that the number of the input packets is K, and N intermediate packets are generated by precoding. Therefore, the number of parity packets (PP) is N − K, and the code rate of precoding is R = K/N. Let the precoding check matrix be H = H 1 H 2 · · · H m |H P , where H j (1 ≤ j ≤ m) is the sub-matrix corresponding to the IP j , H P is the sub-matrix corresponding to PP and H P is a non-singular matrix. Let d j be the degree of the IP j , d P be the degree of PP, and d C be the degree of check nodes. So the column weight of H j is d j , the column weight of H P is d P , and the row weight of H is d C . According to the analysis in [15], the decoding error probability of the IP i is lower than that of the IP j when d i > d j . Since PP are not included in the packets to be recovered, d 1 > d 2 > · · · > d m > d P should be satisfied when d C is determined. The input packets are denoted by B = B 1 B 2 · · · B m , where B j denotes the sub-matrix formed by the IP j , so the dimension of B j is L × α j K. The intermediate packets are denoted by B = B|B P , where B P is the sub-matrix formed by PP, so the dimension of B P is L × (N − K). According to H · (B ) T = 0, we can obtain The precoding process is performed on the finite field GF(2), so the PP generated by precoding is

Decoding Scheme
At the destination node, The receiver uses the BP algorithm for decoding and the bipartite graph of the BP algorithm is shown in Figure 3. The decoder of receiver consists of a weighted BATS code decoder and a precoding decoder. The specific decoding processes of these two decoders are as follows:  remove the row corresponding to s i in G k . Repeat the process until no batch satisfies that the degree is equal to the rank.
Precoding decoder: In each iteration, the precoding check nodes with degree of 1 are decodable. If the degree of jth check node is 1 and it is connected only to intermediate node s j , the input packet corresponding to s j is decodable. Then all edges connected to s j in the graph are deleted. If s j is selected to encode the kth batch, the row corresponding to s j in G k is removed. The process is repeated until there is no check node with degree of 1.
The decoding process is shown in Figure 4, where U and V represent the index of the received packets and recovered packets, respectively. The receiver side performs the weighted BATS decoder and the precoding decoder in a cyclic manner. At the beginning of each cycle, the sets I B and I P are initialized as empty sets. Subsequently, the weighted BATS code decoding and the precoding decoding are executed. The index of the intermediate data packets decoded by weighted BATS decoder and precoding decoder are added to the sets I B and I P , respectively. The intermediate packet indexes in sets I B and I P , but not belonging to PP, are inserted into set V. The receiver side restarts weighted BATS decoding because there may still exists some decodable batches after parts of the intermediate data packets are decoded by precoding decoder. The decoding process is stopped when set I B is empty.

Weighted BATS decoder
Precoding decoder V U

Decoding Error Probability
In this subsection, we use the AND-OR tree analysis to derive the DE formulas of the weighted BATS code with LDPC precoding under BP decoding on BEC according to the conclusions in [15,17]. During the BP decoding process, erasure information is repeatedly passed between precoding check nodes, intermediate nodes, and output nodes. Each node updates its information upon receiving information from other nodes and passes the updated information to other nodes. Let (1). Let E be the set of edges between the intermediate nodes and the precoding check nodes. Let λ j and λ P respectively denote the probability of selecting an edge from E at random, which corresponds to the jth level input packets and PP. So we have where |E| = ∑ m j=1 α j Kd j + (1 − R)Nd P , indicating the number of edges between the intermediate nodes and the precoding check nodes.
At ith BP iteration, let P j,i and P P,i respectively denote the probability of passing erasure information to the precoding check nodes from the intermediate nodes corresponding to IP j and PP; Q j,i and Q P,i respectively denote the probability of passing erasure information to the output nodes from the corresponding intermediate nodes to IP j and PP; U i denotes the probability of passing erasure information to the intermediate nodes from the precoding check nodes; V i denotes the probability of transmitting erasure information to the intermediate nodes from the output nodes. Subsequently, the respective mathematical expressions for the aforementioned probabilities will be presented.
When i = 0, all intermediate nodes are initialized to 1, which means that P j,0 = P P,0 = 1. When i ≥ 1, P j,i is equivalent to the probability that the intermediate nodes corresponding to IP j receive erasure messages from the other d j − 1 edges connected to the precoding check nodes and all edges connected to the output nodes. The former probability is . Therefore, the formula for calculating P j,i is Similarly, the formula for calculating P P,i is When i = 0, all intermediate nodes are initialized to 1, which means that Q j,0 = Q P,0 = 1. When i ≥ 1, Q j,i is equivalent to the probability that the intermediate nodes corresponding to IP j receives the erasure messages from other output nodes and all precoding check nodes. The former probability is (U i−1 ) d j , and the latter probability is equivalent to the probability that all children of the intermediate node in the AND-OR tree pass the erasure messages to it. So we have Similarly, we can calculate Q P,i by The probability that the precoding check node passes on the erasure message to the intermediate node is denoted as U i , which is equivalent to the probability that the check node receives the erasure messages from other d C − 1 intermediate nodes, so The probability that the output node passes on the erasure message to the intermediate node is denoted as where y denotes the probability that a child node of the AND node in the AND-OR tree transmits an erasure message, ω(1 − y) denotes the probability that less than r − 1 child nodes transmit erasure messages to the AND node, and r is the rank of the coding coefficient matrix corresponding to the AND node, so and The above is the calculation process for the probability of erasure message transmitted between nodes. Based on these probabilities, we can make an asymptotic estimate of the decoding error probabilities of IP j which is given by: where θ j = nµp j is the average degree of the intermediate packets with jth level importance.

Complexity
In the conventional weighted BATS code, the M encoded packets in the batch is generated by linearly combining µ input packets on average. Therefore, the encoding complexity of generating n batches in the conventional weighted BATS code is O(nµLM). The encoding complexity is slightly elevated in our scheme due to the addition of the precoding phase. During the precoding phase, the encoding complexity is related to the row weight d C of the parity matrix and the number of parity packets. A packet XOR operation must be performed during encoding for each element in the parity matrix with a value of "1". Therefore, the encoding complexity in the precoding phase is O(Ld C (N − K)). The additional complexity introduced in the precoding phase is constant and independent of the number of batches generated.
At the destination node, the decoding process is divided into two stages, where the average complexity of the weighted BATS decoder is O(nM 3 + nµLM), and the complexity of the precoding decoder is O(Ld C (N − K)). Therefore, the decoding complexity of this scheme is O(nM 3 + nµLM + Ld C (N − K)).
In summary, compared to conventional weighted BATS codes, our scheme only add a marginal and fixed increase in the complexity of the encoding process and decoding process.

Optimization of Precoding Degree Distribution
This subsection proposes an optimization algorithm for the precoding degree distribution under the constraint of limited precoding complexity. Based on the complexity analysis presented in the previous subsection, it can be concluded that, under the assumption of data packet length L and precoding rate R, the complexity of the precoding phase is solely determined by the row weight d C of the parity check matrix H. Therefore, the limitation of complexity in the precoding phase refers to its complexity being constrained by the maximum value of d C . In other words, the maximum allowable value of d C restricts the complexity of this phase. So we need to find the optimal values of d j and d P in the case where d C is fixed.
According to the fact that the sum of the number of "1" elements in all columns of the parity check matrix H is equal to the sum of the number of "1" elements in all rows, we can obtain Suppose that d j and d P have lower bounds of 1, and D j and D P denote the maximal values of d j and d P , respectively. Due to d 1 > d 2 > · · · > d m > d P , we sequentially determine d 1 , d 2 , · · · , d m and d P . According to (19), D j and D P can be calculated using the following methodology.
(1) When j = 1, it can be inferred that the variable d 1 reaches its maximum value under the circumstance of d 2 = d 3 = · · · = d m = d P = 1, so (2) When 2 ≤ j ≤ m, it can be inferred that the variable d j reaches its maximum value under the circumstance of d j+1 = d j+2 = · · · = d m = d P = 1, so (21) (3) When d j is completely determined, the maximum possible value of d P is Given the aforementioned expression, upon specifying the value of d C , one can determine the values of D 1 , D 2 , · · · , D m and D P in a sequential manner. Thereafter, the search process can be employed to obtain the optimal precoding degree distribution, as presented in Algorithm 1, where the symbol "←" signifies assignment.

Numerical Results
In this section, we present some simulation results to illustrate the performance of our proposed coding scheme. As is shown in Figure 5, we consider the two-hop line-erasure network with one relay node r between the source s and destination t where the channel erasure probability of each hop is 0.2. Unless explicitly stated, we use the following parameters: the number of source packets is K = 10, 000 where MIP occupies 0.1, the weight factor of MIP is T 1 = 2, and the size of a batch is M = 16. The channel rank distribution and degree distribution of the BATS code are shown in Table 1 and Table 2 [3], respectively. We set γ = 0.45 and R = 0.95. Using Algorithm 1, we find that when d C = 100, the optimal degree distributions of precoding are d 1 = 23, d 2 = 3, d P = 2, while for d C = 80, they are d 1 = 13, d 2 = 3, d P = 2. We randomly generate the precoding check matrix H = H 1 H 2 |H P according to the degree distribution, where H P is a non-singular matrix. Figure 6 shows the packet error rate of the weighted BATS code based on PR-LDPC precoding at different precoding rates. From the simulation results, it can be observed that when the coding redundancy γ is small (γ < 0.45), the packet error rate of using precoding at different rates is very close. Because with a high-rate precoding, the receiver mainly relies on the weighted BATS decoder to recover the input packets, while the precoding decoder almost does not recover input packets. Therefore, the performance of using different precoding rates is similar to that of the conventional weighted BATS code in this case. When the coding redundancy is small, the packet error rate slightly increases as the precoding rate decreases. Because under the condition of constant coding redundancy, lower precoding rates introduce more redundancy in the precoding stage and less redundancy in the weighted BATS code stage. Since the decoding error probability mainly depends on the performance of the weighted BATS code when the coding redundancy is small, the lower precoding rates result in higher overall packet error rate. However, as the coding redundancy γ increases and the receiver recovers enough input packets, the number of input packets recovered in the precoding decoding stage increases. Moreover, the lower the precoding rate, the more input packets are recovered in the precoding decoder. Thus, the packet error rate decreases faster, and the error floor is lower. Figure 7 demonstrates the performance of weighted BATS codes with PR-LDPC precoding using various degree distributions in terms of packet error rate. The simulation results indicate that when the encoding redundancy is small, the packet error rate is nearly identical across different precoding degree distributions. This can be attributed to the fact that, at this stage, the decoding of the weighted BATS codes is primarily responsible for recovering input packets. However, as the encoding redundancy increases, the packet error rate is highest when utilizing regular LDPC codes as precoding. This is due to the higher degree of LIP in regular LDPC codes with the same check node degree, and the higher error rate of LIP. As a result, in BP decoding, the probability of deleting edges connected to check nodes with LIP is lower, resulting in a lower probability of check nodes with degree 1. Consequently, the packet error rate is higher when employing regular LDPC codes as precoding. Given the precoding degree distribution and γ, we can optimize T M with the DE analysis in Sec. III B. Figure 8 shows the performance of MIP and LIP with different T 1 when γ = 0.48 and precoding degree distribution is d 1 = 23, d 2 = 3, d P = 2. According to the asymptotic results, the error probability of MIP is minimized when T 1 = 1.9. The simulation result in Figure 9 shows the packet error rate of weighted BATS codes and our proposed scheme when T 1 = 1.9 and T 1 = 2. As is shown in Figure 9, when the coding redundancy is small, the error rate of our proposed scheme is slightly higher than that of the weighted BATS codes. That is because precoding can hardly lower the packet error rate but increases the overall encoding redundancy. As the coding redundancy increases, the conventional weighted BATS codes have high error floor. The packet error rate of our proposed scheme drops sharply, which is significantly lower than that of the conventional weighted BATS codes. Meanwhile, in our scheme, the packet error rate when T 1 = 1.9 is lower than that when T 1 = 2, which verifies the optimization results above. Proposed UEP-BATS LIP T 1 =1.9 Figure 9. The packet error rate comparison of the proposed coding scheme and conventional weighted BATS codes with different encoding redundancy γ when R = 0.95.

Conclusions
In this paper, we propose a novel UEP-BATS coding scheme which performs UEP-LDPC precoding before the weighted BATS code. Compared with conventional weighted BATS codes, our proposed coding scheme has lower packet error rate. We analyze the situation where the input packets have two important levels in detail and derive the DE formulas of the proposed coding scheme decoded using the BP algorithm on BEC. We also optimize precoding degree distribution and weight factor of weighted BATS with the help of DE analysis. Finally, simulation results show that compared with the conventional weighted BATS code, our coding scheme has lower packet error rate with the increase of encoding redundancy.