## 3 Rait
### Preemption Scheme
Moreover, the competition for a communication channel among sensor nodes that try to send a packet to an upper node could be reduced by preemption in RAIT. We assume a wireless sensor network with a CSMA-based MAC protocol in which each sensor node has to compete with the others  
Figure 8: Management of received image packets in sink node. With non-preemption scheme (A), sink node has to manage the memory space in proportion to the number of nodes, whereas with preemption scheme (B), sink node has to manage the memory space with size of image. for a communication channel. Given a CSMA-based MAC protocol with a non-preemption scheme, a sensor node that attempts to send a packet will check the communication channel by sensing the carrier signal to see whether the other sensor node is already sending a packet. If there is no carrier signal, then the sensor node can send a packet. However, if a carrier signal is sensed, this means that the other sensor node has occupied the channel so that the sensor node has to wait for some time. In this case, the sensor node must check the signal after a waiting period equal to the transmission time of one packet. If there are several sensor nodes that have a packet to send, then these sensor nodes have to compete for the channel for some time. For example, as shown in Figure 9 (A), if sensor node 2 is sending a packet, then the other sensor nodes (sensor nodes 3, 4, 5) have to wait for sensor node 2 to finish sending a packet. On the other hand, with a preemption scheme, if a sensor node is sending packets of an image, other sensor nodes that have the same parent node can know how many packets the sending sensor node is sending due to token information sent by the parent node. A token packet from a parent sensor node  
Figure 9: Competition for communication medium. With non-preemption scheme (A), sensor nodes have to compete for the channel every time for packet transmission, whereas with preemption scheme (B), sensor nodes just compete once. consists of the following information: Node ID (sending node), Total Packets, Current Packet Sequence, and Token Counts. All the child sensor nodes of the parent sensor node can receive the token packet that is broadcast by the parent sensor node, and thus the other sensor nodes can know who is sending, how many packets are being sent, and how many packets remain. These other sensor nodes will therefore wait for all the packets of an image to be transferred, not a single packet, because RAIT guarantees exclusive possession of the parent node. This means that other sensor nodes do not need to check the channel for a carrier signal, which in turn means reduced competition for a channel. Instead, these sensor nodes will listen for an ACK packet from the parent node, which sends an ACK packet whenever it properly receives a packet from a child sensor node. By counting the received ACK packets, other sensor nodes can know how many packets have been sent and how long they will need to wait. For example, as shown in Figure 9 (B), if sensor node 2 is sending 20 packets to parent sensor node 1, the other sensor nodes (sensor nodes 3, 4, 5) will wait for sensor node 2 to finish transferring 20 packets by counting until 20 ACK packets have been received. As a consequence, sensor nodes with a non-preemption scheme compete for the communication channel for a packet, whereas sensor nodes with a preemption scheme compete for the communication channel for an image.