{'fraction_non_alphanumeric': 0.030945058283023883, 'fraction_numerical': 0.006872460796597942, 'mean_word_length': 4.082593593207256, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Network Protection Codes Against Link Failures Using Network Coding

Protecting against link failures in communication networks is essential to increase robustness, accessibility, and reliability of data transmission. Recently, network coding has been proposed as a solution to provide agile and cost efficient network protection against link failures, which does not require data rerouting, or packet retransmission. To achieve this, separate paths have to be provisioned to carry encoded packets, hence requiring either the addition of extra links, or reserving some of the resources for this purpose. In this paper, we propose network protection codes against a single link failure using network coding, where a separate path using reserved links is not needed. In this case portions of the link capacities are used to carry the encoded packets. The scheme is extended to protect against multiple link failures and can be implemented at an overlay layer. Although this leads to reducing the network capacity, the network capacity reduction is asymptotically small in most cases of practical interest. We demonstrate that such network protection codes are equivalent to error correcting codes for erasure channels. Finally, we study the encoding and decoding operations of such codes over the binary field.


I. INTRODUCTION
Network coding is a powerful tool that has been used to increase the throughput, capacity, and performance of communication networks [15], [18]. It offers benefits in terms of energy efficiency, additional security, and reduced delay. Network coding allows the intermediate nodes not only to forward packets using network scheduling algorithms, but also encode/decode them using algebraic primitive operations (see [1], [4], [15], [18] and references therein).
One application of network coding that has been proposed recently is to provide protection against link failures in overlay networks [9], [12]. This is achieved by transmitting combinations of data units from multiple connections on a backup path in a manner that enables each receiver node to recover a copy of the data transmitted on the working path in case the working path fails. This can result in recovery from failures without data rerouting, hence achieving agile protection. Moreover, the sharing of protection resources between multiple connections through the transmission of linear combinations of data units results in efficient use of protection resources. This, however, requires the establishment of extra paths over which the combined data units are transmitted. Such paths may require the This research was supported in part by grants CNS-0626741 and CNS-0721453 from the National Science Foundation, and a gift from Cisco Systems.
addition of links to the network under the Separate Capacity Provisioning strategy (SCP), or that paths be provisioned using existing links if using the Joint Capacity Provisioning strategy (JCP), hence reducing the network traffic carrying capacity.
Certain networks can allow extra transmissions and the addition of bandwidth, but they do not allow the addition of new paths. In this scenario, one needs to design efficient data recovery schemes. Several previous approaches focused on solving this problem using additional extra paths at an overlay network level, or deploying ARQ protocols for the recovery of lost packets. In order to provide recovery from link failures in such networks, approaches other than using dedicated paths, or adding extra links must be used. In this paper, we propose such an approach in which we use network coding to provide agile, and resource efficient protection against link failures, and without adding extra paths. The approach is based on combining data units from a number of sources, and then transmitting the encoded data units using a small fraction of the bandwidth allocated to the connections, hence disposing of the requirement of having extra paths. In this scenario, once a path fails, the receiver can recover the lost packets easily from the neighbors by initiating simple queries.
Previous solutions in network survivability approaches using network coding focused on providing backup paths to recover the data affected by the failures [9], [10], [11]. Such approaches include 1+N, and M+N protections. In 1+N protection, an extra secondary path is used to carry combinations of data units from N different connections, and is therefore used to protect N primary paths from any single link failure. The M+N is an extension of 1+N protection where M extra secondary paths are needed to protect multiple link failures.
In this paper, we apply network coding for network protection against link failures and packet loss. We define the concept of protection codes similar to error-correcting codes that are widely used in channel coding [8], [14]. Protection codes are a new class of error monitoring codes that we propose in Section V. Such codes aim to provide better provisioning and data recovery mechanisms. A protection code is defined by a matrix G known at a set of senders S and receivers R. Every column vector in the generator matrix of a protection code defines the set of operations, in which every sender (receiver) needs to perform.
The new contributions in this paper are stated as follows: i) We introduce link protection network coding-based using reduced capacity instead of adding extra paths as shown in the previous work [9], [10], [11]. ii) We develop a theoretical foundation of protection codes, in which the receivers are able to recover data sent over t failed links out of n primary links. This paper is organized as follows. In Section II we briefly state the related work and previous solutions to the network protection problem using network coding. In Section III we present the network model and problem definition. Sections IV and V discuss single and multiple link failures and how to protect these link failures using reduced capacity and network coding. In Section VI we give analysis of the general case of t ≪ n link failures, and the paper is concluded in Section VII.

