Tcpip for Wsn

Download Tcpip for Wsn

Post on 17-Oct-2015

12 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

tcp/ ip in wireless sensor network

TRANSCRIPT

  • 5/27/2018 Tcpip for Wsn

    1/134

    Malardalen University Licentiate Thesis

    No.45

    Towards TCP/IP for Wireless

    Sensor Networks

    Adam Dunkels

    March 2005

    Swedish Institute of Computer Science

    Stockholm, Sweden

    Department of Computer Science and Electronics

    Malardalen University

    Vasteras, Sweden

  • 5/27/2018 Tcpip for Wsn

    2/134

    Copyright cAdam Dunkels, 2005

    ISSN 1651-9256

    ISBN 91-88834-96-4

    Printed by Arkitektkopia, Vasteras, Sweden

    Distribution: Malardalen University Press

  • 5/27/2018 Tcpip for Wsn

    3/134

    Abstract

    Wireless sensor networks are composed of large numbersup to thousands

    of tiny radio-equipped sensors. Every sensor has a small microprocessor with

    enough power to allow the sensors to autonomously form networks through

    which sensor information is gathered. Wireless sensor networks makes it pos-

    sible to monitor places like nuclear disaster areas or volcano craters without

    requiring humans to be immediately present. Many wireless sensor network

    applications cannot be performed in isolation; the sensor network must some-

    how be connected to monitoring and controlling entities.

    This thesis investigates a novel approach for connecting sensor networks toexisting networks: by using the TCP/IP protocol suite in the sensor network,

    the sensors can be directly connected to an outside network without the need

    for special proxy servers or protocol converters.

    Bringing TCP/IP to wireless sensor networks is a challenging task, how-

    ever. First, because of their limited physical size and low cost, sensors are

    severely constrained in terms of memory and processing power. Traditionally,

    these constraints have been considered too limiting for a sensor to be able to

    use the TCP/IP protocols. In this thesis, I show that even tiny sensors can com-

    municate using TCP/IP. Second, the harsh communication conditions make

    TCP/IP perform poorly in terms of both throughput and energy efficiency. With

    this thesis, I suggest a number of optimizations that are intended to increase the

    performance of TCP/IP for sensor networks.

    The results of the work presented in this thesis has had a significant impact

    on the embedded TCP/IP networking community. The software developed as

    part of the thesis has become widely known in the community. The software

    is mentioned in books on embedded systems and networking, is used in aca-

    demic courses on embedded systems, is the focus of articles in professional

    magazines, is incorporated in embedded operating systems, and is used in a

    large number of embedded devices.

    i

  • 5/27/2018 Tcpip for Wsn

    4/134

  • 5/27/2018 Tcpip for Wsn

    5/134

    To Castor, Morgan and Maria

  • 5/27/2018 Tcpip for Wsn

    6/134

  • 5/27/2018 Tcpip for Wsn

    7/134

    Acknowledgements

    First of all, I would like to thank my colleague and co-advisor Thiemo Voigt for

    being such an inspiring person to work with. This thesis would not have been

    possible without Thiemos support and encouragement! Many thanks also go

    to my advisor Mats Bjorkman, for being a positive individual and for having

    the attitude that all problems are small problems. I am also grateful to Juan

    Alonso who not only was the driving force behind the sensor network research

    at SICS, but also is a very nice person to work with. My thanks also go to

    Bengt Ahlgren, lab manager of the Computer and Network Architectures lab

    at the Swedish Institute of Computer Science, for giving me the opportunity todo research at SICS.

    My gratitude also goes to Henrik Abrahamsson for being a wonderful dis-

    cussion partner on subjects ranging from science, mathematics, and research

    methods, to music, TV, and culture, as well as life in general. Thanks also go

    to all the members CNA lab for contributing to an inspiring work environment:

    Lars Albertsson, Anders Andersson, Laura Feeney, Bjorn Gronvall, and Ian

    Marsh. Other notable persons at SICS are Sverker Janson, Joakim Eriksson,

    Niclas Finne, and Martin Nilsson. Thanks also go to Joe Armstrong and to

    Hartmut Ritter for interesting discussions.

    Many thanks to the everyone who have taken part of the development of

    my software. In particular, this includes Ullrich von Bassewitz, who have

    been a great discussion partner during the development of uIP and Contiki,Oliver Schmidt who is actively working on Contiki together with me, and Leon

    Woestenberg, who are heading the continued development of the lwIP stack.

    Also, everyone who have contributed code, patches, and bug reports to the

    software also deserves a big thank you!

    Thanks also go to my mother Kerstin for being supportive and for taking

    a general interest in my work. I am also endlessly grateful to my late father

    Andrejs who, despite no longer being with us, still manages to guide me as a

    v

  • 5/27/2018 Tcpip for Wsn

    8/134

    vi

    thinker, researcher, and in being a father.

    Finally, I would like to thank my wife Maria for making life outside of

    work even more enjoyable than the work itself and for being a great mother for

    our sons Morgan and Castor.

    This work in this thesis is in part supported by VINNOVA, Ericsson, SITI, SSF, the Eu-

    ropean Commission under the Information Society Technology priority within the 6th

    Framework Programme, and the European Commissions 6th Framework Programme

    under contract number IST-004536. The Swedish Institute of Computer Science is

    sponsored by TeliaSonera, Ericsson, SaabTech, FMV, Green Cargo, ABB, and Bom-

    bardier Transportation AB.

  • 5/27/2018 Tcpip for Wsn

    9/134

    Contents

    I Thesis 1

    1 Introduction 3

    1.1 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    1.2 Research Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    1.2.1 TCP/IP on a Limited Device . . . . . . . . . . . . . . . . . . 6

    1.2.2 Operating Systems for Wireless Sensor Networks . . . . . . . 7

    1.2.3 Connecting Sensor Networks and IP Networks . . . . . . . . . 7

    1.2.4 TCP/IP for Wireless Sensor Networks . . . . . . . . . . . . . 8

    2 Contributions and Results 10

    3 Summary of the Papers and Their Contributions 12

    3.1 Paper A: Full TCP/IP for 8-Bit Architectures . . . . . . . . . . . . . . 12

    3.2 Paper B: Contiki - a Lightweight and Flexible Operating System for

    Tiny Networked Sensors . . . . . . . . . . . . . . . . . . . . . . . . . 13

    3.3 Paper C: Connecting Wireless Sensornets with TCP/IP Networks . . . 14

    3.4 Paper D: Making TCP/IP Viable for Wireless Sensor Networks . . . . . 15

    4 Related Work 17

    4.1 Small TCP/IP Implementations . . . . . . . . . . . . . . . . . . . . . 17

    4.2 Operating Systems for Sensor Networks . . . . . . . . . . . . . . . . 18

    4.3 Connecting IP Networks with Sensor Networks . . . . . . . . . . . . . 194.4 TCP/IP for Wireless Sensor Networks . . . . . . . . . . . . . . . . . . 20

    4.4.1 Reliable Sensor Network Transport Protocols . . . . . . . . . . 20

    4.4.2 Header Compression . . . . . . . . . . . . . . . . . . . . . . 21

    4.4.3 TCP over Wireless Media . . . . . . . . . . . . . . . . . . . . 22

    4.4.4 Addressing in Sensor Networks . . . . . . . . . . . . . . . . . 23

    5 Conclusions and Future Work 24

    vii

  • 5/27/2018 Tcpip for Wsn

    10/134

    viii Contents

    Bibliography 27

    II Included Papers 37

    6 Paper A:

    Full TCP/IP for 8-Bit Architectures 39

    6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    6.2 TCP/IP overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    6.3 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

    6.4 RFC-compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    6.5 Memory and buffer management . . . . . . . . . . . . . . . . . . . . 47

    6.6 Application program interface . . . . . . . . . . . . . . . . . . . . . . 49

    6.7 Protocol implementations . . . . . . . . . . . . . . . . . . . . . . . . 50

    6.7.1 Main control loop . . . . . . . . . . . . . . . . . . . . . . . . 50

    6.7.2 IP Internet Protocol . . . . . . . . . . . . . . . . . . . . . 51

    6.7.3 ICMP Internet Control Message Protocol . . . . . . . . . . 52

    6.7.4 TCP Transmission Control Protocol . . . . . . . . . . . . . 53

    6.8 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

    6.8.1 Performance limits . . . . . . . . . . . . . . . . . . . . . . . 56

    6.8.2 The impact of delayed acknowledgments . . . . . . . . . . . . 57

    6.8.3 Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . 586.8.4 Code size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    6.9