Contiki OS Documentation

repository·master·Indexed 26 days ago

https://github.com/contiki-os/contiki

An open-source operating system optimized for low-power microcontrollers in IoT applications. Documentation covers core networking modules including the ip64 module for IPv6/IPv4 translation, IPv6 multicast engines (ESMRF, SMRF, ROLL TM), Link Layer Security (LLSEC) with noncoresec implementation, and Time-Slotted Channel Hopping (TSCH) with RPL integration and the Orchestra autonomous scheduling solution.

Tokens
48.7K
Snippets
104
Records
331
Agent score
87%

What's inside Contiki

  1. Overview of Zolertia RE-Mote platform (revision A)

    master

    The RE-Mote is a hardware development platform designed for IoT applications (Smart Cities, Home Comfort, eHealth, Industrial). It uses a Zoul core module and focuses on ultra-low power consumption and resilient operation.

    Key Hardware Specifications:

    • Processor: ARM Cortex-M3 (32MHz, 512KB flash, 32KB RAM with 16KB retention).
    • Wireless Connectivity:
      • 2.4-GHz IEEE 802.15.4 & Zigbee/Thread compliant.
      • ISM 868-, 915-, 920-, 950-MHz ISM/SRD Band.
      • On-board RF switch for programmatic interface selection.
      • Supports external antenna via RP-SMA or internal/UFl antenna.
    • Security: AES-128/256, SHA2 Hardware Encryption; ECC-128/256, RSA Hardware Acceleration.
    • Power Management:
      • Shutdown mode down to 170nA.
      • Built-in battery charger (500mA), Energy Harvesting, and Solar Panel support for LiPo batteries.
      • Wide power input range: 3.7-16VDC.
      • Nano-watt Real Time Clock Calendar (RTCC).
    • Peripherals & Features:
      • Programming via BSL (no button press required).
      • Micro USB (USB 2.0).
      • RGB LED (7+ color combinations).
      • Micro-SD slot for external storage.
      • External Watchdog Timer (WDT) and battery monitor for resilience.
      • User and Reset buttons.
  2. Overview of the ip64 module

    master

    The ip64 module enables an IPv6 Contiki network to connect to an IPv4 network without requiring external software or additional configuration. It is designed to run on the RPL root node and performs the following functions:

    • Packet Translation: Uses stateful NAT64 (RFC6164) to translate outgoing IPv6 packets into IPv4 packets and incoming IPv4 packets into IPv6 packets.
    • DNS Resolution: Uses DNS64 (RFC6147) to intercept DNS requests for IPv6 addresses, converting them into IPv4 requests, and translating the replies back into IPv6 responses. This allows IPv6-only devices to reach named servers on the IPv4 internet.
    • Routing Fallback: Hooks into the IPv6 stack via a fallback interface. Any packet that cannot be routed within the local RPL mesh is sent to this interface, where ip64 translates it to IPv4 and sends it via the outgoing interface.
    • Network Services: Performs DHCPv4 to request IPv4 addresses for Ethernet-connected devices and handles ARP processing for Ethernet communication.
  3. Overview of X86 Lightweight Protection Domains

    master

    The X86 port of Contiki implements a pluggable framework for lightweight protection domains to enforce the principle of least privilege. This framework allows defining specific resource access controls for different parts of the system.

    Available Plugins

    • Flat memory model with paging: Uses paging for isolation.
    • Multi-segment memory model: Uses either hardware-switched segments (based on Task-State Segment/TSS structures) or software-switched segments.

    Default Protection Domains

    • kern: The Kernel protection domain. It is more privileged than any other domain. Minimal code should reside here.
    • app: The Application protection domain. Used for general code that does not require special privileges.

    Custom Protection Domains

    Developers can define additional domains for specific needs, such as:

    • Drivers: For example, the Ethernet and UART drivers are assigned separate protection domains. Note that drivers only requiring access to programmed IO ports (via IN* and OUT* instructions) can run in the app or kern domains.
    • Non-driver components: Any other isolated logic.
  4. Overview of the Contiki Operating System

    master
    Contiki is an open-source operating system designed for tiny, low-power microcontrollers. It enables the development of applications that maximize hardware efficiency while providing standardized low-power wireless communication across various hardware platforms. It is widely used in commercial and non-commercial IoT applications such as industrial monitoring, smart city infrastructure (street lights, sound monitoring), and remote home monitoring.
  5. Overview of Erbium (Er) REST Engine Examples

    master

    The Erbium (Er) REST Engine provides examples for developing CoAP-based RESTful applications in Contiki. Key example files include:

    • er-example-server.c: A RESTful server implementation using the CoAP protocol.
    • er-example-client.c: A CoAP client that polls the /actuators/toggle resource every 10 seconds and cycles through 4 resources upon a button press (uses a hard-coded target address).
    • er-plugtest-server.c: A server designed for ETSI IoT CoAP Plugtest compliance, configured for the minimal-net platform.
  6. Overview of the DC Converter IoT-grid Example

    master

    This example provides a mockup of DC converter functionality for an IoT-grid using the standard Contiki IoT protocol stack. It demonstrates how to implement device functionalities as CoAP resources using sensors and handlers.

    Protocol Stack Configuration:

    • Application: CoAP
    • Transport: UDP
    • Network: IPv6/RPL
    • Adaptation: 6LoWPAN
    • MAC: nullmac_driver
    • Radio Duty Cycle: nullrdc_driver
    • Physical: IEEE 802.15.4
  7. Overview of Zolertia Orion Ethernet Router

    master

    The Zolertia Orion is an IoT Ethernet Router designed to connect IPv4/IPv6 services or applications to 6LoWPAN wireless networks. It functions as a capable IPv4/IPv6 routing device featuring an Ethernet interface and dual wireless radios. It is compatible with the 6LBR (6LoWPAN Border Router) software.

    Key Hardware Specifications:

    • Processor: ARM Cortex-M3 @ 32MHz (512KB flash, 32KB RAM).
    • Wireless: IEEE 802.15.4 & Zigbee compliant (2.4-GHz) and ISM bands (868, 915, 920, 950-MHz).
    • Ethernet: RJ45 connector supporting 10BASE-T IPv4/IPv6 via an integrated ENC28J60 module.
    • Power: Supported via micro-USB or Power Over Ethernet (PoE) up to 48VDC.
    • Security: Hardware engines for AES-128/256, SHA2, ECC-128/256, and RSA.
    • Connectivity: RP-SMA connector (2.4GHz) and SMA connector (868/915MHz).
  8. Overview of Zolertia RE-Mote platform (revision B)

    master

    The RE-Mote (Revision B) is a hardware development platform designed for IoT applications (Smart Cities, Home Comfort, eHealth, Industrial). It uses a Zoul core module and focuses on ultra-low power consumption and high performance.

    Key hardware specifications include:

    • Processor: ARM Cortex-M3 (32MHz, 512KB flash, 32KB RAM).
    • Connectivity: ISM 2.4-GHz (IEEE 802.15.4, Zigbee, Thread) and ISM 868/915/920/950-MHz bands.
    • RF Interface: On-board RF switch for programmatic selection of interfaces. Supports external antenna via RP-SMA or internal/UFl connections.
    • Security: AES-128/256, SHA2 Hardware Encryption; ECC-128/256, RSA Hardware Acceleration.
    • Power Management: Shutdown mode down to 150nA; built-in battery charger (500mA); supports Energy Harvesting and Solar Panels with LiPo batteries; wide input range (3.7-16VDC).
    • Peripherals: Micro USB (USB 2.0), RGB LED, nano-watt Real Time Clock Calendar (RTCC), Micro-SD slot, and an external Watchdog Timer (WDT).
    • Programming: Supports programming over BSL without manual button presses to enter bootloader mode.
  9. Understand X86 Protection Domain Privilege Levels

    master

    When X86 Lightweight Protection Domain support is active in Contiki, the system uses different ring levels to isolate code. Higher ring numbers indicate lower privilege levels:

    • Ring 0: Reserved for exception handlers and system call dispatchers (including return dispatchers).
    • Ring 2: Code running in the preemptive scheduling context.
    • Ring 3: Code running in the cooperative scheduling context.

    Ring level 1 is unused. When protection domain support is inactive, all code runs at ring level 0.

  10. Hardware-Switched Segment-Based Protection Domains

    master

    This implementation uses Task State Segments (TSS) and Local Descriptor Tables (LDT) to manage protection domains.

    • TSS Allocation: One TSS is allocated per protection domain.
    • LDT Association: Each TSS is associated with its own dedicated LDT. Memory resources for a specific domain are defined as segment descriptors within its LDT.
    • Shared Resources: Shared memory resources are represented as segment descriptors in the Global Descriptor Table (GDT).
    • Primary Implementation Files:
      • cpu/x86/mm/tss-prot-domains.c
      • cpu/x86/mm/tss-prot-domains-asm.S