II. RELATED WORK
In [9], the author introduced a 1+N protection model in optical mesh networks using network coding over p-cycles. The author suggested a model for protecting N connections from a set of sources to a set of receivers in a network with n connections, where one connection might fail. The suggested model can protect against a single link failure in any arbitrary path connecting a source and destination.
In [10], the author extended the previous model to protect multiple link failures. It is shown that protecting against m failures, at least m p-cycles are needed. An illustrative example in case of two link failures was given. The idea was to derive m linearly independent equations to recover the data sent from m sources.
In [11], the author extended the protection model in [9] and provided a GMPLS-based implementation of a link protection strategy that is a hybrid of 1+N and 1:N. It is claimed that the hybrid 1+N link protection provides protection at higher layers and with a speed that is comparable to the speed achieved by the physical layer implementations. In addition, it has less cost and much flexibility.
Monitoring network information flow using network coding was introduced in [7], [6]. In [5], it was shown how to use network coding techniques to improve network monitoring in overlay networks. Practical aspects of network coding has been shown in [3].
In this paper, we provide a new technique for protecting network failures using protection codes and reduced capacity. This technique can be deployed at an overlay layer in optical mesh networks, in which detecting failure is an essential task. The benefits of the proposed approach are that: i) It allows receivers to recover the lost data without data rerouting or data retransmission. ii) It has less computational complexity and does not require adding extra paths or reserving backup paths. iii) At any point in time, all n connection paths have full capacity except at one path in case of protecting against a single link failure and m < n paths in case of protecting against m link failures.
We will analyze the proposed protection codes and error correcting codes that are used for erasure channels.

III. NETWORK MODEL
Let G = (V, E) be a graph which represents an abstraction of a set of connections. V is a set of network nodes and E is a set of edges. Let there be n unicast connections, and let S ⊂ V be the set of sources {s 1 , ..., s n } and R ⊂ V \S be the set of receiver nodes {r 1 , ..., r n } of the n connections in G. The case of S ∩ R = φ can be easily incorporated in our model. Two nodes u and v in V \{S ∪ R} are connected by an edge (u, v) in E if there is a direct connection between them. We assume that the sources are independent of each other, meaning they can only send messages and there is no correlation between them. For simplicity, we will assume that a direct disjoint path exists between s i and r i , and it is disjoint from the path between s j and r j , for j = i.
The graph G represents an abstraction of our network model N with the following assumptions.
i) Let N be a network with a set of sources S = {s 1 , s 2 , . . . , s n } and a set of receivers ii) Let L be a set of links L 1 , L 2 , . . . , L n such that there is a link L i if and only if there is a connection path between the sender s i and receiver r i , i.e., for some integer m. Hence we have |S| = |R| = |L| = n. The n connection paths are pairwise link disjoint. iii) Every source s ℓ sends a packet with its own ID s ℓ and data x ℓ to the receiver r ℓ , so where t δ ℓ is the round time at step δ of the source packet packet s ℓ . iv) All links carry uni-directional messages from sources to receivers. v) We consider the scenario where the cost of adding a new path is higher than just combining messages in an existing path, or there is not enough resources to provision extra paths in the network. These two cases correspond to separate and joint capacity provisioning, respectively [19]. We can define the unit capacity c i of a link L i as follows.
Definition 1: Let N be a network model defined by a tuple (S, R, L). The unit capacity of a link L i is given by Also, the average normalized capacity of N is defined by the total number of active links divided by the total number of links n This means that each source s i can send one packet per unit time on a link L i . Assume that all links have the same capacity. In fact, we measure the capacity of N in the sense of the max-flow min-cut theorem, see [13]. One can always assume that a source with a large rate can be divided into a set of sources, each of which has a unit link capacity.
We can also define the set of sources that are connected to a source s i in N as the degree of this source.
Definition 2: The number of neighbors with a direct connection to a node u (i.e., a source s i in S in the network N ) is called the node degree of u ∈ V , and is denoted by d n (u), i.e., The following definition describes the working and protection paths between two network components.
Definition 3: The working paths on a network with n connection paths carry traffic under normal operations. The Protection paths provide alternate backup paths to carry the traffic in case of failures. A protection scheme ensures that data sent from the sources will reach the receivers in case of failure incidences on the working paths.
In this work the goal is to provide a reliable method for data protection sent over a link L i without adding extra paths to the existing ones, but by possibly reducing the source rates slightly. In fact there are network scenarios where adding extra path is not applicable [16], [17], [19]. We propose a model to protect link failures using network coding where some senders are able to encode other sender's packets. We will study the network protection against link failures at an overlay layer in two cases: Single link failures and multiple link failures.

