## 2 Routing Protocol Design
### TSBNC Design  
Compared with a traditional network, our network mainly uses the multicast transmission method [11]. This has immense advantages in increasing throughput rate, improving the stability of communication, a simple management strategy and so on [12]. The essence of network coding is to use the computation of nodes to improve the bandwidth efficiency. Its work principle is shown in Figure 6(b). \(S\) is the source node, \(x\) and \(y\) are destination nodes. Each channel has 1 bit/s bandwidth. If we forward 1 bit data (a, b) from \(S\) to \(x\) and \(y\) using the traditional method, we have route 3\(\rightarrow\)4, as can be seen in Figure 6(a). Since \(a\) and \(b\) cannot go through the route 3\(\rightarrow\)4 in the same time, we only can use the store-and-forward method; its maximum data flow is 1.5 bit/s. If we use network coding method, node 3 codes \(a\) and \(b\) with XOR operation into a new packet and forwards it to \(x\) and \(y\) through node 4. In such a case, \(x\) can obtain the packet through a decoding method as well as \(y\). The maximum flow rate is 2 bit/s and the bandwidth utilization ratio is thus increased 33%.  
After the establishment of the routes, each node has at least one route to the sink. Nodes will send the collected data to the sink following this route. To further save energy and bandwidth, we employ network coding in the forward process. Intermediate nodes code several received packets into one coding packet, and forward it to the next hop. Thus, we can extend the network lifetime.  
Two nodes can forward each other's packets when they are in the same communication. Assume \(A\) and \(B\) are two nodes that are connected. Packet \(E\) is the linear combination of several source packets (\(X_{l}\), \(X_{2}\),..., \(X_{k}\)). \(E=\sum_{i\,=\,1}^{K}\alpha_{i}X_{i^{\prime}}\), where \(\dot{a}\) is the coding coefficient.  
(1) Node \(A\) codes all the packets which are in its buffer (\(y_{1}\), \(y_{2}\),..., \(y_{m}\)) into one coding packet \(E_{a}\).  
\[E_{a}\ =\ \sum_{i\,=\,1}^{m}\ \ \beta_{i}\ y_{i} \tag{6}\]  
where \(\dot{a}_{i}\) is chosen from the Galois field randomly.  
(2) Node \(A\) forwards the packet \(E_{a}\) and coding coefficient to \(B\).  
(3) Node \(B\) will put \(\mathrm{E_{a}}\) into a buffer if it has enough space when it receives \(E_{a}\), otherwise it codes \(\mathrm{E_{a}}\) with packets in the buffer with the following equation:  
\[E_{i}\,\text{'}=E_{i}\,\text{'}+\alpha E_{a}\]  
where \(E_{i}^{\prime}\) is the \(i_{th}\) packet, \(a\) is chosen from the Galois field.  
(4) The process will continue until the sink has received the coded packets from other nodes.  
(5) The sink will decode the received k packets. Realized from coding coefficient and coded packets, every packet represents a linear equation that contains \(k\) sources as the unknown element. This decoding matrix represents the coefficient matrix for the linear system. If \(K\) is the order of the matrix, the sink will continue to receive packets from other nodes.  
Figure 6: Comparison between coding and routing: (**a**) Store-and-forward method. (**b**) Coding method.  
In the process of forwarding packets, intermediate nodes will code all the packets in their buffer and forward them to the next hop. Thus, we can decrease the number of packets and further decrease the consumption of energy and increase the bandwidth utility ratio.