SlideShare ist ein Scribd-Unternehmen logo
1 von 25
TOSSIM
 Răzvan Musăloiu-E.
What is TOSSIM?



Discrete event simulator
          ns2
Alternatives



Cycle-accurate simulators
        Avrora, MSPSim
Two directions

               Port                           TOSSIM
                                              in tinyos-1.x
    make PC a supported platform


          Virtualize                           TOSSIM
                                               in tinyos-2.x
simulate one of the supported platforms




                                          4
Features
• Simulates a MicaZ mote
  – ATmega128L (128KB ROM, 4KB RAM)
  – CC2420
• Uses CPM to model the radio noise
• Supports two programming interfaces:
  – Python
  – C++
Anatomy

TOSSIM                                 Application
tos/lib/tossim                         Makefile
tos/chips/atm128/sim                   *.nc
tos/chips/atm128/pins/sim              *.h
tos/chips/atm128/timer/sim
tos/chips/atm128/spi/sim
                                       Simulation Driver
tos/platforms/mica/sim
tos/platforms/micaz/sim
tos/platforms/micaz/chips/cc2420/sim   *.py | *.cc




                                                  6
Quick Overview

Application           Simulation
               Glue


                           Python
   NesC


                            C++




                               7
The Building Process
  $ make micaz sim
1.Generate an XML schema                app.xml



2.Compile the application                 sim.o

                                     pytossim.o
3.Compile the Python support            tossim.o
                                     c-support.o

4.Build a share object         _TOSSIMmodule.o


5.Copying the Python support        TOSSIM.py

  $ ./sim.py

                               8
TOSSIM.py

  Tossim
   Radio
   Mote
  Packet
   Mac

            9
TOSSIM.Tossim

.getNode() → TOSSIM.Mote
.radio() → TOSSIM.Radio
.newPacket() → TOSSIM.Packet
.mac() → TOSSIM.Mac

.runNextEvent()
.ticksPerSecond()
.time()


                               10
10 seconds

from TOSSIM import *

t = Tossim([])

  ...

while t.time() < 10*t.ticksPerSecond():
   t.runNextEvent()




                                    11
dbg
Syntax
  dbg(tag, format, arg1, arg2, ...);

Example
  dbg(“Trickle”, “Starting time with time %u.n”, timerVal);

Python
  t = Tossim([])
  t.addChannel(“Trickle”, sys.stdout)



                                                    12
Useful Functions

char*            sim_time_string()
sim_time_t sim_time()
int              sim_random()
sim_time_t sim_ticks_per_sec()


      typedef long long int sim_time_t;


                                          13
Radio Model


Closest-fit Pattern Matching
            (CPM)
  Improving Wireless Simulation Through Noise Modeling
             HyungJune Lee, Alberto Cerpa, and Philip Levis
                               IPSN 2007




                                                              14
Radio Model


Sender




             Receiver


                        15
Noise Level

Meyer Heavy            Casino Lab

              Signal
     SNR
                          SNR




                                    16
CC2420 SNR/PRR
          100

           90

           80

           70

           60
PRR (%)




           50

           40

           30

           20

           10

            0
                0   2   4      6       8   10   12
                            SNR (dB)
                                                 17
TOSSIM.Radio

.add(source, destination, gain)

.connected(source, destination) → True/False
.gain(source, destination)




                                        18
TOSSIM.Mote

.bootAtTime(time)
.addNoiseTraceReading(noise)
.createNoiseModel()

.isOn() → True/False
.turnOn()/.turnOff()




                               19
Example
from TOSSIM import *
                             0            1
t = Tossim([])
                                 -10 dB
r = t.Radio()

mote0 = t.getNode(0)
mote1 = t.getNode(1)
                                 -50 dB
mote2 = t.getNode(2)

r.add(0, 1, -10)
r.add(1, 0, -10)
r.add(1, 2, -50)
r.add(2, 1, -50)
                                          2

                                   20
Example (cont)
noise = file(quot;meyer-short.txtquot;)
                                      0            1
lines = noise.readlines()
                                          -10 dB
for line in lines:
  str = line.strip()
  if (str != quot;quot;):
    val = int(str)                        -50 dB
    for m in [mote0, mote1, mote2]:
      m.addNoiseTraceReading(val)

