# Sensing and Device Neighborhood-Based Slot Assignment Approach for the Internet of Things
## 4 Proposed Neighborhood-Enabled TDMA Approach
### Discovery of Neighbors in the IoT  
In this phase, every server module \(S_{j}\) is forced to broadcast a control packet, i.e., an \(Msg_{b}\), where the value of the parameter join request is set to zero--that is, \(Join_{Req}=0\). This message, i.e., the \(Msg_{b}\), is collected by those member devices \(C_{i}\) that are placed in the  
Figure 1: Neighborhood-Enabled TDMA approach.  
vicinity of the respective server \(S_{j}\). The neighborhood or the vicinity of the device \(C_{i}\) or server module \(S_{j}\) is defined as presented in Equation (1).  
\[\left\{\begin{aligned} \forall_{a=0...n}\ C_{a}\in\sigma(S_{b})\ \ \textbf{iff}\frac{\sqrt{(C_{a}-S_{b})^{2}+(C_{ya}-S_{y_{b}})^{2}}}{(x_{a}+y_{b})} \ <\ \delta\\ \exists_{a=0...n}\ C_{a}\in\sigma(S_{b})\ \ \textbf{iff}\frac{\sqrt{(C_{a}-S_{b})^{2}+(C_{ya}-S_{y _{b}})^{2}}}{(x_{a}+y_{b})}\ ==\ \delta\end{aligned}\right. \tag{1}\]  
where variable S and C are used to describe the respective server and the devices in the networks, respectively.  
In this equation, \(\sigma\) and \(\delta\) represent the neighborhood of the respective server module and threshold values (preferably distance-based), respectively. Devices \(C_{i}\) with a distance value equal or less than the prescribed threshold value \(\delta\) are potential candidate devices for joining the respective server \(S_{j}\). If a device \(C_{i}\) that fulfills the criteria (as described by the threshold value) is eager to become a member of the respective server module \(S_{j}\), then, initially, it updates the received message \(Msg_{b}\) such that the value of the request is to set to 1, i.e., \(Join_{Rog}=1\), and it sends to the respective server \(S_{j}\) as soon as the prescribed back-off timer is completed, which is defined as the time required by a particular member device \(C_{i}\) to collect such messages from potential server modules. The back-off timer of a particular member device \(C_{i}\) is obtained through Equation (2).  
\[Back-off\ Timer\ (C_{i})\ =\ RAND(0\ to\ 100)\ microsec \tag{2}\]  
Once the back-off timer is expired, then every device \(C_{i}\) thoroughly examines the distance of numerous server modules and the overall strength of the received signal strength indicator ((RSSI) value. Generally, a device \(C_{i}\) prefers to send a join request to that server \(S_{j}\) that has a minimum distance and maximum value of the RSSI. For value of the RSSI, the following Equation (3) is used to compute the path loss ratio or function, which is an important measure to compute the RSSI value.  
\[P(d)=P(d_{0})-10 nlog\frac{d}{d_{0}}-X_{\sigma} \tag{3}\]  
Once the path loss is computed, then the RSSI of the respective server module \(S_{j}\) is calculated using Equation (4)  
\[RSSI(S_{j})=P_{t}-P_{loss}(d) \tag{4}\]  
Every device \(C_{i}\) is forced to utilize these equations to compute RSSI values of the potential server modules \(S_{j}\) (specifically those which are deployed in the vicinity) and send a modified version of the received message, or join request, to that server \(S_{j}\) that has minimum possible distance and maximum value of the RSSI. This mechanism is repeatedly applied by every device \(C_{i}\) in the operational IoT network to become a member of a particular server module \(S_{j}\). In this way, every server module \(S_{j}\) has a list of member devices. It is to be noted that, unlike in existing schemes where it is assumed that every server \(S_{j}\) should have equal member device, this is not mandatory in the proposed TDMA-enabled approach.