ArticleslgStudy

computer science

Nano-RK

Nano-RK is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Nano-RK rather than just read about it. In short: Nano-RK is a wireless sensor networking real-time operating system (RTOS) 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…

Key takeaways

  • Nano-RK belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Nano-RK to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Nano-RK from memory before moving on to harder problems.

Reference excerpt

Nano-RK is a wireless sensor networking real-time operating system (RTOS) 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. Tradeoffs occur when using an RTOS in sensor networks.

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).

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

External links Official website

Worked examples

Example 1 — a first encounter with Nano-RK

Start with the simplest possible case. Write down what Nano-RK claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Nano-RK before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Nano-RK ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Nano-RK

In research
Nano-RK appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Nano-RK in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Nano-RK is common in secondary-school and first-year university syllabi. It links to neighbouring topics Embedded operating systems, Free software operating systems, Wireless sensor network, so understanding it makes those chapters shorter.
In everyday life
Look for Nano-RK outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Nano-RK in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Nano-RK means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Nano-RK out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Nano-RK in simple terms?

Nano-RK is a wireless sensor networking real-time operating system (RTOS) 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…

Why does Nano-RK matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Nano-RK?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Nano-RK.

Tags

  • Embedded operating systems
  • Free software operating systems
  • Wireless sensor network

Keep exploring