for m in [mote0, mote1, mote2]:
    m.createNoiseModel()
                                                   2

                                            21
Other Features

• Injecting packets
• Inspecting internal variables
• C++ interface
• Debuging using gdb




                                  22
Improvements
• TossimLive
   – SerialActiveMessageC

• CC2420sim
  – Multiple channels
  – PacketLink
  – CC2420Packet: .getRSSI(), .getLQI()
  – ReadRssi()
  – Flash support


                                          23
Future


Parametrized the PRR/SNR curve
based on packet size (in progress)


Support for multiple binary images
             (harder)




                                     24
Next
Safe TinyOS

              25

Weitere ähnliche Inhalte

Was ist angesagt?

Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)Respa Peter
 
How to configure port security in cisco switch
How to configure port security in cisco switchHow to configure port security in cisco switch
How to configure port security in cisco switchIT Tech
 
CCNA BASIC SWITCHING AND SWITCH CONFIGURATION
CCNA BASIC SWITCHING AND SWITCH CONFIGURATIONCCNA BASIC SWITCHING AND SWITCH CONFIGURATION
CCNA BASIC SWITCHING AND SWITCH CONFIGURATIONAswini Badatya
 
Spanning tree protocol
Spanning tree protocolSpanning tree protocol
Spanning tree protocolMuuluu
 
Barry Hesk: Cisco Unified Communications Manager training deck 1
Barry Hesk: Cisco Unified Communications Manager training deck 1Barry Hesk: Cisco Unified Communications Manager training deck 1
Barry Hesk: Cisco Unified Communications Manager training deck 1Barry Hesk
 
An Overview of Border Gateway Protocol (BGP)
An Overview of Border Gateway Protocol (BGP)An Overview of Border Gateway Protocol (BGP)
An Overview of Border Gateway Protocol (BGP)Jasim Alam
 
Spanning tree protocol (stp)
Spanning tree protocol (stp)Spanning tree protocol (stp)
Spanning tree protocol (stp)RaghulR21
 
Multiprotocol label switching (mpls) - Networkshop44
Multiprotocol label switching (mpls)  - Networkshop44Multiprotocol label switching (mpls)  - Networkshop44
Multiprotocol label switching (mpls) - Networkshop44Jisc
 
Introducing MQTT
Introducing MQTTIntroducing MQTT
Introducing MQTTAndy Piper
 

Was ist angesagt? (20)

Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)
 
Mac protocols
Mac protocolsMac protocols
Mac protocols
 
Spanning tree protocol
Spanning tree protocolSpanning tree protocol
Spanning tree protocol
 
Routing Protocols
Routing Protocols Routing Protocols
Routing Protocols
 
Router commands
Router commandsRouter commands
Router commands
 
How to configure port security in cisco switch
How to configure port security in cisco switchHow to configure port security in cisco switch
How to configure port security in cisco switch
 
Cisco ospf
Cisco ospf Cisco ospf
Cisco ospf
 
CCNA BASIC SWITCHING AND SWITCH CONFIGURATION
CCNA BASIC SWITCHING AND SWITCH CONFIGURATIONCCNA BASIC SWITCHING AND SWITCH CONFIGURATION
CCNA BASIC SWITCHING AND SWITCH CONFIGURATION
 
Dynamic routing protocols (CCNA)
Dynamic routing protocols (CCNA)Dynamic routing protocols (CCNA)
Dynamic routing protocols (CCNA)
 
Spanning Tree Protocol Cheat Sheet
Spanning Tree Protocol Cheat SheetSpanning Tree Protocol Cheat Sheet
Spanning Tree Protocol Cheat Sheet
 
Spanning tree protocol
Spanning tree protocolSpanning tree protocol
Spanning tree protocol
 
SDH Frame Structure
SDH Frame StructureSDH Frame Structure
SDH Frame Structure
 
Presentation 6lowpan
Presentation 6lowpanPresentation 6lowpan
Presentation 6lowpan
 
Barry Hesk: Cisco Unified Communications Manager training deck 1
Barry Hesk: Cisco Unified Communications Manager training deck 1Barry Hesk: Cisco Unified Communications Manager training deck 1
Barry Hesk: Cisco Unified Communications Manager training deck 1
 
