## 6 Transport Layer in WMSN
### Reliability and Loss Recovery  
Loss recovery is another service that can be done by the transport protocols and aims to insure reliable packet delivery by retransmitting the lost packets. Loss recovery mechanism consists of three steps: loss detection, loss notification, and retransmission recovery, and these steps can be done either using end-to-end as in STCP [56] or hop-by-hop as in RMST [57] approach. In many applications of WMSN, hop-by-hop approach is preferred because it is more energy efficient (no need to send control messages or data packets over multiple hops), takes less response time, and requires less memory to cache packets for recovery. However, hop-by-hop loss recovery requires intermediate nodes to cache packets for future retransmission, and cannot guarantee packet delivery in case of node failure. Loss detection is either based on the sender by using timer or overhearing, or based on the receiver by using packet sequence number as in RSTP [58]. Loss notification is done explicitly by using acknowledgment messages or implicitly by overhearing success transmission from the next hop. Retransmission in WMSN is preferred to be based on hop-by-hop approach (it is also referred as link-by-link) where the packets can be cached at the intermediate nodes for less duration and for faster retransmission in case of packet loss. However, there is an overhead of using the limited buffer space at the intermediate node for caching packets for other nodes, as well as performing timely storage and flushing operations on the buffer. Therefore, this rises the need for in-network storage mechanism [59] or collaboration-based distributed cache points over the network [60]. Some mechanisms as in DWT-Reliable [61] and MMDR [62] provide reliability for multimedia streaming transmission in WMSN by exploiting the source video coding techniques by which the source traffic can be splitted into multiple streams. Each stream can be given different priority, depending on its resolution-level of the original content, and transferred over the network using priority-based routing or multipath routes. The same concept of using multimedia processing to prioritize data packets for reliable transmission has been used in [63] where WMSN transparent protocol, called Reliable Synchronous Transport Protocol (RSTP) is demonstrated. RSTP aims to reduce the large transmission delay of transferring multiple images between the source nodes and the sink due to transmission errors and limited bandwidth, and to provide ordered delivery. RSTP exploits the semantic of Progressive JPEG image stream to prioritize different parts of the stream and schedule the transmission based on the importance of the information. Progressive JPEG is used here rather than baseline JPEG because the first uses the coarse-to-clear data presentation mode which separates the DCT coefficients using multiple scans. By this way, the image can be divided into a number of scans that has smaller size than the original image and the low-quality (coarse) version of the image can be transmitted faster over WMSN. In RSTP, the less important parts within a data stream, which are the high frequency parts or the high quality version, would be discarded if there is not enough bandwidth. As a result, the limited bandwidth will be shared equally among the sensor nodes and the same transmission rate is maintained. Also the packets of images taken at earlier time would be scheduled first so that the temporal properties of the reference images are reserved. Once all the reference images reach the same quality level at the sink side, the image reconstruction process can start. For connection establishment and termination, RSTP uses similar technique of three-way handshake of the classic TCP protocol with the except that the receiver, not the sender, initiates the connection. For loss recovery, the receiver tracks the sequence number of the received packets and sends retransmission request if there is a gap in the sequence numbers or when the timeout alarms without receiving the last packet.