A Transport Protocol for Multimedia Wireless Sensor Networks Duarte Meneses, António Grilo, Paulo Rogério Pereira 1 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Introduction Wireless Sensor Networks Typically a high number of autonomous nodes with sensors and RF communications. Cooperate in a common task retrieving sensor data such as: temperature, humidity, light, image, video, etc. Data is normally forwarded wirelessly to a sink node Used in surveillance and security, industrial process control, military applications, domotics, monitoring, etc. Other networks Mobile devices 2 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Motivation Protection of critical infrastructures, namely electrical energy distribution infrastructures Multimedia data from cameras is routed multi-hop to the sink WSN advantages: ease of installation, configuration, flexibility, low power TCP: end-to-end, loss assumed as congestion, RTT delays New transport protocol tailored for WSN: DTSN. 3 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Objectives Transport protocol for WSN with the following characteristics: Adapted to embedded systems Battery operated Runs on Linux Support reliability Optimize multimedia data transfers, particularly real-time video Support several simultaneous applications Support security mechanisms Ease of use through an API 4 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Transport Protocols for WSN Purpose: Reliability Guarantee and/or Congestion Control Several different characteristics and mechanisms: upstream/downstream communication Loss feedback through: ACK, NACK, iack Lost segment detection: sequence number continuity or timers for each segment end-to-end or hop-by-hop recovery Two types of target applications: sending events or sending large data volumes 5 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks DTSN Sessions identified by a Session Number, Application ID, source and destination addresses Feedback when requested by the source through an Explicit Acknowledgement Request (EAR) Losses detected through the sequence number continuity Selective Repeat retransmission hopby-hop: intermediate nodes cache packets t EAR Timeout Flow Control Timeout Node 1 Node 2 Node 3 DATA 0 DATA 1 DATA 2 DATA 3 DATA 4 DATA 5 DATA 6 DATA 7 + EAR DATA 8 DATA 9 DATA 10 DATA 11 DATA 12 DATA 13 DATA 14 DATA 15 + EAR EAR 15 DATA 0 DATA 1 DATA 8 DATA 15 EAR 15 DATA 16 DATA 17 DATA 18 DATA 19 DATA 20 DATA 21 NACK 0, <0,1,8,15> NACK 7, <> DATA 2 DATA 3 DATA 4 DATA 5 DATA 6 DATA 7 + EAR DATA 9 DATA 10 DATA 11 DATA 12 DATA 13 DATA 14 EAR 15 DATA 0 DATA 1 DATA 8 DATA 15 EAR 15 6 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks NACK 0, <0,1,2> NACK 0, <0,1,2,8,9,15> NACK 7, <8,12> DATA 3 DATA 4 DATA 5 DATA 6 DATA 7 + EAR DATA 3 DATA 10 DATA 11 DATA 12 DATA 13 DATA 14 EAR 15 DATA 10 DATA 12 DATA 2 DATA 9 DATA 2 DATA 9 DATA 0 DATA 1 DATA 15 EAR 15 DATA 10 DATA 8 DATA 12 DATA 8 DATA 12 DATA 16 DATA 17 DATA 18 DATA 19 DATA 16 DATA 17 DATA 18 DATA 19 NACK 0, <0,1,2,3> NACK 0, <0,1,2,8,9,10,12,15> NACK 7, <8,10,12> Node 4
Probabilistic Model Expected number of links crossed: Success probability: Expected number of transmissions per packet: Generalized formulas for different losses in each link: 7 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Probabilistic model 2 Expected number of transmissions when packets are cached with 50% probability: 8 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Development Platform The protocol is generic: can work over several wireless technologies and hardware The Silex SX-560 was used. Supports Wi-Fi 802.11a/b/g. 200 MHz 32-bit ARM processor 16 MB RAM 8MB Flash Runs Linux 792 mw average power 49.6 x 34.3 x 9.65 mm Developer s daughtercard with USB, serial, SPI, GPIO, Ethernet, power 9 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks General Architecture DTSN implemented as a single daemon process for all node types: source, receiver and intermediate nodes. Clients use the protocol through a library that connects to the daemon through UNIX sockets Several configuration parameters may be adjusted in a configuration file 10 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
API Dynamic library Interface similar to the Unix sockets interface Simple operation, with most work done centrally in the daemon The application can receive asynchronous events Threads, blocking and exclusive access implemented through the pthread library 11 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks DTSN Sessions 1 Header present in all packets: Bit Flag 0 ACK 1 NACK 2 EAR 3 DATA 4 RESEND 5 ENDSESSION 6 (not used 7 (not used) Soft unidirectional sessions, identified by <App ID, Session No, Src Addr, Dest Addr>. No connection establishment: the applications just creates the session and start sending packets A complete session description is maintained with buffers, timers, ID, mode, etc. The session can be kept internally after being closed by the application 12 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
359 DTSN Sessions 2 Sliding windows mapped into circular buffers Both windows synchronized. Simple flow control by limiting the number of unconfirmed packets sender receiver Aplication Aplication DTSN 360 DTSN Where the next segment will be placed 367 368 369 370 365 366 364 363 364 365 366 368 369 370 371 372 360 361 362 363 371 372 373 374 367 361 362 373 375 376 374 375 376 358 359 358 Last segment received Oldest unconfirmed segment Last segment sent Next segment to be read by the application Next expected segment 13 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Cache Intermediate nodes participate in packet recovery Space uniformly divided through existing sessions Packets kept in linked lists FIFO for each session Other caching policies for future work Packets eliminated with ACK/NACK/ENDSESSION received if security is not used 14 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Timers There are 5 timers with different periods and purposes. There is always a single one active at each time for each session. sender receiver Activity Timeout: used when the sender window is not empty or full, and no new data is received from the application, to trigger sending an EAR. EAR Timeout: used when an EAR was sent and the sender is waiting for a NACK/ACK. Wait Timeout: used when the sender window is empty to destroy a session without activity. Flow control Timeout: Active when the sender window is full Receiver Activity Timeout: only timer used by the receiver, restarted every time a packet is received from the source. 15 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Security 1 Most WSN protocols ignore the security issues, assuming it is assured by lower layers (e.g. MAC). This may be energetically inefficient, as only some (important) packets require security Attacks possible by packet replication or injection Purpose: denial of service, data manipulation, reduce node lifetime Security requires some overhead, increasing energy spent Security is optional: the application decides The DTSN security extension uses symmetric cryptographic functions (HMAC based on the SHA-2 hash function). 16 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Security 2 Message Integrity Code (MIC) and key computation: ACK master key AppId per packet ACK key n <packet contents> masterkey HMAC HMAC ACK master key NACK master key HMAC HMAC K (n) ACK K (n) NACK HMAC HMAC MIC ACK (n) MIC NACK (n) NACK master key AppId per packet NACK key n <packet contents> Packet format: 17 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Multimedia M-DTSN functionality implemented, allows restarting a session. The following actions are performed: Discard all packets in the sender window and change the session nr. Intermediate nodes also discard cached packets The receiver eliminates data from the window and notifies the application A new session is implicitly started without additional overhead The idea is to give up on sending data from a frame after a temporal limit set by the application. 18 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Simulation A module to simulate a sensor network over a LAN was developed Routing is made based on DTSN addresses Arbitrary bit error rates can be configured A 1.95 MB file was transmitted over 7 hops 5 situations tested: 512 bytes payload with and without cache 512, 350 and 200 bytes payload with security and cache Single hop between a PC and a Silex to measure throughput 19 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Results 1 20 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Results 2 Comparing the 5 tested scenarios: 200 512 21 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Results 3 22 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Results 4 1.95 MB file transfer over a 10Mbps Ethernet 1 hop, no link errors Performance results: PC Silex Silex PC DTSN 10.36 s (1.51 Mbps) 8.03 s (1.94 Mbps) DTSN with security 10.97 s (1.42 Mbps) 8.22 s (1.90 Mbps) DTSN without delivery to application on Silex 4.69 s (3.33 Mbps) 8.03 s (1.94 Mbps) TFTP (UDP) 12.0 s (1.30 Mbps) 79.9 s (0.20 Mbps) FTP (TCP) 3.00 s (5.20 Mbps) 5.17 s (3.02 Mbps) High overhead in the communication between the protocol and application The security option impact on performance is not significant 23 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks Results 5 Optimized version performance results: PC -> PC (Fast Ethernet) [Mbps] PC -> Silex (802.11b) [Mbps] Silex -> PC (802.11b) [Mbps] Silex -> Silex (802.11b) [Mbps] DTSN 83.20 2.36 3.21 2.69 DTSN with security 62.42 1.68 2.02 1.87 FTP 88.68 5.73 4.47 4.69 TFTP 10.96 0.34 0.29 0.17 Much better performance Silex CPU performance is a limitation 24 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks
Conclusion A transport protocol for real-time streaming in WMSN was successfully implemented and tested. Tests prove the correct operation and show that DTSN is efficient in reducing the number of transmissions in WMSN, thus saving energy. Future work: Dynamic parameters, such as timeouts, window and cache sizes New caching policies, for instance by storing packets with probability less than 1, according to the distance to destination, etc. raw sockets BeagleBoard 25 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks 26 NGI'2011: A Transport Protocol for Multimedia Wireless Sensor Networks