An Overview of Border Gateway Protocol (BGP)
An Overview of Border Gateway Protocol (BGP)An Overview of Border Gateway Protocol (BGP)
An Overview of Border Gateway Protocol (BGP)
 
Spanning tree protocol (stp)
Spanning tree protocol (stp)Spanning tree protocol (stp)
Spanning tree protocol (stp)
 
HSRP ccna
HSRP ccna HSRP ccna
HSRP ccna
 
Multiprotocol label switching (mpls) - Networkshop44
Multiprotocol label switching (mpls)  - Networkshop44Multiprotocol label switching (mpls)  - Networkshop44
Multiprotocol label switching (mpls) - Networkshop44
 
Introducing MQTT
Introducing MQTTIntroducing MQTT
Introducing MQTT
 
CCNA ppt
CCNA pptCCNA ppt
CCNA ppt
 

Andere mochten auch

Intoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMIntoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMPrakhar Bansal
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..cscarcas
 
Wireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and ComparisonsWireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and ComparisonsCSCJournals
 
Xamarin.Mac Seminar
Xamarin.Mac SeminarXamarin.Mac Seminar
Xamarin.Mac SeminarXamarin
 
Using Tiny OS in Wireless Sensor Network
Using Tiny OS in Wireless Sensor NetworkUsing Tiny OS in Wireless Sensor Network
Using Tiny OS in Wireless Sensor NetworkDeeptiman Mallick
 
Design and implementation of TARF: A Trust Aware Routing Framework for Wirele...
Design and implementation of TARF: A Trust Aware Routing Framework for Wirele...Design and implementation of TARF: A Trust Aware Routing Framework for Wirele...
Design and implementation of TARF: A Trust Aware Routing Framework for Wirele...ketaki19deshmukh
 
VANET Simulation - Jamal Toutouh
VANET Simulation - Jamal  ToutouhVANET Simulation - Jamal  Toutouh
VANET Simulation - Jamal ToutouhJamal Toutouh, PhD
 
Link Layer Protocols for WSN-based IoT
Link Layer Protocols for WSN-based IoTLink Layer Protocols for WSN-based IoT
Link Layer Protocols for WSN-based IoTPrasant Misra
 
Tutorial 1 installing mixim and mixnet
Tutorial 1   installing mixim and mixnetTutorial 1   installing mixim and mixnet
Tutorial 1 installing mixim and mixnetMohd Batati
 

Andere mochten auch (20)

Intoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMIntoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIM
 
TinyOS
TinyOSTinyOS
TinyOS
 
Micaz and TelosB
Micaz and TelosBMicaz and TelosB
Micaz and TelosB
 
TinyOS Course 02 Serial Communication
TinyOS Course 02 Serial CommunicationTinyOS Course 02 Serial Communication
TinyOS Course 02 Serial Communication
 
Introduction to Qualnet
Introduction to Qualnet Introduction to Qualnet
Introduction to Qualnet
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
Session 1 introduction to ns2
Session 1   introduction to ns2Session 1   introduction to ns2
Session 1 introduction to ns2
 
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic ProgrammingTinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..
 
Wireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and ComparisonsWireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and Comparisons
 
Introduction to Qualnet
Introduction to QualnetIntroduction to Qualnet
Introduction to Qualnet
 
Begineers for Qualnet
Begineers for QualnetBegineers for Qualnet
Begineers for Qualnet
 
Xamarin.Mac Seminar
Xamarin.Mac SeminarXamarin.Mac Seminar
Xamarin.Mac Seminar
 
Using Tiny OS in Wireless Sensor Network
Using Tiny OS in Wireless Sensor NetworkUsing Tiny OS in Wireless Sensor Network
Using Tiny OS in Wireless Sensor Network
 
Network simulation software
Network simulation softwareNetwork simulation software
Network simulation software
 
Design and implementation of TARF: A Trust Aware Routing Framework for Wirele...
Design and implementation of TARF: A Trust Aware Routing Framework for Wirele...Design and implementation of TARF: A Trust Aware Routing Framework for Wirele...
Design and implementation of TARF: A Trust Aware Routing Framework for Wirele...
 
