TinyOS: Operating System Design for Wireless Sensor Networks

TinyOS: An Operating System for Sensor Networks We present TinyOS, a flexible, application-specific operating system for sensor networks. Sensor networks consist of (potentially) thousands of tiny, low-power nodes, each of which execute concurrent, reactive programs that must operate with severe memory and power constraints. The sensor network challenges of limited resources, event-centric concurrent applications, and low-power operation drive the design of TinyOS. Our solution combines flexible, fine-grain components with an execution model that supports complex yet safe concurrent operations. TinyOS meets these challenges well and has become the platform of choice for sensor network research; it is in use by over a hundred groups worldwide, and supports a broad range of applications and research topics. We provide a qualitative and quantitative evaluation of the system, showing that it supports complex, concurrent programs with very low memory requirements (many applications fit within 16KB of memory, and the core OS is 400 bytes) and efficient, low-power operation. We present our experiences with TinyOS as a platform for sensor network innovation and applications. 立即下载

From: http://www.sensorsmag.com/sensors/content/printContentPopup.jsp?id=324975#

May 1, 2006
By: David E. Culler, PhD, Arch Rock Corp.
Sensors

TinyOS has been adopted by thousands of developers worldwide, on many platforms, for a broad range of wireless sensor networks. Its communication-centric design and modular software model are tailored to the unique requirements of these networks, where applications and services are distributed over collections of resource-constrained, unattended application-specific devices streaming data to and from the physical world. From its roots in the academic research community, it is emerging as an important vehicle for commercial deployments.



The role of any operating system (OS) is to promote development of reliable application software by providing a convenient and safe abstraction of hardware resources. In PCs and servers, the OS allocates application processing threads to processors, maps virtual addresses to locations in memory, and manipulates disks, networks, and peripherals on the application's behalf.

This OS/application division—essential in conventional computing—is less common in the embedded world of sensing and control, where applications are tightly bound to particular hardware and weave in high-level logic with manipulation of the physical apparatus. This is due to very limited hardware resources; highly specialized applications; and long, stringent, development cycles often dominated by mechanical and other factors.


Figure 1. Comparison of TinyOS platforms
Wireless sensor networks (WSNs) are embedded but general-purpose, supporting a variety of applications, incorporating heterogeneous components, and capable of rapid deployment in new environments. Wireless networking requires greater concurrent processing than wired protocols; while a WSN node is carrying out its normal data acquisition and processing steps, it also needs to service protocol events and packet transfers that arise asynchronously from the network. However, hardware resources remain diverse and constrained, especially in terms of memory and power. A sample of WSN platforms is shown in Figure 1. A typical TinyOS 'mote' platform has 10 KB of RAM, 100 KB of ROM, and consumes 10 μA to 25 mA, depending on which components are active.

TinyOS was designed specifically for WSNs. It introduces a structured event-driven execution model and a component-based software design that supports a high degree of concurrency in a small footprint, enhances robustness, and minimizes power consumption while facilitating implementation of sophisticated protocols and algorithms. The system and its services comprise components connected with well-defined interfaces, much as a schematic wires hardware blocks together. The diversity of hardware platforms, protocols, and applications is addressed by plugging together the necessary components from a catalog of candidates.

TinyOS Design

Resource Constrained Concurrency. Concurrency is a key system software challenge. The system manages several devices, e.g., ADCs, sensors, Flash memory, and radio. Typically, an operation is started on a device, which then runs concurrently with the main processor until generating a response. Meanwhile, other devices may also need service, requiring the system to juggle several event streams. A conventional OS uses multiple threads, each with its own stack. The thread dedicated to a device issues a command and then sleeps or polls until the operation completes. The OS switches among threads by saving and restoring their registers, and threads coordinate with others by using shared variables as flags and semaphores. This works for complex software on powerful machines but is problematic for embedded designs because multiple stacks must be kept in memory and each thread can potentially interact with any other whenever it accesses a shared variable. This can lead to subtle race conditions and deadlocks, requiring complex schedulers to meet real-time requirements and deadlines.

