## 6 Network Layer for WVSN
### Dropping Scheme
#### 6.2.1 Energy Aware Dropping  
Clearly the energy of each active video node decreases over time. Therefore, discarding priority level is calculated on the basis of normalized energy level of a node. All received packets with this priority level and lower are discarded. As shown in Figure 12, each priority levels \(P_{I}\), \(P_{2}\),...., \(P_{k}\),..., \(P_{N}\). \(\imath\), is associated with a normalized energy level \(ES_{(1)}\), \(ES_{(2)}\),...., \(ES_{(k)}\),..., \(ES_{(N\cdot 1)}\) respectively. These levels should be specified by the user regarding to the application. \(P_{k}\) stands for both \(P_{M(k)}\) and \(P_{D(k)}\) as mentioned in Section 4.1.1 and 4.2.1, respectively and for each priority level (\(k\)) \(\in\) N, there exists \(ES_{(k)}\)\(\in\) [0,1) such that \(ES_{(k)}\)\(<\)\(ES_{(k+1)}\). For example, if energy of a node becomes less than \(ES_{(k)}\), then packets with priority level (\(k\)) and lower priority levels are not transmitted.  
In order to reach a proper energy level for each priority level that is compatible with the requirement of application as well, Equation (5) is suggested:  
Figure 11: Routing protocol state-machine for VSN in receiver-mode  
Figure 12: Energy aware dropping scheme based on Energy-State of node\[ES_{(l)}=\begin{cases}(\dfrac{l}{N})^{z}&\quad\text{if}\quad 1<l<N\\ 0&\quad\text{if}\quad l==1\end{cases} \tag{5}\]  
In this equation, \(N\) is the maximum number of priority levels and (\(l\)) is the current priority level. \(z\) is used to make equation (5) adaptable with different applications. For instance, if in an application, lifetime of the network is the major point and normal video quality is sufficient, choosing \(z<\)\(l\) in the equation will lead to high values for \(ES_{(l)}\). Consequently, nodes start to drop priority levels more quickly. Therefore, video quality decreases when lifetime of network improves significantly. Conversely, for applications whose concerning point is video quality, values greater than \(l\) for \(z\) causes nodes to begin dropping in lower level of energy. In all simulations \(z\) is considered \(2\). Figure 13, shows different \(ES_{(l)}\) calculated for various values of \(z\).  
The energy-aware dropping scheme uses Equation (5) to define the priority level which can be sent. This scheme first maps the domain of the nodes energy between \(0\) and \(1\), and then calculates the result of Equation (5) according to current priority level (\(ES_{(l)}\)). After comparing the mapped energy with \(ES_{(l)}\), it will be determined whether or not this priority level can be transmitted. If mapped energy of the node is greater, node is allowed to send the data of the priority level; otherwise the node is unable to send the priority level. For example by choosing the value \(2\) for \(z\) in Figure 13, if a mapped energy of a node equals \(0.4\) then \(ES_{(4)}\) is \(0.327\) for data packets with priority level (\(4\)). In this example since \(ES_{(4)}\)is less than mapped energy, node passes them to the next stage. Unlike for priority level (5) which calculated \(ES_{(5)}\) is \(0.5\), the node drops packets.  
If a node cannot transmit packets with specific priority level and lower than that, its child is not allowed to send packets with this priority level and lower to this node. The node notifies its children by ANMT when they ask for communication. If all parents of a node cannot send packets with specific priority level and lower, that node itself cannot send packets as well.  
Figure 13: Values of \(ES_{(l)}\) using different z