VANET Simulation - Jamal Toutouh
VANET Simulation - Jamal  ToutouhVANET Simulation - Jamal  Toutouh
VANET Simulation - Jamal Toutouh
 
~Ns2~
~Ns2~~Ns2~
~Ns2~
 
Link Layer Protocols for WSN-based IoT
Link Layer Protocols for WSN-based IoTLink Layer Protocols for WSN-based IoT
Link Layer Protocols for WSN-based IoT
 
Tutorial 1 installing mixim and mixnet
Tutorial 1   installing mixim and mixnetTutorial 1   installing mixim and mixnet
Tutorial 1 installing mixim and mixnet
 

Ähnlich wie TinyOS 2.1 Tutorial: TOSSIM

TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition 艾鍗科技
 
Vectorization on x86: all you need to know
Vectorization on x86: all you need to knowVectorization on x86: all you need to know
Vectorization on x86: all you need to knowRoberto Agostino Vitillo
 
Sil dgcis themis_n_specifications_v1.0_beta
Sil dgcis themis_n_specifications_v1.0_betaSil dgcis themis_n_specifications_v1.0_beta
Sil dgcis themis_n_specifications_v1.0_betabonnaudfrederic
 
スケジューラからみたOSの話
スケジューラからみたOSの話スケジューラからみたOSの話
スケジューラからみたOSの話Takeshi Fujiwara
 
20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Jorisimec.archive
 
JIT compilation for CPython
JIT compilation for CPythonJIT compilation for CPython
JIT compilation for CPythondelimitry
 
Designing C++ portable SIMD support
Designing C++ portable SIMD supportDesigning C++ portable SIMD support
Designing C++ portable SIMD supportJoel Falcou
 
TinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionTinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionRazvan Musaloiu-E.
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source codePVS-Studio
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source codeAndrey Karpov
 
Georgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityGeorgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityDefconRussia
 
Samsung 1.8 inch AMOLED(128x60) Datasheet
Samsung 1.8 inch AMOLED(128x60) DatasheetSamsung 1.8 inch AMOLED(128x60) Datasheet
Samsung 1.8 inch AMOLED(128x60) DatasheetPanox Display
 
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...Andrey Karpov
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby SystemsEngine Yard
 

Ähnlich wie TinyOS 2.1 Tutorial: TOSSIM (20)

TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
Vectorization on x86: all you need to know
Vectorization on x86: all you need to knowVectorization on x86: all you need to know
Vectorization on x86: all you need to know
 
Sil dgcis themis_n_specifications_v1.0_beta
Sil dgcis themis_n_specifications_v1.0_betaSil dgcis themis_n_specifications_v1.0_beta
Sil dgcis themis_n_specifications_v1.0_beta
 
スケジューラからみたOSの話
スケジューラからみたOSの話スケジューラからみたOSの話
スケジューラからみたOSの話
 
20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris
 
JIT compilation for CPython
JIT compilation for CPythonJIT compilation for CPython
JIT compilation for CPython
 
TVM VTA (TSIM)
TVM VTA (TSIM) TVM VTA (TSIM)
TVM VTA (TSIM)
 
Designing C++ portable SIMD support
Designing C++ portable SIMD supportDesigning C++ portable SIMD support
Designing C++ portable SIMD support
 
TinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionTinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on Session
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Georgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityGeorgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software security
 
Ns2 introduction 2
Ns2 introduction 2Ns2 introduction 2
Ns2 introduction 2
 
MIPS-SPIM Taiwan
MIPS-SPIM TaiwanMIPS-SPIM Taiwan
MIPS-SPIM Taiwan
 
Samsung 1.8 inch AMOLED(128x60) Datasheet
Samsung 1.8 inch AMOLED(128x60) DatasheetSamsung 1.8 inch AMOLED(128x60) Datasheet
Samsung 1.8 inch AMOLED(128x60) Datasheet
 
GNU Radio
GNU RadioGNU Radio
GNU Radio
 
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
SDH and TDM telecom
SDH and TDM telecomSDH and TDM telecom
SDH and TDM telecom
 