Event-driven execution is common in embedded systems because it permits a small footprint and more control over scheduling. A single stack supports many concurrent activities. The system is organized around a dispatcher that calls specific event-handlers, depending on the event type and the state of the system. Each handler takes immediate action (e.g., accessing a device) and updates the system state. Later events trigger subsequent operations. The drawback is that even small changes may require the developer to understand and possibly modify the overall structure, making code reuse, customization, and incremental evolution difficult.

Structured Event-Driven Execution. TinyOS provides a structured event-driven model. A complete system configuration is formed by 'wiring' together a set of components for a target platform and application domain. Components are restricted objects with well-defined interfaces, internal state, and internal concurrency. Primitive components encapsulate hardware elements, e.g., radio, ADC, timer, or bus. Their interface reflects the hardware operations and interrupts; the state and concurrency is that of the physical device. Higher-level components encapsulate software functionality, but with a similar abstraction. They provide commands, signal events, and have internal handlers, task threads, and state variables.

This approach accommodates hardware evolution, including major changes in the hardware/software boundary, by component replacements. Its memory footprint is small, despite supporting extensive concurrency, requiring only a single stack and a small task queue. However, the modular construction provides flexibility, robustness, and ease of programming. A restricted form of thread, called a task, is available within each component, but interactions across components are through explicit command/event interfaces. The wiring of components and the higher priority of asynchronous events over tasks permit the use of simple schedulers—and in TinyOS 2.0 even the scheduler is replaceable.

Components and Bidirectional Interfaces. TinyOS is written in ANSI standard C with support for component composition, system-wide analysis, and network data types. A component has a set of bidirectional command/ event interfaces implemented either directly or by wiring a collection of subcomponents. The compiler optimizes the entire hierarchical graph, validates that it is free of race conditions and deadlocks, and sizes resources. The TinyOS community has produced plug-ins for integrated development environments and several visual programming environments for this component-based programming style.

Network data types simplify protocol implementation. While network packets have a particular specified format, data representation in a computer program depends on word width and addressing of the host processor (little or big endian), so most protocol code contains machine-dependent bit-twiddling and run-time parsing. Because TinyOS uses network types with a completely specified representation, the compiler provides efficient access to packet fields on embedded nodes, as well as Java and XML methods for packet handling on conventional computers and gateways.

Split-phase operations are a typical use of bidirectional interfaces. A higher-level component issues a command to initiate activity in a hardware or software component. The command returns immediately, indicating the status of the request, even though the operation takes some time to complete. When done, the operating component signals an event to components that will take further action. Meanwhile, the processor may service other tasks and events, or sleep if no tasks are pending. Thus, interleaved execution and power management is provided systematically throughout the entire set of TinyOS components.

Application-Specific Platform Support


Figure 2. Typical Arch Rock TinyOS 2.0 configuration
A typical TinyOS configuration has five subsystems—sensors/actuators, communications, storage, timers, and processor/power management—with higher-level services built on this foundation (Figure 2). The open-source repository provides components for popular chips, including several microcontrollers, radios, Flash memories, ADCs, and sensors as well as configurations for several popular platforms. Carefully designed telescoping interfaces allow designers to select among hardware-specific and hardware-independent capabilities.

Sensing. Conventional systems are customized for particular peripherals with device drivers. In WSNs, various sensors may be used with a common platform. TinyOS 2.0 provides sensor drivers, which scale from low-rate, low-power sampling of environmental factors to high-rate, low-jitter sampling of vibration or acceleration. Drivers handle warm-up, acquisition, arbitration, and interface specifics. Since sensor selection is closely tied to the application and mechanical design, drivers must be easily configured and tested, rather than dynamically loaded after market.

