# On Applicability of Network Coding Technique for 6 LoWPAN-based Sensor Networks
## 4 Performance of NC6 LoWPAN Mechanism  
The NC6 LoWPAN mechanism, as presented in Section 3, was implemented in an open source Contiki Operating System (OS) [26] that incorporates micro IPv6 protocols stack (uIPv6). It was ported to a number of microcontroller architectures, including the Texas Instruments MSP430. The performance of network coding in WSN was tested on the 2.4 GHz IEEE 802.15.4, 8-bit Amtel motes, as well as on the 8-bit Tmote Sky motes. The 8-bit Amtel AVR motes were equipped with AT86 RF230 radio transceiver with high gain PCB antenna and RISC-based ATmega1284 Pmicrocontroller (AVRRAVEN), and with AT86 RF230 radio transceiver with miniature PCB antenna, and AT90 USB1287 microcontroller (RZUSBSTICK). The AVRRAVEN note incorporates 128 KB ISP flash memory with read-while-write capabilities, 4 KB EEPROM and 16 KB SRAM, while the RZUSBSTICK uses 128 KB ISP flash memory with read-while-write capabilities, 4 KB EEPROM and 8 KB SRAM. The Tmote Sky motes utilise 48 KB flash memory and 10 KB RAM. The NC6 LoWPAN mechanism was examined in a testbedding environment. In the first scenario, the network was composed of three Amtel AVR motes (USB stick and AVR Raven boards) with Routing Protocol for Low power and Lossy Networks (RPL) [39]. The structure of the network is shown in Figure 6. Sensor nodes are located in such a way that propagation conditions do not bring packets loss due to jamming or signal attenuation. Thus, possible packet losses are caused by collisions or the sensors' memory limitation (decoding errors). The packet analyser overhears all traffic and it helps packet end-to-end delay and packet loss ratio calculation. Such relatively simple scenario was selected to validate the correctness of NC6 LoWPAN operations. The traffic volume and its profile directly depend on the WSN application. If the sensors perform their standard role (just sensing), the data packet streams are mostly unidirectional (streams from sensors to border gateway). In such a case, there is no gain of the NC6 LoWPAN usage (coding opportunity is low). It is more reasonable to use the NC6 LoWPAN in WSNs with bidirectional traffic (Wireless Sensor & Actuator Network). The following characteristic of traffic exchanged between nodes 1 and 3 was assumed:  
* Packets type: ICMPv6 (emulate bidirectional connectionless traffic, commonly used in sensor/actuator network). * Packet size (ICMP data): 10 Bytes (constant, arbitrary selected). * Number of streams: varying from 1 to 7 (to check an influence of traffic volume on correctness and efficiency of the NC6 LoWPAN). * Packets inter-arrival time distribution: uniform <0.4 s, 0.45 s\(>\) (arbitrary selected, which gives average 188 bps mean data rate). To examine the sensor's memory size allocation for the NC6 LoWPAN, the NC buffer length was changed from 0 to 5 packets in each node, while 0 means that NC6 LoWPAN is switched off, and 5, which means that up to 5 native packets can be buffered for coding or decoding operations. Thus, if higher NC buffer length is set up, then we can expect higher coding opportunity in a node (buffered native packets can be coded with other native packets which are currently received by a node). The native packets were buffered in the node for \(tp=tz=0.5\) s (values of \(tp\) and \(tz\) were arbitrary selected and have to be adjusted in the future depending on the applications end-to-end requirements). The overall traffic volume in the air (network load) was registered using a packet analyser capturing all of the IEEE802.15.4 frames that are generated in the network. Figure 7 shows the overall traffic that is captured in the air as a function of the number of packet streams in one direction for different values of the NC buffer length (number of buffered native  
Figure 6: Simple two-hops Wireless Sensor Networks (WSN). packets). If the NC buffer is full and a new native packet appears, the oldest packet stored in the NC buffer is immediately sent.