## 4 Proposed Protocol  
Considering underwater constraints including the propagation model, harsh environment, water current, and depth in 3D UWSNs, a packet forwarding protocol based on alternate path to conserve the energy is proposed.  
The proposed protocol is based on SPRINT protocol [4], which is designed to achieve trade-off between energy consumption and throughput. A packet forwarding node selects one of its neighbors as a relay node. The main criterion to select a relay node is the minimum distance to conserve the energy. The distance is estimated by the received signal strength (RSS). However, minimum distance is not the only criterion. The use of number of hops or relay nodes from source to final destination affects the throughput. Each hop adds to the delay in packet forwarding and, as a result, reduces throughput. Therefore, along with the distance parameter, the number of hops between the relay and the sink and the number of neighbors of the relay node are also taken into consideration. The minimum number of hops is used to maximize the throughput while minimum number of neighbors is used to minimize the traffic congestion and energy consumption of the relay. It is possible that the selected relay node is not the optimal selection due to error in RSS estimation. However, the optimal node may be selected later as the relay selection process is recursive. The routing path formation will be initiated by the sink and data packets will be sent once the routing path formation process is over. To avoid the network overhead and enhance packet delivery ratio, the routing path will be updated recursively at some suitable interval depending on the data packets arrival rate. The distance, energy consumption and number of neighbors are not static parameters of the network. The distance between the two nodes may change due to the limited mobility of the nodes. Furthermore, the energy consumption of some nodes may be higher than the others and number of neighbors may also change because of the nodes limited mobility and failures. As the selection parameters are not static and the optimal routing path is sought, a fuzzy logic scheme to select the relay node has been envisaged. The selection is based on three input parameters: (i) number of hops in the path, (ii) number of neighbors of a node, and (iii) distance from a transmitting node to the forwarding node. In SPRINT protocol, three weight factors are used with those three parameters. In this proposal, a fuzzy inference method is applied to select the forwarding node, and it will be shown that it is possible to reduce both the packet delay and the overall energy used by the network.  
The structure of a fuzzy logic system can be seen in Figure 3. The system has three elements or stages: the input mapping or fuzzification stage, the decision core (also called \"fuzzy rules\" or \"fuzzy logic engine\" in technical literature), and the output mapping or de-fuzzification stage. In the first stage, the so-called membership functions map the possible values of the input variables to the real range [0,1]. Simple analytic canonic functions like triangular, rectangular, or gaussian functions are used as membership functions, although other shapes are also possible, such as sigmoid and bell functions. In this work, triangular functions have been used due to their simplicity. The second stage, the so-called core decision, is implemented by a set of rules (Boolean, _IF-THEN_,... ). All rules are evaluated in parallel using fuzzy reasoning. Eventually, the outputs of the core decision stage enter the defuzzification stage, where they are combined to provide a normalized numerical value called Chance, which is the response of the fuzzy logic system. The defuzzification stage also uses a membership function. Fuzzy logic system is described more in detail in the next section.  
Figure 3: Simplified structure of a fuzzy inference system.