IV. PROTECTING NETWORKS AGAINST A SINGLE LINK FAILURE
In this section we study the problem of protecting a set of connections against a single link failure in a network N with a set of sources S and a set of receivers R. This problem has been studied in [9], [10] by provisioning a path that is link disjoint from all connection paths, and passes through all sources and destinations. All source packets are encoded in one single packet and transmitted over this path. The encoding is dynamic in the sense that packets are added and removed at each source and destination.
Assume that the assumptions about the proposed network model N , and the abstraction graph G presented in Section III hold. We know that if there is an active link L i between s i and r i , then the capacity c i is the unit capacity. Let us consider the case where every source s i sends its own data x i and the encoded data y i . The encoded message y i is defined as from all other sources S\{s i } over the finite field F 2 = {0, 1}, where the symbol ⊕ is the XOR operation. Assume that among the set of links L, there is a link L i for 1 ≤ i ≤ n such that the sources s i sends a packet to the receivers r i as follows Assume for now that link L j has the unit capacity. The source s j sends a packet that will carry the encoded data y j to the receiver r j over the link L j , We assume that the summation operations are performed over F 2 . Now we consider the case where there is a single failure in a link L k . Therefore, we have two cases: i) If k = j, then the receiver r k needs to query (n − 1) nodes in order to recover the lost data x k over the failed link L k . x k can be recovered by adding all other n − 1 data units. ii) If the link L j has a failure, then the receiver r j does not need to query any other node. In this case the link L j carries encoded data that is used for protection. This shows that only one single receiver needs to perform (n − 2) operations in order to recover its data if its link fails.
In other words, all other receivers will receive the transmitted data from the senders of their own connections with a constant operation O(1).

