## 6 Network Layer for WVSN
### New Energy-Efficient and Single-Path Routing Protocol for WVSN  
The main task of wireless sensor nodes is to sense and collect data from a target domain, process the data, and transmit the information back to the base-station (Sink) in all applications. Therefore, development of energy-efficient routing protocols is necessary to set up paths between sensor nodes and the Sink. In addition, to use this protocol in wireless video-based sensor networks, it should provide high quality video transmission.  
The proposed routing protocol is a single-path routing based on hierarchical network topology. In EQV-Architecture, a Hierarchical Data Aggregation scheme for sensor networks (HDA) [37] is utilized for configuring hierarchical topology. The routing protocol supposed that in each time Sink requests to  
Figure 7: Transport protocol state-machine. The edge caption is interpreted as: events are above each line and operations are under the lines.  
receive a specified video from the source node only, and the aim of routing is to find an energy-efficient single-path from the source node to Sink while preserving video quality. This protocol is called Energy-efficient Single-path Routing Protocol.  
The proposed routing protocol consists of two kinds of tables: Priority-Table (Pr-T) and Parent-Table (Pa-T). Pr-T is an _N-1_ cell array that _i_-th cell content shows the parent which can forward packets with _i_-th priority level. \(N\) is the maximum priority level that is defined by user in compression layer. As was mentioned in Section 4, only data with priority (_1_) to (_N-1_) will be transmitted. Every time after reconfiguring the hierarchical network structure, cells of Pr-T are set to zero. This table is shown in Figure 8 in detail.  
Pa-T is a link list data structure that includes information that a child has about status of its parents. The fields of each node of link list are: parent _ID_, energy (_e_), distance (_d_) and also the minimum priority level (_l_) that this parent can transmit as is shown in Figure 9.  
When hierarchical structure of the network is reconfigured, in addition to required information for constructing hierarchical tree, each node sends some data to its children to update their Pa-T. Using this information, fields of Pa-T are filled with updated energy, distance, and minimum priority level values of parents. The priority level value that each node transmits to its children is the result of the following equation:  
\[\textit{HighestPriority}\ \ \big{\{}P_{k}\ \text{-1},\ \textit{LowestPriority} \big{\{}P_{1},P_{2},\textit{...},P_{i},\textit{...},P_{M}\big{\}}\big{\}} \tag{4}\]  
Where _P\({}_{k}\) -1_ is the maximum priority level that its current parent is able to transmit, and it is computed on the basis of node energy independent from situations of other nodes. The computation method of _P\({}_{k}\)_ is explained in Section 6.2.1. _P\({}_{i}\)_ stands for priority level that the parent \(i\) in Pa-T list of current parent can transmit and \(M\) is the number of the node's parents.  
In the proposed routing protocol, Pr-T and Pa-T need more memory than does the conventional routing protocols. Unlike energy, memory is a reusable resource. Therefore, it is reasonable to use a little more memory for achieving energy efficiency.  
Depending on whether the proposed routing protocol is in sender-mode or in receiver-mode of the VSN, it works differently. Two dissimilar algorithms for mentioned modes are defined below.  
Figure 8: Priority Table  
Figure 9: Parent Table