## 3 O-MAC Protocol Design Goals and Architecture
### Exterior Communication  
This section describes how to fix the schedules within the regions and exterior to the regions (base station or adjacent region). Each region of the WSN is managed and controlled by the DON, which collects the data packets from interior nodes and forwards the data packets to the exterior region. The DON of each region uses a schedule-based mechanism to communicate either interior or exterior nodes. When a DON wants to share its schedule with interior nodes, it first broadcasts three \"hello\" messages to warn the interior nodes to be ready for receiving the dynamic operational node indication signal (DONIS). The DONIS contains the current time, next collection time, and next delivery time. The current time consists of the current activities of the DON. The next collection time gives the complete schedule to the interior nodes and also collects the data from them. The next delivery time indicates when the DON must forward the collected data packets from the interior nodes to the base station or adjacent DON. If the interior region is far from the base station, the DON must synchronize with another DON to forward the collected data packets from the interior nodes to the base station. All of the interior nodes are active only during the DONIS to receive the schedule from the DON. Once the DON announces the schedule for the interior nodes, all of the nodes must follow the announced schedule. The working process for exterior communication is described in Algorithm 2. ```
1. Input (\(D_{s}\): Dynamic operational node indication signal, \(A_{ck}\): Acknowledgement & \(\hat{\Pi}\): Hello messages)
2. Output (\(EX_{t}\): Exterior traffic, & \(EN_{t}\): Exterior traffic)
3. Parameters (\(C_{t}\): Current time, \(CA_{t}\): Next collection time, & \(D_{t}\): Next delivery time)
4. Initialization of network (\(BS\): Base station, : Adjacent region, \(D_{on}\): Dynamic operational node, \(S_{ns}\): Sensor nodes of region \(T_{n}\): Total nodes, & \(R_{A}\): Region of Network)
5. if\(D_{on}\) forwards \(\hat{\Pi}\) into \(R_{A}\) then;
6. Set \(S_{ns}\) response with \(A_{ck}\)
7. end if
8. if\(D_{on}\) gets \(A_{ck}\) then;
9. Set \(D_{on}\) broadcasts \(D_{s}\)
10. Set \(D_{s}\) = \(C_{t}\) + \(CA_{t}\) + \(D_{t}\)
11. end if
12. if\(S_{ns}\) receive \(D_{s}\) then;
13. \(S_{ns}\) forwards \(EN_{t}\)to \(D_{on}\)
14. for(\(S_{ns}\) = 0; \(S_{ns}\)\(\leq\)\(T_{n}\); \(S_{ns}\) + 1)
15. Store\(EN_{t}\) = \(EN_{t}\) + \(S_{ns}\)
16. Set \(EX_{t}\) \(\approx\)\(EN_{t}\)
17. end for
18. Set \(D_{on}\) forwards \(EX_{t}\)to \(BS\)\(\parallel A_{R}\)
19. end if
```  
**Algorithm 2** Exterior Communication Process  
### Exterior Communication  
This section describes how to fix the schedules within the regions and exterior to the regions (base station or adjacent region). Each region of the WSN is managed and controlled by the DON, which collects the data packets from interior nodes and forwards the data packets to the exterior region. The DON of each region uses a schedule-based mechanism to communicate either interior or exterior nodes. When a DON wants to share its schedule with interior nodes, it first broadcasts three \"hello\" messages to warn the interior nodes to be ready for receiving the dynamic operational node indication signal (DONIS). The DONIS contains the current time, next collection time, and next delivery time. The current time consists of the current activities of the DON. The next collection time gives the complete schedule to the interior nodes and also collects the data from them. The next delivery time indicates when the DON must forward the collected data packets from the interior nodes to the base station or adjacent DON. If the interior region is far from the base station, the DON must synchronize with another DON to forward the collected data packets from the interior nodes to the base station. All of the interior nodes are active only during the DONIS to receive the schedule from the DON.