A. Network Protection Codes (NPC) for a Single Link Failure
We can define the set of sources that will send encoded packets by using constraint matrices. We assume that there is a network protection code C ⊆ Without loss of generality, in Equation (9), the column vector ( g 1j g 2j . . . g (n−1)j ) T in F n−1 2 corresponds to (n-1) sources, say for example the sources s 1 , s 2 , . . . , s n−1 , that will send (update) their values to (n-1) receivers, say i.e., r 1 , r 2 , . . . , r n−1 . Also, there exists one source that will send encoded data. Also, the row vector ( g i1 g i2 . . . g in ) in F n 2 determines the channels L 1 , L 2 , . . . , L n . The column vector g in corresponds to the source s i that will carry encoded data on the connection path L i , see Fig. 1. The minimum weight of a row in G is 2.
We can define the protection codes that will protect a single path failure as follows: Definition 4: An [n, n−1, 2] 2 network protection code C is a n − 1 dimensional subspace of the space F n 2 defined by the systematic generator matrix G and is able to protect a single network failure of an arbitrary path L i .
We note that the protection codes are also error correcting codes that can be used for channel detection. Recall that an x 1 +x 2 +…+x j-1 +x j+1 +…+x n X n X n-1 Fig. 1. Network protection against a single link failure using reduced capacity and network coding. One link out of n primary links carries encoded data.
[n, n−1, 2] code over F 2 is a code that encodes (n-1) symbols into n symbols and detects (correct from) a single path failure.
In general, we will assume that the code C defined by the systematic generator matrix G is known for every source s i and every receiver r i . This means that every receiver will be able to recover the data x i if the link L i is corrupted. We assume that the positions of the failures are known. Furthermore, every source node has a copy of the code C. Without loss of generality, the protection matrix among all sources is given by: y n is the protection value from every source s ℓ that will be encoded at source s n , for all 1 ≤ ℓ ≤ n − 1. Put differently, we have The summation operation is defined by the XOR operation. We note that the any source s i can carry the encoded data. Hence from the matrix (10), we have We assume that every source s j has a buffer that stores its value x j and the protection value y j . Hence s j prepares a packet packet sj that contains the values where y j is defined in Equation (12). Example 5: Let S and R be two sets of senders and receivers, respectively, in the network model N . The following scheme explains the plain and encoded data sent in five consecutive rounds from the five senders to the five receivers.
The encoded data y j , for 1 ≤ j ≤ 5, is sent as We notice that every message has its own round. Hence the protection data is distributed among all paths for fairness, see [2] for further details. We notice that it is enough to allow only one source node to perform the encoding operations for protecting against a single path failure. This fact can be stated in the following lemma.
Lemma 6: Encoding the data from sources S\{s i } at a source s i in the network N is enough to protect against a single path failure.
Lemma 7: The total number of encoding operations needed to recover from a single link failure in a network N with n sources is given by (n − 2) and the total number of transmissions is n.
The previous lemma guarantees the recovery from a single arbitrary link failure. The reason is that the link that carries encoded data might fail itself and one needs to protect its data.
Lemma 8: In the network model N , the average network capacity of protecting against a single link failure using reduced capacity and network coding is given by (n − 1)/n. Proof: (Sketch) i) We know that every source s ℓ that sends the data x ℓ has capacity c ℓ = 1. ii) Also, the source s i that sends x i and the encoded data y i at different slots, has a full capacity.
iii) The source s i is not fixed among all nodes S, however, it is rotated periodically over all sources for fairness. On average one source of the n nodes will reduce its capacity. This shows the capacity of N as stated.

