The nesC Language

Presented on February 5, 2018
Presenter: Michael

Preview

Michael will present “The nesC language: A holistic approach to networked embedded systems” by Gay, Levis, von Behren, Welsh, Brewer, and Culler. We may also touch on a “TinyOS” paper by Hill, Szewczyk, Woo, Hollar, Culler, and Pister.

Summary

nesC is an extension of C specially designed for networked embedded systems. Its goal is to facilitate safe, simple concurrency in event-driven environments by providing the several abstractions described below. They design and use nesC to assist in implementing TinyOS, an OS for embedded systems.

TinyOS architecture guided the design of nesC. TinyOS is decomposed into components, uses task and event-based concurrency, and has no blocking operations (choosing instead to use split-phase operations).

The key nesC abstractions are interfaces and components (modules, and configurations). An interface is a grouping of commands (which the provider implements) and events (which the user implements). A module is an implementation of an interface; it may use other interfaces and is the basic units of state that interact with other components. A configuration is the wiring of several components together; here, you connect provided and used interfaces together. An application is created by defining a top-level configuration.

nesC is reduces its expressive power in exchange for added safety and ease of analysis by disallowing separate compilation and dynamic memory. It provides safe, simple concurrency by providing atomic sections (implemented via disabling and then again enabling interrupts) and tasks (which must run to completion).

The component model allows the resulting application to only include code from TinyOS that is used. They evaluated the TinyOS implementation using nesC by measuring the resulting system size and number of data races they were able to detect and resolve. In their optimization section, they argue that the component model restrictions allow better static analysis and optimizations to be performed by the compiler. Finally, they posit nesC could support larger types of applications and systems after handling the dynamic memory problem and extending their concurrency model.

Discussion