# On Applicability of Network Coding Technique for 6 LoWPAN-based Sensor Networks
## 3 Network Coding for 6 LoWPAN-Based Wireless Sensor Networks  
### Linear Network Coding Technique  
The idea of network coding was introduced in 2000 by [PERSON], [PERSON], [PERSON] and [PERSON] in [6], where the authors found that a node cannot only receive and forward packets, but also encode the received packets (map them on other packets), and send the encoded packets to nodes that are able to decode the original packets. It was argued that, while using network coding, the bottleneck problem can be solved in a traditional wireline network. The packets encoding mechanism is, in most cases, based on linear mathematical operations on at least two original (native) packets. A linear network coding theory was promulgated by [PERSON] and [PERSON] in [7] and [PERSON] and [PERSON] in [8]. It assumes that a portion of data (packets, segments, symbols...), which is generated or retransmitted by a node (encoder), can be linearly combined (encoded), giving the vector of the encoded packets. The encoded packets are then sent over the network together with a vector of coefficients used during encoding and decoding. The decoder (or decoders) can decode the original packets after receiving some portion of the encoded packets, while using relatively simple mathematical calculations. The selection of the encoding technique is based on the applied criteria of network performance. Generally, two types of network coding processes exist [35]. Intra-session network coding is typically used to increase the packet delivery ratio in networks with lossy links [22], while inter-session network coding is considered to grow the throughput of the network [14]. The basic concept of the latter technique that is suitable for implementation in resource limited WSNs can be explained using a simple network, as presented in Figure 1. Two nodes (1 and 3) exchange the packets \(p_{1}\) and \(p_{2}\). Unfortunately, both packets cannot reach their destinations directly. Figure 1a shows that the packets \(p_{1}\) and \(p_{2}\) are forwarded by node 2. Typically, node 2 can transmit the packets sequentially (in consecutive slots or after gaining access to the wireless medium). Figure 1: Example of information exchange without (**a**) and with inter-session network coding (**b**). In contrary, Figure 1b shows that node 2 performs a linear coding operation, producing one encoded packet \(c_{1}=p_{1}+p_{2}\) instead of two packets, and broadcasts it to nodes 1 and 3. Encoding operation in node 2 is possible if the destination nodes (1, 3) are able to extract the original packets. To show that decoding is possible in node 3, let us assume that encoding is performed in node 2 for the transmissions that are directed to node 1 and 3. Original packets vector is then composed of two packets \(P_{1\times 2}=[p_{1},p_{2}]\). Let us also select the following static coefficients in the matrix \(V_{2\times 2}\):  
\[V_{2\times 2}=\left[ \begin{array}{cc}v_{11}&v_{12}\\ v_{21}&v_{21}\end{array} \right]=\left[ \begin{array}{cc}1&1\\ 0&1\end{array} \right]. \tag{1}\]  
The vector of encoded packets is calculated, as follows:  
\[C_{1\times 2}^{T}=V_{2\times 2}\times P_{1\times 2}^{T}, \tag{2}\]  
\[C_{1\times 2}^{T}=\left[ \begin{array}{c}c_{1}\\ c_{2}\end{array} \right]=\left[ \begin{array}{cc}1&1\\ 0&1\end{array} \right]\times\left[ \begin{array}{c}p_{1}\\ p_{2}\end{array} \right]=\left[ \begin{array}{c}p_{1}+p_{2}\\ p_{2}\end{array} \right], \tag{3}\]  
where \(P_{1\times 2}^{T}\) is a transpose vector of \(P_{1\times 2}\). Thus, two encoded packets should be received by node 3 to perform the decoding. The packet \(c_{1}=p_{1}+p_{2}\) is constructed in node 2 and \(c_{2}=p_{2}\) must be buffered in node 3. Since the packets are a series of bits (values from the field GF(2)), the XOR bitwise operator is used (\(p_{1}+p_{2}=p_{1}\oplus p_{2}\)). The static coding vectors are not attached to the encoded packets, but they should be known in a decoding node.