180 likes | 273 Views
TOSSIM v01.a. TOSSIM Capabilities. Simulates large mote networks under Linux Uses existing TinyOS code (different compilation) Extensible network model Logs network activity. Compiling TOSSIM. Similar makefile to FULLPC Uses a few different component implementations MAIN.c RFM.c POT.c
E N D
TOSSIM v01.a TOSSIM 17.ix.2001
TOSSIM Capabilities • Simulates large mote networks under Linux • Uses existing TinyOS code (different compilation) • Extensible network model • Logs network activity TOSSIM 17.ix.2001
Compiling TOSSIM • Similar makefile to FULLPC • Uses a few different component implementations • MAIN.c • RFM.c • POT.c • etc. • system/tossim • make –f MakefileTOS TOSSIM 17.ix.2001
Running TOSSIM • A few command line parameters • main [OPTIONS] num_nodes • Network model: simple is default • [-r <static|simple|space>] • Pause on system clock interrupts • [-p usec] TOSSIM 17.ix.2001
Debugging Output • dbg() commands in TinyOS source • Many dbg flags: DBG_SIM, DBG_RADIO, DBG_CLOCK, etc. • system/include/dbg_modes.h • > setenv DBG=route,boot,usr2 TOSSIM 17.ix.2001
External Communication • Tries to open sockets to listening servers at boot • Network packets • Network bits • Packet injection • Opens a server socket for dynamic network packet injection TOSSIM 17.ix.2001
Network Traffic GUI • tools/TossimGUI.class • Reads in and displays network traffic • Allows packet source filtering • Static packet injection (at startup) TOSSIM 17.ix.2001
Static Packet Injection • java TossimGUI [filename] • File contains packets to be received by nodes • <time> <moteID> <data0> <data1> … <data37> • tools/radio.txt 324122 2 ff ff 08 13 de ad be ef … 00 00 00 00 TOSSIM 17.ix.2001
Simulation Time • Time represented in ticks • 4 x 106 ticks/second • e.g. 400 ticks between 10Kb radio interrupts • Chosen as minimum value that allows accurate radio and system clock modeling TOSSIM 17.ix.2001
Dynamic Packet Injection • Connect to port 10579 on host • Message format detailed in documentation • system/tossim/doc/tossim.tex • Will be building dynamic injection tool TOSSIM 17.ix.2001
RFM Models • Simple: every mote in one cell • Static: connectivity determined at startup • Space: silly space-based model which uses potentiometer settings: proof of extensibility TOSSIM 17.ix.2001
TOSSIM Internals • Based on tos4.2 TOSSIM (Culler) • Discrete event simulation • Models clock interrupts • Every event associated with specific mote • Array of mote structures • #define VAR(x) \ TOS_My_Frame[tos_state.current_node].x TOSSIM 17.ix.2001
MAIN.c Event Loop while(!queue_is_empty(&(tos_state.queue))) { // Currently a race condition (dynamic injection) tos_state.tos_time = queue_peek_event_time(&(tos_state.queue)); queue_handle_next_event(&(tos_state.queue)); TOS_schedule_task(); } TOSSIM 17.ix.2001
RFM Simulation typedef struct { void(*init)(); void(*transmit)(int, char); void(*stop_transmit)(int); char(*hears); void* data; } rfm_model; TOSSIM 17.ix.2001
Example: Simple Model • Every mote has a hearing value • Every time a mote transmits, it increments hearing value for all other motes • Every time a mote stops transmitting, it decrements hearing value for all other motes • If hearing value greater than 1 when a mote listens, that mote heard a bit • Static model uses a connectivity graph TOSSIM 17.ix.2001
Scalability • Tested with 1000 motes communicating over radio • 10 simulated seconds for 1000 motes takes 1.5-3 minutes (depends on level of optimization, debugging symbols, etc.) TOSSIM 17.ix.2001
Conclusion • Demonstration • Questions TOSSIM 17.ix.2001