## 3 RLS Design
### Localization Phase  
RLS is a centralized localization method where the sink is responsible for estimating the detector sensor location. The message completed by the anchor is sent to the sink station. The sink collects  
Figure 4: Localization applicant message format. Figure 5: Completed message by anchors. information from anchor nodes to estimate the node location. In order to save the energy of ordinary sensor nodes and anchor nodes and also to decrease the localization response time, location estimation occurs at the sink. Suppose there are \(M\) surface anchors on the water surface, their \(x\)-\(y\)-\(z\) coordinates are \((X_{i},Y_{i},0)\) for \(i\in\ [1,M]\) and \(S\) numbers of ordinary sensor node where their coordinates are \((x_{j},y_{j},z_{j})\) for \(j\in\ [1,S]\). RLS establishes localization process from a sensor which is applicant for localization. Hence, the detector sensor does not have any anchor location information. Using a centralized localization is an advantage of RLS where detector sensors do not have to wait to receive beacon signals to estimate their positions. Based on the localization request message shown in Figure 4, an ordinary sensor only acquires depth information by using a pressure sensor where it is assumed that \(z_{j}\) is extracted based on this field. Consequently, the 3-D localization problem becomes a 2-D position estimation problem [33]. Position estimation is based on the lateration method which is a widely used technique and is also employed by GPS systems. Lateration can be used to estimate \(n\) coordinates if there are \(n+1\) or more beacon messages. The method is based on the idea of intersecting circles [2] where the anchor is centered in the circle and the radius of the circle is the distance between the anchor and sensor. Let \(dist\ (i,j)\) be the distance between surface anchor \(i\) and detector sensor \(j\) and it will be calculated by sink based on \(T_{S}\) and \(T_{R}\) field via using TOA as soon as sink receives an anchor message shown in Figure 5. After receiving the anchor message in sink, \(dist\ (i,j)\) is defined as:  
\[dist\ (i,j)\ \in\ \{s|s\in\ LS_{a}\}\text{, where }LS_{a}=\pi r.\ dist.\]  
\(LS_{a}\) is Lateral Surface area of the cone shape made in Figure 2. In fact, all possible distances with the same calculated value by TOA at the unique \(z\) coordinate based on depth field is made the lateral surface area of this cone. In next step during localization phase, detector sensor coordination should be estimated by sink. Basically, the estimated coordinates should satisfy a set of equations:  
\[(x_{j}-X_{i})^{2}+\ (y_{j}-Y_{i})^{2}+\ (z_{j}-Z_{i})^{2}=\ dist^{2} \tag{3}\]  
As mentioned before, \(Z_{i}=0\) and \(z_{j}\) is available, so equation (3) is changed to (4) as follows:  
\[(x_{j}-X_{i})^{2}+\ (y_{j}-Y_{i})^{2}=\ dist^{2}-{z_{j}}^{2} \tag{4}\]  
In Figure 2, it is obvious that \(z_{j}\) is the height of the cone, so \(z_{j}\)= d and the right side of Equation (4) is changed to the following expression:  
\[(x_{j}-X_{i})^{2}+\ (y_{j}-Y_{i})^{2}=\ dist^{2}-d^{2} \tag{5}\]  
where \(dist^{2}-d^{2}\) is equal with the radius of the circular base of the cone shape in Figure 2 and is shown by \(r\). This value is extracted from the simple equation in (6):  
\[r=\sqrt{dist^{2}-d^{2}} \tag{6}\]  
Value \(r\) is calculated by the sink and it inserts \(r\) into the localization message received from the anchor. Hereinafter, this packet will be recorded in the sink as a localization message. Based on this message, The position of an ordinary sensor is estimated as follows:  
\[\forall\ j\in S\ \rightarrow(x_{j},y_{j})\in\Big{\{}p\Big{|}\sum_{i=1}p=Circum \ Circular\ Base\Big{\}} \tag{7}\]where \(Circum\)\(Circular\)\(Base\) is calculated from Equation (8):  
Figure 5:0  
To estimate the x-y coordinates of a detector sensor, according to alteration, only three localization messages are enough.