Nano-RK: Difference between revisions

From HandWiki
imported>WikiGary
url
 
MainAI (talk | contribs)
correction
 
Line 1: Line 1:
'''Nano-RK: A Wireless Sensor Networking Real-Time Operating System (RTOS)'''<ref>[http://www.nanork.org/nano-RK nano-RK ] {{webarchive|url=https://web.archive.org/web/20080511222453/http://www.nanork.org/nano-RK/ |date=2008-05-11 }}</ref><ref>[http://ieeexplore.ieee.org/iel5/10450/33174/01563113.pdf?arnumber=1563113] A. Eswaran, A. Rowe and R. Rajkumar, "Nano-RK: An Energy-Aware Resource-Centric Operating System for Sensor Networks," IEEE Real-Time Systems Symposium, December 2005.</ref> is a [[Real-time operating system|real-time operating system]] (RTOS) from [[Organization:Carnegie Mellon University|Carnegie Mellon University]] designed to run on micro-controllers for use in sensor networks. Nano-RK supports a fixed-priority fully [[Preemption (computing)|preemptive scheduler]] with fine-grained timing primitives to support real-time task sets. "Nano" implies that the RTOS is small, consuming 2&nbsp;KB of RAM and using 18&nbsp;KB of [[Flash memory|flash]], while "RK" is short for ''resource kernel''. A resource kernel provides reservations on how often system resources can be consumed. For example, a task might only be allowed to execute 10&nbsp;ms every 150&nbsp;ms (CPU reservation), or a [[Node (networking)|node]] might only be allowed to transmit 10 network packets per minute (network reservation). These reservations form a virtual [[Biology:Energy budget|energy budget]] to ensure a node meets its designed battery lifetime as well as protecting a failed node from generating excessive network traffic. Nano-RK is [[Open source|open source]], is written in [[C (programming language)|C]] and runs on the Atmel-based FireFly sensor networking platform, the MicaZ motes as well as the MSP430 processor.<ref>Anand Eswaran and Anthony Rowe and Raj Rajkumar, “FireFly: A Time Synchronized Real-Time Sensor Networking Platform”</ref>
{{Infobox OS
The following article <ref>[http://www.embedded.com/design/networking/204800543?pgno=1 embedded.com]</ref> discusses some of the tradeoffs associated with using an RTOS in sensor networks.
| name = Nano-RK
| logo = <!-- Filename only: no wikilink, Image: or File: -->
| logo caption =
| logo alt =
| screenshot = <!-- Filename only: no wikilink, Image: or File: -->
| caption =
| screenshot alt =
| developer = [[Organization:Carnegie Mellon University|Carnegie Mellon University]]
| family =
| working state = Discontinued
| source model = [[Open-source model|Open-source]]
| released = {{Start date and age|2005|12}}<!-- If known, add |dd|df=yes -->
| discontinued = Yes
| latest release version = Revision 427
| latest release date = {{Start date and age|2008|02|12|df=yes}}
| marketing target = [[Wireless sensor network]]s
| programmed in = [[C (programming language)|C]]
| language = English
| update model =
| supported platforms = [[Company:Atmel|Atmel]] FireFly, MicaZ motes, MSP430
| kernel type = [[Real-time operating system]]
| userland =
| ui = [[Command line interface]]
| license = [[Software:GNU General Public License|GPL]] or [[Commercial software|commercial]]
| preceded by =
| succeeded by =
| website = <!--{{URL|www.example.com}}-->
| other articles =
}}
'''Nano-RK''' is a [[Wireless sensor network|wireless sensor network]]ing [[Real-time operating system|real-time operating system]] (RTOS)<ref>[http://www.nanork.org/nano-RK nano-RK Nano-RK: A Wireless Sensor Networking Real-Time Operating System (RTOS)] {{webarchive|url=https://web.archive.org/web/20080511222453/http://www.nanork.org/nano-RK/ |date=2008-05-11}}</ref><ref>[https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=1563113] A. Eswaran, A. Rowe and R. Rajkumar, "Nano-RK: An Energy-Aware Resource-Centric Operating System for Sensor Networks," IEEE Real-Time Systems Symposium, December 2005.</ref> from [[Organization:Carnegie Mellon University|Carnegie Mellon University]], designed to run on [[Engineering:Microcontroller|microcontroller]]s for use in sensor networks. Nano-RK supports a fixed-priority fully [[Preemption (computing)|preemptive scheduler]] with fine-grained timing primitives to support [[Real-time computing|real-time]] task sets. "Nano" implies that the RTOS is small, using 2&nbsp;KB of [[Random-access memory|random-access memory]] (RAM) and using 18&nbsp;KB of [[Flash memory|flash memory]], while ''RK'' is short for ''resource kernel''. A resource [[Software:Kernel (operating system)|kernel]] provides reservations on how often system resources can be used. For example, a [[Task (computing)|task]] might only be allowed to execute 10&nbsp;ms every 150&nbsp;ms (CPU reservation), or a [[Node (networking)|node]] might only be allowed to transmit 10 [[Network packet|network packet]]s per minute (network reservation). These reservations form a virtual [[Biology:Energy budget|energy budget]] to ensure a node meets its designed [[Physics:Electric battery|battery]] lifetime and to prevent a failed node from generating excessive network traffic. Nano-RK is [[Open-source software|open-source software]], is written in [[C (programming language)|C]] and runs on the [[Company:Atmel|Atmel]]-based FireFly sensor networking platform, the MicaZ motes, and the MSP430 processor.<ref>Anand Eswaran and Anthony Rowe and Raj Rajkumar, “FireFly: A Time Synchronized Real-Time Sensor Networking Platform”</ref>


== advantage ==
Tradeoffs occur when using an RTOS in sensor networks.<ref>[http://www.embedded.com/design/networking/204800543?pgno=1 embedded.com]</ref>
NanoRK takes advantage of priority-based preemptive scheduling to help honor the real-time factor of being deterministic thus ensuring task timeliness and synchronization. Due to the characteristic of limited battery power on the wireless node, Nano-RK provides CPU, network, and sensor efficiency through the use of virtual energy reservations, labeling this system as a resource kernel. These energy reservations can enforce energy and communication budgets to minimize the negative impact on the node’s operational lifetime from unintentional errors or malicious behavior by other nodes within the network. It supports packet forwarding, routing and other network scheduling protocols with the help of a light-weight wireless networking stack. Compared with other current sensor operating systems, Nano-RK provides rich functionality and timeliness scheduling with a small-footprint for its embedded resource kernel (RK).<ref>[3] Anand Eswaran and Anthony Rowe and Raj Rajkumar, “Nano-RK: an
Energy-aware Resource-centric RTOS for Sensor Networks,”,2005.</ref>


== Features of Nano-RK ==
== Advantages ==
'''Static Configuration''' - Nano-RK uses a static design-time approach for energy usage control. Dynamic task creation is disallowed by Nano-RK requiring application developers to set both task and reservation quotas/priorities in a static testbed design. This design allows the developers to create an energy budget for each task in order to maintain application requirements as well as energy efficiency throughout the system’s lifetime. Using a static configuration approach, all of the runtime configurations as well as the power requirements are predefined and verified by the designer before the system is deployed and executed in the real world. This approach also helps to guarantee the stability and small-footprint characteristics when compared with traditional RTOSs.
NanoRK takes advantage of priority-based preemptive scheduling to help honor the real-time factor of being [[Deterministic algorithm|deterministic]], thus ensuring task timeliness and synchronization. Due to the characteristic of limited battery power on the wireless node, Nano-RK provides [[Central processing unit|central processing unit]] (CPU), network, and sensor efficiency through the use of virtual energy reservations, labeling this system as a resource kernel. These energy reservations can enforce energy and communication budgets to minimize the negative impact on the node's operational lifetime from unintentional errors or malicious behavior by other nodes within the network. It supports packet forwarding, routing and other network scheduling protocols with the help of a light-weight wireless networking stack. Compared with other current sensor operating systems, Nano-RK provides rich functionality and timeliness scheduling with a small size for its embedded resource kernel (RK).<ref>[3] Anand Eswaran and Anthony Rowe and Raj Rajkumar, “Nano-RK: an Energy-aware Resource-centric RTOS for Sensor Networks,” 2005.</ref>


'''Watchdog Timer support''' - Watchdog is a software timer that triggers a system reset action if the system hangs on crucial faults for an extended period of time. The watchdog mechanism can bring the system back from the nonresponsive state into normal operation by waiting until the timer goes off and subsequently rebooting the device. In Nano-RK, the watchdog timer is tied directly to the
== Features ==
processor’s reset signal REBOOT ON ERROR. By default, it is enabled when the system boots and reset each time the scheduler executes. If the system fails to respond within the predefined time period, the system will reboot and run the initialization instruction sequence to hopefully regain control.
''Static Configuration'' – Nano-RK uses a static design-time approach for energy use control, and disallows dynamic task creation, requiring application developers to set both task and reservation quotas/priorities in a static testbed design. This design allows creating an energy budget for each task to maintain application requirements and energy efficiency throughout the system's lifetime. Using a static configuration approach, all of the runtime configurations, and the power requirements, are predefined and verified by the designer before the system is deployed and executed in the real world. This approach also helps to guarantee the stability and small-size characteristics relative to traditional RTOSs.


'''Deep Sleep Mode''' - Another feature of Nano-RK is the deep sleep mode. For energy efficiency reasons, if there are no eligible tasks to run, the system can be powered down and given the option to enter deep sleep mode. When the system is in deep sleep mode, only the deep sleep timer can wake the system up with a predefined latency period. After waking up from the deep sleep mode, the next context swap time is set to guarantee the CPU wakes up in time. If a sensor node does not wish to perform deep sleep, it also is presented with the choice to go into a low energy consumption state while still managing its peripherals.
''Watchdog Timer support'' – Watchdog is a software timer that triggers a system reset action if the system hangs on crucial faults for an extended period of time. The watchdog mechanism can bring the system back from the nonresponsive state into normal operation by waiting until the timer goes off and subsequently rebooting the device. In Nano-RK, the watchdog timer is tied directly to the processor's reset signal REBOOT ON ERROR. By default, it is enabled when the system boots and reset each time the scheduler executes. If the system fails to respond within the predefined time period, the system will reboot and run the initialization instruction sequence to hopefully regain control.


== The NANO-RK ready queue ==
''Deep Sleep Mode'' – For energy efficiency reasons, if there are no eligible tasks to run, the system can be powered down and given the option to enter deep sleep mode. When the system is in this mode, only the deep sleep timer can wake the system with a predefined latency period. After waking from sleep mode, the next context swap time is set to guarantee the CPU wakes in time. If a sensor node does not wish to perform deep sleep, it also is presented with the choice to go into a low energy use state while still managing its peripherals.
Nano-RK has implemented a double-linked list of ready queue nodes within a fixed-size array, termed the ready queue, that orders All ready tasks in decreasing order by whichever of the task’s priorities is higher. As the number of tasks running within the Nano-RK implementation is statically-configured in a testbed before deployment, the ready queue size is also fixed to this number of tasks that can be ready to run. A fixed-length array named nrk readyQ is found within the nrk defs.h file along with two pointers to reference the two most important cells within this array. The free node pointer (free node) and the head node pointer (head node) point to the next cell in the array to be allocated and the current highest priority task ready to run, respectively.


== SCHEDULER ==
== Ready queue ==
The core of Nano-RK is a static preemptive real-time scheduler which is priority-based and energy efficient. For priority-based preemptive scheduling, the scheduler always selects the highest priority task from the ready queue. To save energy, tasks do not poll for a resource but rather tasks will be blocked on certain events and can be unlocked when the events occur. When there is no task in the ready queue, the system can be powered down to save energy. When the system is working, one and only one task (current task), signified by the nrk cur task tcb, is running for a predefined period. So the most important job of the scheduler is to decide which task should be run next and for how long the next task should be run until the scheduler is triggered to run again.
Nano-RK has implemented a double-linked list of ready queue nodes within a fixed-size array, termed the ready queue, that orders all ready tasks in decreasing order by whichever of the task's priorities is higher. As the number of tasks running within the Nano-RK implementation is statically configured in a testbed before deployment, the ready queue size is also fixed to this number of tasks that can be ready to run. A fixed-length array named nrk readyQ is found within the nrk defs.h file along with two pointers to reference the two most important cells within this array. The free node pointer (free node) and the head node pointer (head node) point to the next cell in the array to be allocated and the current highest priority task ready to run, respectively.
 
== Scheduler ==
The core of Nano-RK is a static preemptive real-time scheduler which is priority-based and energy efficient. For priority-based preemptive scheduling, the scheduler always selects the highest priority task from the ready queue. To save energy, tasks do not poll for a resource but rather tasks will be blocked on certain events and can be unlocked when the events occur. When there is no task in the ready queue, the system can be powered down to save energy. When the system is working, one and only one task (current task), signified by the nrk cur task tcb, is running for a predefined period. So the most important job of the scheduler is to decide which task should be run next and for how long the next task should run until the scheduler is triggered to run again.


==References==
==References==
{{reflist}}
{{Reflist}}


==External links==
==External links==
*[http://www.nano-rk.org/ Nano-RK Website]
*{{Official website|www.nano-rk.org}}
 
{{Real-time operating systems}}
{{Wireless Sensor Network}}
 


[[Category:Wireless sensor network]]
[[Category:Wireless sensor network]]
[[Category:Embedded operating systems]]
[[Category:Embedded operating systems]]
[[Category:Embedded systems]]
[[Category:Free software operating systems]]
[[Category:Free software operating systems]]
{{Wireless Sensor Network}}
{{Real-time operating systems}}


{{Sourceattribution|Nano-RK}}
{{Sourceattribution|Nano-RK}}

Latest revision as of 05:41, 21 May 2026

Nano-RK
DeveloperCarnegie Mellon University
Written inC
Working stateDiscontinued
Source modelOpen-source
Initial releaseDecember 2005; 20 years ago (2005-12)
Yes|Final release|Latest release}}Revision 427 / 12 February 2008; 18 years ago (2008-02-12)
Marketing targetWireless sensor networks
Available inEnglish
PlatformsAtmel FireFly, MicaZ motes, MSP430
Kernel typeReal-time operating system
Default user interfaceCommand line interface
LicenseGPL or commercial

Nano-RK is a wireless sensor networking real-time operating system (RTOS)[1][2] from Carnegie Mellon University, designed to run on microcontrollers for use in sensor networks. Nano-RK supports a fixed-priority fully preemptive scheduler with fine-grained timing primitives to support real-time task sets. "Nano" implies that the RTOS is small, using 2 KB of random-access memory (RAM) and using 18 KB of flash memory, while RK is short for resource kernel. A resource kernel provides reservations on how often system resources can be used. For example, a task might only be allowed to execute 10 ms every 150 ms (CPU reservation), or a node might only be allowed to transmit 10 network packets per minute (network reservation). These reservations form a virtual energy budget to ensure a node meets its designed battery lifetime and to prevent a failed node from generating excessive network traffic. Nano-RK is open-source software, is written in C and runs on the Atmel-based FireFly sensor networking platform, the MicaZ motes, and the MSP430 processor.[3]

Tradeoffs occur when using an RTOS in sensor networks.[4]

Advantages

NanoRK takes advantage of priority-based preemptive scheduling to help honor the real-time factor of being deterministic, thus ensuring task timeliness and synchronization. Due to the characteristic of limited battery power on the wireless node, Nano-RK provides central processing unit (CPU), network, and sensor efficiency through the use of virtual energy reservations, labeling this system as a resource kernel. These energy reservations can enforce energy and communication budgets to minimize the negative impact on the node's operational lifetime from unintentional errors or malicious behavior by other nodes within the network. It supports packet forwarding, routing and other network scheduling protocols with the help of a light-weight wireless networking stack. Compared with other current sensor operating systems, Nano-RK provides rich functionality and timeliness scheduling with a small size for its embedded resource kernel (RK).[5]

Features

Static Configuration – Nano-RK uses a static design-time approach for energy use control, and disallows dynamic task creation, requiring application developers to set both task and reservation quotas/priorities in a static testbed design. This design allows creating an energy budget for each task to maintain application requirements and energy efficiency throughout the system's lifetime. Using a static configuration approach, all of the runtime configurations, and the power requirements, are predefined and verified by the designer before the system is deployed and executed in the real world. This approach also helps to guarantee the stability and small-size characteristics relative to traditional RTOSs.

Watchdog Timer support – Watchdog is a software timer that triggers a system reset action if the system hangs on crucial faults for an extended period of time. The watchdog mechanism can bring the system back from the nonresponsive state into normal operation by waiting until the timer goes off and subsequently rebooting the device. In Nano-RK, the watchdog timer is tied directly to the processor's reset signal REBOOT ON ERROR. By default, it is enabled when the system boots and reset each time the scheduler executes. If the system fails to respond within the predefined time period, the system will reboot and run the initialization instruction sequence to hopefully regain control.

Deep Sleep Mode – For energy efficiency reasons, if there are no eligible tasks to run, the system can be powered down and given the option to enter deep sleep mode. When the system is in this mode, only the deep sleep timer can wake the system with a predefined latency period. After waking from sleep mode, the next context swap time is set to guarantee the CPU wakes in time. If a sensor node does not wish to perform deep sleep, it also is presented with the choice to go into a low energy use state while still managing its peripherals.

Ready queue

Nano-RK has implemented a double-linked list of ready queue nodes within a fixed-size array, termed the ready queue, that orders all ready tasks in decreasing order by whichever of the task's priorities is higher. As the number of tasks running within the Nano-RK implementation is statically configured in a testbed before deployment, the ready queue size is also fixed to this number of tasks that can be ready to run. A fixed-length array named nrk readyQ is found within the nrk defs.h file along with two pointers to reference the two most important cells within this array. The free node pointer (free node) and the head node pointer (head node) point to the next cell in the array to be allocated and the current highest priority task ready to run, respectively.

Scheduler

The core of Nano-RK is a static preemptive real-time scheduler which is priority-based and energy efficient. For priority-based preemptive scheduling, the scheduler always selects the highest priority task from the ready queue. To save energy, tasks do not poll for a resource but rather tasks will be blocked on certain events and can be unlocked when the events occur. When there is no task in the ready queue, the system can be powered down to save energy. When the system is working, one and only one task (current task), signified by the nrk cur task tcb, is running for a predefined period. So the most important job of the scheduler is to decide which task should be run next and for how long the next task should run until the scheduler is triggered to run again.

References

  1. nano-RK Nano-RK: A Wireless Sensor Networking Real-Time Operating System (RTOS)
  2. [1] A. Eswaran, A. Rowe and R. Rajkumar, "Nano-RK: An Energy-Aware Resource-Centric Operating System for Sensor Networks," IEEE Real-Time Systems Symposium, December 2005.
  3. Anand Eswaran and Anthony Rowe and Raj Rajkumar, “FireFly: A Time Synchronized Real-Time Sensor Networking Platform”
  4. embedded.com
  5. [3] Anand Eswaran and Anthony Rowe and Raj Rajkumar, “Nano-RK: an Energy-aware Resource-centric RTOS for Sensor Networks,” 2005.