Communications. Communications and networking have driven the TinyOS design as available radios and microcontroller interfaces evolved. The communication subsystem has to meet real-time requirements and respond to asynchronous events while other devices and processes are serviced. Early designs modulated the radio channel bit-by-bit in software, while the Mica and Mica2 generations used a byte-level interface. Most recent platforms use IEEE 802.15.4 radios, such as the ChipCon CC2420, with a packet-level interface, but with differing microcontroller-radio interconnections. The TinyOS 2.0 radio component provides a uniform interface to the full capabilities of the radio chip. The link-level component provides rich media access control (MAC) capabilities, including channel activity detection, collision avoidance, data transfer, scheduling, and power management, allowing networking components to optimize for specific protocols. Several platforms use other radios, including those from Nordic, Infineon, and Freescale, and many provide wired links for gateways, serial-based peripherals, or federations of microcontrollers. Packet transmission and reception is reflected in the TinyOS execution model; send is split-phase with a send-done event, whereas receive generates a packet-arrival event.

Storage. Nonvolatile storage is used in WSNs for logging, configuration parameters, files, and program images. Several different kinds of Flash memory are used with different interfaces and different protocols. Lower-layer TinyOS components provide a block storage abstraction for various Flash chips and platform configurations, with one or more application-level data services provided on this substrate.

Embedded Application Services

Networking. The TinyOS community has developed networking layers targeted at different applications with different techniques for discovery, routing, power reduction, reliability, and congestion control. These networking layers provide higher-level communication services to embedded applications with a TinyOS programming interface. The most widely used services for WSNs are reliable dissemination, aggregate data collection, and directed routing.

Reliable dissemination provides guaranteed delivery of messages from a source, typically a gateway, to some or all nodes in the network. It is used for network configuration and control, so it doesn't depend on any pre-established neighbor discovery, routing, or connection setup. Each dissemination operation causes a series of packet transmissions to propagate across the network, updating the nodes with a new command or value. When a node receives an update, it selectively retransmits it to distant nodes. Nodes may be obstructed, out of range, or powered off when the update is initiated, so continued infrequent retransmission ensures that all nodes are eventually up to date. Should the network be very dense, say when thousands of nodes are on a shipping dock, nodes will suppress their retransmissions when they hear from others. Reliability is obtained through network redundancy and data consistency management, rather than through active acknowledgements.

To collect and aggregate data from the WSN, nodes cooperate in building and maintaining one or more collection trees, rooted at a gateway or data sink. Each node gathers link-quality statistics and routing cost estimates through all kinds of communication, including routing beacons, packet forwarding, and passive traffic monitoring. It uses this information to continuously select the best from its candidate routing parents, to which it forwards its own data as well as packets received from its children. Since the number of nodes within communication range may vary widely, these tree-formation and routing algorithms must be designed with a fixed-size neighbor table for any network.

Similarly, a node can establish a route to any other node in the network and have packets forwarded hop-by-hop to the destination. Such directed routing is most often used to issue commands to a particular node, transfer bulk data, and in network management.

Network Services. Typically, a TinyOS application is a concise program built upon a set of system services and reflecting the processing logic of its particular domain. It opens sensor drivers, sets sample rates, and performs local processing on data streams. It may also spool raw or processed data to logs. It uses network-wide communication services to share information with other nodes and with the outside world. Both the embedded application and the system itself can be reprogrammed over-the-air using density-aware reliable dissemination into Flash memory.

Most embedded applications can be generalized to support a variety of uses in a particular domain. For example, in environmental monitoring the sample rate, down-sampling interval, and alert thresholds are natural configuration parameters. With an annotation in the application, Arch Rock TinyOS tools will generate the Web Service infrastructure, as well as the embedded application support, to make these parameters accessible to the IT enterprise. Similarly, the alerts are posted to the Web Service environment. Sophisticated application engines, such as TinyDB, provide a simple database query processor on each node, accessible through SQL commands,while application-specific virtual machines, such as Maté, execute simple scripts that are disseminated over the network.

Evolving in the Open

As wireless sensor network technology matures, it promises the ability to instrument the world at a fidelity that was previously impractical and to monitor points and phenomena that were previously unobservable, due to inaccessibility, mobility, or physical distance. It is the confluence of several technological advances; semiconductor fabrication has provided powerful microcontrollers, low-power radios, and mass-produced sensors. Algorithm development and empirical study have provided effective mesh routing protocols. Finally, TinyOS provides an execution environment in which protocols are implemented to provide powerful services on rapidly advancing hardware in support of increasingly sophisticated applications.