V. PROTECTING NETWORKS AGAINST MULTIPLE LINK FAILURES
In the previous section we introduced a strategy for a single link failure in optical mesh networks, where the chance of a single link failure is much higher than multiple link failures. However, it was shown in [5] through an experimental study that about %30 of the failures of the Sprint backbone network are multiple link failures. Hence, one needs to design a general strategy against multiple link failures.
In this section we will generalize the above strategy to protect against t path failures using network protection codes (NPC) and the reduced capacity. We have the following assumptions about the channel model: i) We assume that any t arbitrary paths may fail and they are independent of each other. ii) Location of the failures are known, but they are arbitrary among n connections. iii) Protecting n working paths, k connection must carry plain data, and m = n−k connections must carry encoded data. iv) We do not add extra link paths, and every source node is able to encode the incoming packets. v) We consider the encoding and decoding operations are performed over F 2 . We will show the connection between error correcting codes and protection codes [8], [14].
We have n working paths from the senders to receivers. We will assume that a path L i can have a full capacity or it can manage a buffer that maintains the full capacity where the encoded data is sent.
Assume that the notations in the previous sections hold. Let us assume a network model N with t > 1 path failures. One can define a protection code C which protects n links as shown in the systematic matrix G in (16). In general, the systematic generator matrix G defines the source nodes that will send encoded messages and source nodes that will send only plain messages. In order to protect n working paths, k connection must carry plain data, and m = n − k connections must carry encoded data. The systematic generator matrix of the NPC for multiple link failures is given by: where p ij ∈ F 2 The matrix G can be rewritten as where P is the sub-matrix that defines the redundant data k i=1 p ij , for 1 ≤ j ≤ m, to be sent to a set of sources for the purpose of data protection against data loss and link protection against link failures. Based on the above matrix, every source s i sends its own message x i to the receiver r i via the link L i . In addition m links out of the n links will carry encoded data. d min is the minimum weight of a row in G.
Definition 9: An [n, k, d min ] 2 protection code C is a k dimensional subspace of the space F n 2 that is able to protect all network failures up to d min − 1.
In general the network protection code (NPC), which protects against multiple path failures, can be defined by a generator matrix G known for every sender and receiver. Also, there exists a parity check matrix H corresponds to G such that GH T = 0. We will restrict ourselves in this work to NPC that are generated by a given systematic generator matrix G over F 2 .
Without loss of generality, the protection matrix among all sources is given by We ensure that k = n − m paths have full capacity and they carry the plain data x 1 , x 2 , . . . , x k . Also, all other m paths have full capacity, in which they carry the encoded data y k+1 , y k+2 , . . . , y n . In addition, the m links are not fixed, and they are chosen alternatively between the n links. Encoding Process. The network encoding processes at the set of senders are performed in a similar manner as in Section IV. Every source s i has a copy of the systematic matrix G and it will prepare a packet along with its ID in two different cases. First, if the source s i will send only its own data x i with a full link capacity, then Second, if the source s j will send an encoded data in its packet, then where p ℓj ∈ F 2 . Recovery Process. The recovery process is done as follows. The packet si arrives at a receiver r i in time slots, hence every packet from a source s i has a round time t δ i . In this case, time synchronization is needed to guarantee the reception of the correct data. The receiver r i at time slot n will detect the signal in the link L i . If the link L i failed, then r i will send a query to other receivers in R\{r i } asking for their received data. Assume there are t path failures. Then we have three cases: 1) All t link failures have occurred in links that do not carry encoded packets, i.e., packet si = (ID si , x i , t δ i ). In this case, one receiver that carries an encoded packet, e.g., r j , can send n−t−1 queries to the other receivers with active links asking for their received data. After this process, the receiver r j is able to decode all messages. 2) All t link failures have occurred in links that carry encoded packets, i.e., packet sj = (ID sj , k ℓ=1,ℓ =j x ℓ , t δ j ). In this case no recovery operations are needed.
3) All t link failures have occurred in arbitrary links. This case is a combination of the previous two cases and the recover process is done in a similar way. Only the lost data on the working paths needs to be recovered. Our future work will include practical implementation aspects of the proposed model as shown in the case of adding extra paths [11]. The proposed network protection scheme using distributed capacity and coding is able to recover up to t ≤ d min − 1 link failures (as defined in Definition 9) among n paths and it has the following advantages: i) k = n− m links have full capacity and their sender nodes have the same transmission rate. ii) The m links that carry encoded data are dynamic (distributed) among all n links. Therefore, no single link L i will suffer from reduced capacity. iii) The encoding process is simple once every sender s i knows the NPC. Hence s i maintains a round time t δ ℓ for each sent packet si . iv) The recovery from link failures is done in a dynamic and simple way at one receiver.

VI. ANALYSIS
We shall provide theoretical analysis regarding the proposed network protection codes. One can easily compute the number of paths needed to carry encoded messages to protect against t link failures, and will obtain the average network capacity. The main idea behind NPC is to simplify the encoding operations at the sources and the decoding operations at the receivers. The following lemma demonstrates the average normalized capacity of the proposed network model N .
Lemma 10: Let C be a protection code with parameters [n, n − m, d min ] over F 2 . Assume n and m be the number of sources (receivers) and number of connections carrying encoded packets, respectively, the average capacity of the network N is given by Proof: We have m protection paths that carry encoded data. Hence there are n−m working paths that carry plain data. The result is a direct consequence by applying the normalized capacity definition.
Lemma 11: In the network protection model N , in order to protect t network disjoint link failures, the minimum distance of the protection code must be at least t + 1.
Proof: We can assume that the network link failures can occur at any arbitrary paths. The proof comes from the fact that the protection code can detect t failures.
The previous lemma ensures that the maximum number of failures that can be recovered by C is d min − 1.

VII. CONCLUSION
We studied a model for recovering from network link failures using network coding and reduced capacity. We defined the concept of network protection codes to protect against arbitrary t link failures. We showed that the encoding and decoding processes of the proposed scheme are simple and can be done in a dynamic way at any arbitrary senders and receivers in an overlay layer on optical mesh networks. Our future work will include tables of best known protection codes and a comparison between protection against link failures using reduced capacity and using extra paths.