EWSN 2012

TCP Performance Optimizations for
Wireless Sensor Networks


Philipp Hurni, Ulrich Bürgi, Markus Anwander,
Torsten Braun

Research Group ―Communication and Distributed Systems‖
Institute of Computer Science and Applied Mathematics
University of Bern, Switzerland
braun@iam.unibe.ch, cds.unibe.ch
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Overview


       >     Motivation and Related Work
              — Reasons for Poor TCP Performance in Wireless Multi-Hop Networks
              — Optimization of TCP in WSNs
       >     Proposed Optimization Concepts
              — Caching and Congestion Control (cctrl) Module including
                Channel Activity Monitoring
              — Spatial Reuse by Multiple TCP Connections
       >     Results by Testbed Experiments
              — Throughput
              — Radio On-Time as Energy Consumption Measure
       >     Conclusions



       Trento, February 15, 2012                                              2
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Reasons for Poor TCP Performance in
       Wireless Multi-Hop Networks
       >     Higher bit error rates and packet loss
       >     Underlying MAC protocols
             (exponential back-off, hidden / exposed nodes)
       >     TCP end-to-end error and congestion control mechanisms




             TCP data segment loss                                         TCP acknowledgement loss

       Trento, February 15, 2012                                                                      3
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Optimization of TCP in WSNs


       >     Distributed TCP Caching (Dunkels et al., 2004)




       >     TCP Support for Sensor Networks (Braun et al., 2007)




       Trento, February 15, 2012                                           4
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Caching and Congestion Control (cctrl)
       Module
       >     is aware of all TCP packets forwarded by a node by interception of
             outbound packets.
       >     allocates buffer for 2 packets per TCP connection (1 for each direction,
             µIP has max. 1 unacknowledged TCP data segment per connection)




       Trento, February 15, 2012                                                        5
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       cctrl Functions

       >     Caching of
              — complete TCP data segments and scheduling of retransmission timer
                (RTO = 3 ∙ RTTestimated, RTTestimated = estimated RTT between
                intermediate node and destination)
              — TCP/IP header for TCP acknowledgements
       >     Local retransmission of TCP data segment (max. 3 attempts),
             when RTO expires prior to TCP acknowledgement reception (a)
       >     Removal of TCP data segments, if acknowledgement number of TCP
             acknowledgement > sequence number of cached TCP data segment
       >     For retransmitted TCP data segments, for which a TCP
             acknowledgement has been received: discard TCP data segment;
             regenerate TCP acknowledgement (b)




       Trento, February 15, 2012                                                    6
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Channel Activity Monitoring

       >     MAC proxy notifies cctrl upon reception of any packet and stores a
             timestamp in activity history.
       >     cctrl continuously calculates channel activity level (= # overheard
             packets by MAC proxy during the last time period RTTestimated)
       >     Observation:
              — Channel activity level of most nodes = 0 during long idle periods
              — Long idle periods by
                      –     TCP data segment loss at one of the first hops
                      –     TCP acknowledgement loss close to its destination
                            (i.e. TCP data segment’s source).
       >     Approach:
              — Split RTO into:
                      –     RTO1 = 3 ∙ RTTestimated ∙ 2/3
                      –     RTO2 = 3 ∙ RTTestimated ∙ 1/3
              — When RTO1 expires: early retransmission, if channel activity level = 0;
                otherwise: retransmission when RTO2 expires.
              — Triggers early local retransmissions close to destination
       Trento, February 15, 2012                                                          7
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       MAC Proxy




       Trento, February 15, 2012                                           8
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Channel Activity Levels with X-MAC




       Trento, February 15, 2012                                           9
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Long Idle Periods




       Trento, February 15, 2012                                           10
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Spatial Reuse by Multiple TCP Connections




       Trento, February 15, 2012                                           11
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Testbed Experiments

       >     7 TelosB nodes in different
             rooms of a 3 floor building using
             U Bern’s Wisebed testbed
       >     Receiver node 1
       >     Sender nodes 2-7
       >     Experiments with different
             MAC protocols for 10 minutes,
             15 repetitions
       >     16 bytes payload
       >     79 bytes per TCP data segment
       >     63 bytes per TCP
             acknowledgement
       >     Total: approx. 2500 experiments
             during > 400 hours
       Trento, February 15, 2012                                           12
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Throughput




       Trento, February 15, 2012                                           13
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Radio On-Time as Energy Consumption
       Measure




       Trento, February 15, 2012                                           14
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Throughput with Multiple Connections




       Trento, February 15, 2012                                           15
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Overall Comparison of Throughput




       Trento, February 15, 2012                                           16
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Overall Comparison of Energy Consumption




       Trento, February 15, 2012                                           17
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Cross-Traffic Measurements




       Trento, February 15, 2012                                           18
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Cross-Traffic Throughput




       Trento, February 15, 2012                                           19
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Cross-Traffic Comparison




       Trento, February 15, 2012                                           20
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Conclusions


       >     Implementation of caching, local TCP data segment
             retransmission, and TCP acknowledgement regeneration in
             intermediate nodes on top of several WSN MAC protocols
       >     NullMAC and LPP provide good response to local
             retransmission. Results with ContikiMAC are worse.
       >     cctrl can improve performance and energy efficiency.
       >     Spatial reuse by multiple TCP connections can further improve
             performance.
       >     Best performance and energy efficiency with cctrl and NullMAC !
             → adaptive MAC protocols (Hurni et al., 2010)




       Trento, February 15, 2012                                           21
