TinyOS Network simulator

What is TINY OS:

  • Free, open source operating system.
  • Developed for low power embedded distributed wireless devices
  • It is written in nesC programming language.



  • Developed for network embedded system C.
  • To support components and concurrency C is optimized.
  • Component based, event driven programming language is used for Tiny OS development.

Components in NesC:

  • Two types of components are used,
  • Modules
  • Configuration


  • Provide implementation for one or more interfaces.
  • A module must implement every command of interfaces


  • Used to assemble other components together.
  • Connecting interfaces used by components to interfaces.

NesC variables:

  • int is NOT used
  • bool is used also

Key requirements of Tiny OS:

  • Scalability
  • Completeness
  • Fidelity
  • Bridging

Hardware used in Tiny OS:

Tossim only emulates behavior of all these hardware

  • Analog-to-Digital Converter (ADC)
  • Clock
  • Transmit strength variable potentiometer
  • Boot sequence component



from TOSSIM import *

import sys, os, getopt


optNumNodes = __NUM_NODES__

optLowRadioFidelity = True

ONE_SECOND = 10000000000

def parseArgs(args):        global optSimDuration, optNumNodes, optLowRadioFidelity        try:               optNames = [“help”, “duration=”, “num-nodes=”, “low-radio-fidelity=”]               opts, args = getopt.getopt(args, “h”, optNames)        except getopt.GetoptError, err:               print str(err)               usage()               sys.exit(2)        for o, a in opts:               if (o == “-h” or o== “–help”):                       usage()                       sys.exit()               if (o==”–duration”):                       optSimDuration = int(a)                       continue               if (o==”–num-nodes”):                       optNumNodes = int(a)                       continue               if (o==”–low-radio-fidelity”):                       optLowRadioFidelity = convertBool(a)                       continue