Figure 3. Summary of recent TinyOS download history
Wireless sensor networking is also a confluence of communities. Traditional instrumentation and control sectors have developed industry standards, such as IEEE 802.15.4 and ZigBee, in addition to many proprietary implementations. TinyOS represents a broad international community of researchers and developers in academia and industry, cooperating and competing in the open to advance the state of the art, develop a rough consensus, and provide running code. The snapshot of recent TinyOS download activity in Figure 3 shows just how international that community is. Worldwide, this technology is transferring to industries large and small.

Sun SPOT: A New Twist


Figure 4. Sun Lab s Sun SPOT system
To simplify the design of wireless transducer applications, Sun Lab's Sun SPOT (Small Programmable Object Technology) system follows a design philosophy similar to that of TinyOS, but with a full object model and larger footprint (Figure 4).

The Squawk Virtual Machine supports a Java subset and provides conventional system capabilities, including thread scheduling, memory management, and interrupt handling. The sensor drivers, communications, and Flash storage subsystems are written in Java. Application classes use these libraries and higher-level communication services and a restricted form of threads is used in system code.

The virtual machine occupies 80 KB of RAM and the system libraries 270 KB of ROM. The Sun SPOT hardware is similar to the Intel Mote2, with roughly 20 × the memory of a typical TinyOS platform. It consumes 25–90 mA, as compared to 0.01–25 mA for a Mica or Telos 'mote.'

For More Information

The main site for the TinyOS community is www.tinyos.net.

The TinyOS 2.0 working group can be found at www.tinyos.net/scoop/special/working_group_tinyos_2-0.

J. Hill, R. Szewcyk, A. Woo, D. Culler, S. Hollar, K. Pister, "System Architecture Directions for Networked Sensors," ASPLOS 2000, pp. 93–104.

V. Handziski, J. Polastre, J.H. Hauer, C. Sharp, A. Wolisz and D. Culler, "Flexible Hardware Abstraction for Wireless Sensor Networks," Proc 2nd European Workshop on Wireless Sensor Networks (EWSN 2005), Istanbul, Turkey, 2005.

P. Levis, TinyOS Programming, http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf.

P. Levis, D. Gay, V. Handziski, J.H. Hauer, B. Greenstein, M. Turon, J. Hui, K. Klues, C. Sharp, R. Szewczyk, J. Polastre, P. Buonadonna, L. Nachman, G. Tolle, D. Culler, and A. Wolisz, " T2: A Second Generation OS for Embedded Sensor Networks," Technical Report No. TKN-05-007, Telecommunication Networks Group, Technical University, Berlin, 2005.

David E. Culler, PhD, can be reached at Arch Rock Corp., San Francisco, CA; 415-692-0828, , www.archrock.com

不消耗 token 的文献检索:Semantic Scholar 数据源与本地筛选排序机制 立即下载

相关推荐

The open-source AI workspace & Skills for creators

原视频翻译项目KrillinAI。基于Codex运行时的本地AI内容创作工作台,集合视频生成,视频翻译,图像生成,文章写作,脚本生成,动画创作等各类内容创作能力于一体。支持对话和工作台协作。

Tinyos】MsgReader缺失以及找不到toscomm库的问题解决方法

最近正在搞tinyos,在做节点-PC串口通信的时候出了这两个问题,截图如下 Tinyos自己用的是Vision3外加自己用的是Arch所以更加不知道这个应该怎么解决了,费了好大一番功夫知道了一个简单的方法 对于 错误: 找不到或无法加载主类 MsgReader 原因: java.lang.ClassNotFoundException: MsgReader 的问题,我们只需要将tinyos-m...

熹微橙光的博客 381

《伯希和西域探险记》探险路线图 西域历史地理 KML矢量数据

本资源为法国汉学家伯希和西域探险路线KML矢量地图。伯希和(Paul Pelliot)1906-1908年率中亚考察队在中国新疆、甘肃等地进行考古探险,发掘了敦煌藏经洞等重要遗址,是近代西域探险史上的重要事件。地图标注了探险队行进路线、考察地点、重要遗址位置等要素,可在Google Earth、ArcGIS、QGIS中打开查看,适用于西域史地研究、敦煌学参考与近代探险史教学。

