# RDSP: Rapidly Deployable Wireless Ad Hoc System for Post-Disaster Management
## 3 System Architecture of the RDSP Scheme
The client device then reads the GPS coordinates and transmits the request message towards the server via multi hop intermediate relays. The relay with a minimum ID is selected because it is much closer to the server (as explained earlier in DIA algorithm). After sending the request message, the client device waits for the arrival of the acknowledgment message. If acknowledgment is received, it is then printed on the screen. Algorithm 5 presents the code for the microcontroller in the client device. The input to the client device is the push button \(P_{b}\), acknowledgment message \(Ack_{msg}\), GPS coordinates \(GPS_{cor}\), and available networks \(AVB_{net}\). The output is a request message \(R_{msg}\). As shown in step 1, the client device scans for available networks and it applies the MMN algorithm to select minimum and maximum IDs. Then, in step 2, the client device continuously waits for the detection of events. Since, the client device includes a push button that is pressed by a rescue team member if any victim is sighted. Therefore, if the push button \(P_{b}\) is detected, the client device reads \(GPS_{cor}\) and transmits the request message to the next relay node having \(Min_{ID}\) and continuously waits for the arrival of the acknowledgment message. If the \(Ack_{msg}\) is detected, then acknowledgment is printed on the screen. Figure 7a shows a sample network scenario to explain the working procedure of the RDSP system. As shown in the figure, relays are deployed in a manner to establish two different paths between server device S and client device C. The first path is defined by C, \(a_{1}\), \(a_{2}\), \(a_{3}\), S whereas the second path is defined by C, \(a_{10}\), \(a_{9}\), \(a_{8}\), \(a_{7}\), \(a_{6}\), \(a_{5}\), \(a_{4}\), S. After deployment, each relay node applies the DIA algorithm to select the dynamic ID based on available networks. As shown in Figure 7a, after applying the DIA algorithm, the IDs of \(a_{3}\), \(a_{2}\), \(a_{1}\) are 1, 2, and 3 respectively. Similarly IDs of \(a_{4}\), \(a_{5}\), \(a_{6}\), \(a_{7}\), \(a_{8}\), \(a_{9}\), \(a_{10}\) are 1, 2, 3, 4, 5, 6, 7, and 8 respectively. After ID assignments, each relay and client node applies the MMN algorithm to to select \(Min_{ID}\) and \(Max_{ID}\). Client C receives ID 3 from relay \(a_{1}\) and ID 8 from relay \(a_{10}\). Therefore, client C selects 3 as the minimum ID and 8 as the maximum ID. Similarly, relay \(a_{1}\) selects 2 as the minimum ID and relay \(a_{10}\) selects 7 as the minimum ID. Both relay \(a_{1}\)and relay \(a_{10}\) only receive IDs from relay \(a_{2}\) and relay \(a_{9}\) respectively but not from client C as client C has no ID. Relay \(a_{2}\) receives ID 1 and 3 from relays  
Figure 6: Client device. and \(a_{1}\), respectively, and hence, selects 1 as the minimum and 3 as the maximum ID. This process is continued until all relays select their minimum and maximum neighbor IDs. ```
0:\(P_{b}\) (Push button) \(Ack_{msg}\) (Acknowledgment message ) \(GPS_{cor}\) (GPS coordinates ) \(AVB_{net}\) (Available Networks)
0:\(R_{msg}\) (Request message containing node ID, message ID, and GPS coordinates)
```  
```
1:procedure
2: Step 1: defining and initializing variables
3: Scan \(AVB_{net}\)
4: Apply MMN Algorithm ( returns Min & Max ID)
5: Step 2: detecting events
6:while 1 do
7:if\(P_{b}=true\)then
8: read \(GPS_{cor}\)
9: send \(R_{msg}\) to \(Min_{ID}\)
10:endif
11:if\(Ack_{msg}=true\)then
12: Pring \(Ack_{msg}\) on screen
13:endif
14:endwhile
15:endprocedure
```  
**Algorithm 5** Client device  
Figure 7b shows how the request message \(R_{msg}\) is sent from client C to server S. According to Algorithm 5, if the push button is pressed, the client device sends the request message to a neighbor having \(Min_{ID}\), that is, relay \(a_{1}\) having ID 3. Therefore, client C sends the request message to relay \(a_{1}\) instead of relay \(a_{10}\). According to Algorithm 4, if the request message is received, the relay device sends it to a neighbor having \(Min_{ID}\).