RAZORPOINT TCP/UDP PORTS LIST
RAZORPOINT TCP/UDP PORTS LISTRAZORPOINT TCP/UDP PORTS LIST
RAZORPOINT TCP/UDP PORTS LIST
 

Kürzlich hochgeladen

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

TinyOS 2.1 Tutorial: TOSSIM

Hinweis der Redaktion

  1. Hi, I&#x2019;m R&#x103;zvan Mus&#x103;loiu. I&#x2019;m the maintainer of the Deluge T2 but I care about several other things in TinyOS. Today I&#x2019;m here to talk about TOSSIM.
  2. TOSSIM is the TinyOS simulator. It&#x2019;s a discrete event simulator. This means that it maintains a sorted queue of events. At each step the event with the oldest timestamp is extracted and executed. Each event can add new events to the queue. A popular simulator that works in the same way is ns2.
  3. Another different type of simulators are the cycle-accurate ones which simulate the MCU at the instruction level. A consequence of this is the fact that they take as input a binary image (and ELF file) which makes them agnostic to the way the binary was generated (TinyOS, Contiki, LiteOS, plain C, etc). Such a simulator for the MicaZ mote is Avrora and the one for TelosB is MSPSim.
  4. Back to TOSSIM now. There are two ways in which we can achieve the goal of being able to run TinyOS on a PC. We can either make the PC a supported platform in TinyOS or we can virtualize one of the already existing ones. The first solution is implemented in TinyOS 1.x while the second one is implemented in TinyOS 2.x.
  5. The mote that TOSSIM simulates is MicaZ. This is based on a Atmel ARmega128L, an 8-bit MCI with 128KB of ROM and 4KB of RAM, and a CC2420, a 802.15.4 radio. One important thing in TOSSIM is the way the radio communication is simulated. The main role is played by the CPM model of the radio noise. We&#x2019;ll talk more about this later. TOSSIM can be controlled using two languages: Python and C++. In the rest of the talk I&#x2019;m going to talk about Python.
  6. The bulk of the code related to TOSSIM is in tos/lib/tossim. The code that virtualize the MicaZ is in several sim/ folders in tos/chips/atm128, tos/platforms/mica and tos/platforms/micaz. To do a simulation we also need an application which has a Makefile, several .nc files and potentially some .h ones. One last piece we need is a simulation driver which is either a Python script or a C++ program.
  7. To summarize, the main components of a TOSSIM simulation are: the application, a simulation script and some glue that links this two things together. As I mentioned before, beside Python we can also use C++ to drive the simulation.
  8. Here is how a typical building process looks like. The make command is &#x201C;make micaz sim&#x201D; and there are 5 things that take places: (1) an XML description of the wirings is generated (app.xml), (2) the application is compiled (sim.o) together with (3) the glue necessary for Python/C++ (pytossim.o, tossim.o, c-support.o), (4) all the object files are merge in one big share object file called _TOSSIMmodule.o and finally (5) the TOSSIM.py is copied from tos/lib/tossim to the application directory. After this we can run you simulation script which in this case is called sim.py
  9. The TOSSIM.py offers 5 important classes. The main one is called Tossim and it is used as a factory object for all the other 4: Radio, Mote, Packet and Mac.
  10. Here are some useful TOSSIM.Tossim functions. The .getNode() returns a TOSSIM.Mote object. The function has one parameter which is the number of the node. The .radio() is used to obtain the TOSSIM.Radio and .mac() is used to obtain the TOSSIM.Mac. The .newPacket() is used to construct a new packet which can then be injected in the radio stack of a node. I&#x2019;m not going to demonstrate this but there is an example on the wiki page: http://docs.tinyos.net/index.php/TOSSIM The .runNextEvent() is the one responsible for executing the oldest event in the event queue. We&#x2019;ll see on the next slide how to use it. As the name indicate the .ticksPerSecond() returns the number of ticks per second. The .time() returns the current virtual time. This is also expressed in ticks.
  11. Here is the Python code to simulate 10 seconds.
  12. When we use TOSSIM a nice feature is that we can add in the nesC code debug messages. This is done using a function called dbg which is similar with printf but it takes one additional text parameter: a tag. This tag can allow us to selectively enable and disable the debug messages that are recorded. This is done using the a function the addChannel from TOSSIM.Tossim. By default the debug messages are disabled.
  13. Some other useful functions that available in the nesC code under TOSSIM are the following: sim_time_string() that returns a string with description of the current time (this is useful in dbg messages), sim_time() that returns the time in number of ticks, sim_random that returns a random integer, sim_ticks_per_sec() that returns the number of ticks for a virtual second. Note that the time is expressed as a 64-bit number.
  14. Let&#x2019;s now talk a little about the radio model. As I said, the most important role is played by CPM, a way to model the noise that was published in IPSN 2007.
  15. Let&#x2019;s start with a sender and a receiver. The packet leaves from sender with a certain strength (1mW, 0 dBm for CC2420). By the time it reaches the receiver the strength is much lower. The receiver is also surrounded by noise.
  16. Here are two example of how the noise looks like. The trace from the left is shows the very noisy environment from the Meyer library from Stanford while the more quiet one from right is from the Casino Lab from Colorado Schools of Mines. The strength of the signal is represented by the red line and the distance between it and the noise is what we called SNR, Signal to Noise Ratio.
  17. The Packet Reception Rate (PRR) of the CC2420 depends on the SNR in the way depicted in this figure. This is an idealized curve and is hard-coded in TOSSIM. We can see when the strength of the packet is approaching the noise floor (SNR is lower) the PRR is going to zero. When the signal is significantly stronger than the noise (higher SNR) then the PRR is 100%. TOSSIM decides if a packet is drop in the following ways: it uses CPMS to find the noise level for the current moment in time, then it computes the SNR and finds the PRR p of the current packet using the SNR/PRR curve. In the last step a random number between 0 and 100 is draw and if the value is less than PRR p then packet is considered received.
  18. The most important function from TOSSIM.Radio object is the .add() function which is used to describe the path attenuation between nodes. Two other handy functions are the .connected() which can indicate if two nodes have a link between them of not and the .gain, which return the value indicated by the .add() function.
  19. The TOSSIM.Mote objects are used to indicate when the mote is booted using the .bootAtTime() function. The time is expressed in ticks. In order to avoid unreal behavior the nodes should always be started at different times. This object is also used to describe the noise around the mote. This is done using two functions: .addNoiseTraceReading() and .createNoiseModel(). The first one is used to feed to the model a particular noise trace. The number of samples needs to be at least 100. The second function instructs the CPM to finalize the creation of the noise model. Some other useful functions are: isOn() to find if the mote is up or not and .turnOn() and .turnOff() to force the mote in and out the on state.
  20. Let&#x2019;s now look at an example of how to describe a network of 3 nodes. We only have two links and both are symmetric. The one between mote 0 and mote 1 is short and the attenuation is only -10 dB; for the one between 1 and 2 is -50 dB. The first we do in our script is to import everything from the TOSSIM module (the TOSSIM.py file I mentioned in the building process). Then be construct a Tossim object called t and use it to get the radio in a variable called r. What we do next is to construct three Mote objects using the .getNode function. Then we construct the two links using r.
  21. Now we are going to read a noise trace from the meyer-short.txt file and feed it to all the three motes. Each line of the noise trace file contains one noise reading. The last thing we need to do is to call the .createNoiseModel function for all the motes. After this a similar loop as the one presented in the &#x201C;10 seconds&#x201D; slide can be used.
  22. Here are some other features that I didn&#x2019;t have time to talk about.
  23. The TossimLive is an enhancement that add support for SerialActiveMessageC, the serial port used by a mote to talk to the PC (when is connected). The code for this is already in the CVS. The CC2420sim is replacing the generic radio used by TOSSIM with a simulation of the CC2420, the 802.15.4 radio from the MicaZ mote. Beside this support for flash is also added. This code is not yet in CVS and is maintain in a cc2420sim heads from http://hinrg.cs.jhu.edu/git/.
  24. Here are a few things about the future. First the PRR/SNR curve can be improved by taking in consideration the packet size. This is quite easy to do and we are going to have it available soon. A more complicated thing that could be fix is the fact that TOSSIM can only run one application at a time. This means that in order to simulate two applications they need to first be merge into one. This is cumbersome when the same codebase is used for both simulation and real deployment. We are investigating ways to solve this but it will take some time.