Tinyxml使用入门手记

最近在准备给自己的GUI系统加入XML解析部分,就开始研究Tinyxml,差了不少资料,看了网友的例题还有Tinyxml本身自带的范例程序。得到了很大的启发,得之余民而用之于民,我整理了一下简单的入门程序给大家,想必大家看完这两种调用方式就会用Tinyxml了。就不说废话了,直接看程序:两种不同的代码原因是对应不同的XML格式。我们先看第一种格式的XML文件(Tinyxml自带例题)-

Linux Operating System 的专栏 788

园区如何搭建智能制造服务平台,推动制造业数字化转型?.docx

科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。

园区如何提升智能制造服务水平,推动中小企业数字化转型?.docx

园区如何提升智能制造服务水平,推动中小企业数字化转型?

mac连接windows远程桌面

代码转载自:https://pan.quark.cn/s/a4b39357ea24 Mac OS操作系统通过连接Windows远程桌面客户端,能够直接执行并使用。

科研院所如何拓展技术转移服务范围提升成果转化成功率.docx

科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。

Xshell-8.0.0110p.exe.7z

Xshell-8.0.0110p.exe.7z

中小企业产学研对接成功率低,如何系统性提升合作效率?.docx

中小企业产学研对接成功率低,如何系统性提升合作效率?

如何打造区域细分产业创新中心?.docx

科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。

Win7蓝屏0x0000003B解决

已经博主授权,源码转载自 https://pan.quark.cn/s/a4b39357ea24 ### Windows 7 0x0000003B蓝屏故障处理方法 #### 背景与概述 在日常操作Windows 7操作系统的过程中,遭遇蓝屏现象是非常普遍的一种情况。对于许多用户,特别是计算机操作技能较为基础的用户,面对蓝屏可能会感到非常茫然和束手无策。实际上,大多数蓝屏状况都是可以通过特定的技术手段来处理的。本文将详尽阐述如何应对Windows 7系统中的0x0000003B蓝屏故障。 #### 0x0000003B蓝屏故障的成因探究 0x0000003B蓝屏故障指的是在执行某些特定应用程序时,系统蓝屏并展示错误代码“0x0000003B”。依据微软官方发布的技术支持文章(KB2584454),该问题通常在运行特定软件(如Cyberlink YouCam)时发生。具体来说,是由于DirectX 9(D3D9)在运行期间未能准确验证应用程序传输的矩形值参数,造成系统内核驱动(Dxgkrnl.sys)接收到了无效的矩形坐标信息。由于Dxgkrnl.sys亦未对该坐标值进行有效核查,最终导致系统尝试执行非法的数学运算(例如除以零),从而引发蓝屏。 #### 解决措施 为了应对0x0000003B蓝屏故障,微软已经发布了相关的紧急修复补丁。用户可以通过以下步骤获取并部署这个补丁: 1. **进入微软官方支持站点**:通过浏览器访问微软官方的支持站点([http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2584454&kl=zh-cn](http://support.microsoft.com/hotfix/KBHotf...

高校科研处如何优化产学研合作模式?.docx

科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。

scrcpy 4.1 Android 投屏工具 Windows x64(官方zip版)+ 投屏使用教程

scrcpy 是 Genymobile 开源的 Android 投屏控制工具(Apache-2.0 协议),通过 USB 或 WiFi 将手机屏幕投射到电脑,支持鼠标键盘操控、录屏与多设备管理。本包为官方 zip 版 4.1(x64),附图文使用教程:USB 投屏连接步骤(开发者选项与 USB 调试开启)、WiFi 无线投屏(--tcpip 参数)、常用快捷键速查(主页/返回/多任务/粘贴)与录屏参数,解压即可使用无需安装。适合需要在大屏上操作和演示手机的开发者与普通用户。

上一篇: Sensor nets gain enterprise scale
下一篇: 读:JavaScript 高级程序设计
lybra
博客等级 码龄20年 41粉丝 100原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值