Torsten Braun:TCP Performance Optimizations for Wireless Sensor Networks



       Thanks for your attention !


       >     braun@iam.unibe.ch
       >     http://cds.unibe.ch




       Trento, February 15, 2012                                           22

TCP Performance Optimizations for Wireless Sensor Networks

  • 1.
    EWSN 2012 TCP PerformanceOptimizations for Wireless Sensor Networks Philipp Hurni, Ulrich Bürgi, Markus Anwander, Torsten Braun Research Group ―Communication and Distributed Systems‖ Institute of Computer Science and Applied Mathematics University of Bern, Switzerland braun@iam.unibe.ch, cds.unibe.ch
  • 2.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Overview > Motivation and Related Work — Reasons for Poor TCP Performance in Wireless Multi-Hop Networks — Optimization of TCP in WSNs > Proposed Optimization Concepts — Caching and Congestion Control (cctrl) Module including Channel Activity Monitoring — Spatial Reuse by Multiple TCP Connections > Results by Testbed Experiments — Throughput — Radio On-Time as Energy Consumption Measure > Conclusions Trento, February 15, 2012 2
  • 3.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Reasons for Poor TCP Performance in Wireless Multi-Hop Networks > Higher bit error rates and packet loss > Underlying MAC protocols (exponential back-off, hidden / exposed nodes) > TCP end-to-end error and congestion control mechanisms TCP data segment loss TCP acknowledgement loss Trento, February 15, 2012 3
  • 4.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Optimization of TCP in WSNs > Distributed TCP Caching (Dunkels et al., 2004) > TCP Support for Sensor Networks (Braun et al., 2007) Trento, February 15, 2012 4
  • 5.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Caching and Congestion Control (cctrl) Module > is aware of all TCP packets forwarded by a node by interception of outbound packets. > allocates buffer for 2 packets per TCP connection (1 for each direction, µIP has max. 1 unacknowledged TCP data segment per connection) Trento, February 15, 2012 5
  • 6.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks cctrl Functions > Caching of — complete TCP data segments and scheduling of retransmission timer (RTO = 3 ∙ RTTestimated, RTTestimated = estimated RTT between intermediate node and destination) — TCP/IP header for TCP acknowledgements > Local retransmission of TCP data segment (max. 3 attempts), when RTO expires prior to TCP acknowledgement reception (a) > Removal of TCP data segments, if acknowledgement number of TCP acknowledgement > sequence number of cached TCP data segment > For retransmitted TCP data segments, for which a TCP acknowledgement has been received: discard TCP data segment; regenerate TCP acknowledgement (b) Trento, February 15, 2012 6
  • 7.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Channel Activity Monitoring > MAC proxy notifies cctrl upon reception of any packet and stores a timestamp in activity history. > cctrl continuously calculates channel activity level (= # overheard packets by MAC proxy during the last time period RTTestimated) > Observation: — Channel activity level of most nodes = 0 during long idle periods — Long idle periods by – TCP data segment loss at one of the first hops – TCP acknowledgement loss close to its destination (i.e. TCP data segment’s source). > Approach: — Split RTO into: – RTO1 = 3 ∙ RTTestimated ∙ 2/3 – RTO2 = 3 ∙ RTTestimated ∙ 1/3 — When RTO1 expires: early retransmission, if channel activity level = 0; otherwise: retransmission when RTO2 expires. — Triggers early local retransmissions close to destination Trento, February 15, 2012 7
  • 8.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks MAC Proxy Trento, February 15, 2012 8
  • 9.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Channel Activity Levels with X-MAC Trento, February 15, 2012 9
  • 10.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Long Idle Periods Trento, February 15, 2012 10
  • 11.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Spatial Reuse by Multiple TCP Connections Trento, February 15, 2012 11
  • 12.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Testbed Experiments > 7 TelosB nodes in different rooms of a 3 floor building using U Bern’s Wisebed testbed > Receiver node 1 > Sender nodes 2-7 > Experiments with different MAC protocols for 10 minutes, 15 repetitions > 16 bytes payload > 79 bytes per TCP data segment > 63 bytes per TCP acknowledgement > Total: approx. 2500 experiments during > 400 hours Trento, February 15, 2012 12
  • 13.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Throughput Trento, February 15, 2012 13
  • 14.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Radio On-Time as Energy Consumption Measure Trento, February 15, 2012 14
  • 15.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Throughput with Multiple Connections Trento, February 15, 2012 15
  • 16.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Overall Comparison of Throughput Trento, February 15, 2012 16
  • 17.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Overall Comparison of Energy Consumption Trento, February 15, 2012 17
  • 18.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Cross-Traffic Measurements Trento, February 15, 2012 18
  • 19.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Cross-Traffic Throughput Trento, February 15, 2012 19
  • 20.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Cross-Traffic Comparison Trento, February 15, 2012 20
  • 21.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Conclusions > Implementation of caching, local TCP data segment retransmission, and TCP acknowledgement regeneration in intermediate nodes on top of several WSN MAC protocols > NullMAC and LPP provide good response to local retransmission. Results with ContikiMAC are worse. > cctrl can improve performance and energy efficiency. > Spatial reuse by multiple TCP connections can further improve performance. > Best performance and energy efficiency with cctrl and NullMAC ! → adaptive MAC protocols (Hurni et al., 2010) Trento, February 15, 2012 21
  • 22.
    Torsten Braun:TCP PerformanceOptimizations for Wireless Sensor Networks Thanks for your attention ! > braun@iam.unibe.ch > http://cds.unibe.ch Trento, February 15, 2012 22