## 3 Rait
### Preemption Scheme  
For the sliding window of the sending queue to work properly, the sending node should not change the parent node (upper node) until it consumes all the tokens received from the upper node, because the receiving node would not allow another child node (lower node) to send a packet until it receives as many packets as it has granted tokens. This means that RAIT guarantees that a sending node will transfer as many packets as it has granted tokens. In addition, RAIT also guarantees that a node will preempt an upper node, as shown in Figure 7. Here, preemption means exclusive possession. If a node is sending packets of an image to an upper node, other nodes that share the upper node with the sending node (child nodes of the receiving node), should wait for the sending node to complete sending all the packets of an image. For example, in Figure 7, node 0 is a parent of node 1 and node 2. If node 1 is sending packets to node 0, node 2 has to wait for node 1 to complete all its packets. If the size of the sending queue in the sensor node is smaller than the image size, then an image would occupy several nodes at once. For example, if a sensor node has a queue that is size 10 and an image that consists of 30 packets, then the image would occupy 3-4 sensor nodes. The preemption scheme in RAIT can reduce the necessary memory spaces in the sink node that collects and arranges image packets received from the sensor nodes. If a non-preemption scheme is used in which sensor nodes compete to send a packet to a parent node, the sink node has to allocate memory space according to the number of sensor nodes, as shown in Figure 8 (A), because packets from several sensor nodes have arrived at the same time. Moreover, packets from a sensor node could arrive at a sink node in a sequence different from their original sequence, because packets would be transferred through multiple paths if the sensor nodes frequently change their parent node in a non-preemption scheme. In this case, a packet could arrive at a sink node earlier than other packets with a higher sequence number, so that a sink node would have to distinguish between a delayed packet and lost packet. For example, in Figure 8 (A), a sink node receives packets 1 and 3, skipping packet 2 from node 8. In this case, the sink node has to distinguish whether packet 2 has been lost somewhere or has just been delayed. The sink node has to wait for packet 2 for an uncertain period of time, and if it does  
Figure 7: Preemption scheme. A sensor node possesses exclusively the parent node during the image transmission. not arrive in that time, then the sink node can regard packet 2 as lost. The problem is that it is hard to define the waiting time for a delayed packet. Even more serious is the problem of how to treat a lost packet. If the sink node disregards the lost packet, then the quality of the image would be degraded to the extent of the information in the lost packets. If the sink node requests that the source node of the lost packet retransmit the lost packets, then the sink node must wait for the retransmitted packet to arrive, while storing the received packets somewhere in memory. This would require additional memory spaces for the delayed collection of the image [26]. On the other hand, if a preemption scheme is used, all the packets of a image arrive at the sink node together, so that a sink node can store memory for an image using much less than is needed for the non-preemption scheme, as shown in Figure 8 (B). With the preemption scheme, the storage space consumed for images in the sink node can be uniform, whereas with the non-preemption scheme, the storage space consumed would increase in proportion to the sensor nodes. Given the arrival of packets in correct sequence and no delayed packets, the preemption scheme does not require the additional memory space for delayed packets that would be required in the non-preemption scheme.