## 3 Description of the Firework Routing Protocol
### Mobility Tolerant Firework Routing (MTFR)
#### 3.2.2 Algorithm Details  
The protocol sequence is described in pseudocode in Algorithm 1 and mainly consists of three parts: the system parameter revision procedure, the temperature update procedure and the packet forwarding procedure. In Algorithm 1, preparations for being in-service by a mobile node are done (Lines 1-5) and communication is started (Line 6). During the call busy state, the mobile node performs mainly three tasks periodically (Line 7). First, the mobile node maintains several system management timers to update system parameters, such as the temperature update timer, the hop limit update timer and the system condition timer. After the system condition timer has expired, the mobile node adjusts each system parameter value at the right time (Lines 8-12).  
Second, if the temperature update timer expires, the mobile node starts temperature recalculation (Line 13). Concerning each active link with the neighbor nodes, their temperature values are collected (Line 15), and the node's own temperature is recalculated with them (Line 16). If its own temperature has changed after recalculation, the mobile node sends the new temperature to all its neighbor nodes (Line 19), and if not, a short notification message indicates that no change is sent (Line 21). On the contrary, updated temperature messages from neighbor nodes are also received (Line 22). Each node utilizes the sequence number in exchanging temperature messages to avoid confusion among each node's update timing gap.  
Third, the mobile node looks up the packet transmission table and sends packets to appropriate neighbor nodes according to its own temperature value (Line 23). If the temperature is above the firework threshold, the packet will be sent to all neighbor nodes with a greater temperature than its  
Figure 2: Basic principle of recovery from disconnections in Mobility Tolerant Firework Routing (MTFR). (**a**) Disconnection due to movement of the destination node outside of the coverage area of node \(i\); (**b**) all nodes beyond the firework threshold participate in broadcasting up to the firework hop limit to find a new route to the destination; (**c**) after finding a new route, reachability is recovered and maintained.  
own (Line 25); otherwise, the packet will be sent only to the single neighbor node with the highest temperature (Line 27). Different broadcast algorithms can be considered, as well as another threshold to select nodes for broadcasting packets can be defined. Finally, the mobile node terminates the call (Line 28).  
Note that our MTFR method is a disconnection recovery mechanism and can be used in conjunction with any potential routing method described in Section 2.  
```
Power on the device; Node initialization procedure; Establish links with neighboring nodes; Initial temperature calculation with all nodes before in-service; Collection of call condition; Call origination procedure; forcommunication time\(=1,2,...,\)end timedo ifcondition timer has expiredthen Collection of call condition; Adjust \"temperature update timer\" according to status; Adjust \"hop limit number\" according to status; Adjust \"condition update timer\" according to status; iftemperature update timer has expiredthen foractive link number\(=1,2,...,n\)do Collection of TheirTemperature from all the neighbor nodes; ifany of TheirTemperature has changedthen Update MyTemperature; ifMyTemperature has changedthen Send new MyTemperature; else MyTemperature is unchanged Send short message to indicate \"no-change\"; Receive TheirTemperature message; ifthere is a packet to be forwardedthen ifMyTemperature is greater than firework thresholdthen Broadcast packet to all the neighbors; else MyTemperature is less than threshold Forward packet to highest temperature neighbor;
```  
**Algorithm 1**Firework routing protocol algorithm  
Call termination procedure;