Sensix
Wireless Sensor Network Middleware



   Home


   Project Page


   Download


   CVS




 Hosted by
Get SENSIX at SourceForge.net. Fast, secure 
and Free Open Source software downloads

/home/brennan/Software/sensix/tools/sim/platform.pc/packet_sim.c File Reference

#include <packet_sim.h>

Go to the source code of this file.

Classes

struct  IncomingMsg

Defines

#define BIT_TIME   104
#define BYTE_TIME   (8 * BIT_TIME)

Functions

void initialBackoff ()
void event_backoff_create (event_t *event, int node, long long eventTime)
void event_backoff_handle (event_t *event, struct TOS_state *state) __attribute__((C
void event_start_transmit_handle (event_t *event, struct TOS_state *state) __attribute__((C
void event_start_transmit_create (event_t *event, int node, long long eventTime)
void event_receive_packet_create (event_t *event, int node, long long eventTime, IncomingMsg *msg) __attribute__((C
void event_receive_packet_handle (event_t *event, struct TOS_state *state) __attribute__((C
void event_send_packet_done_create (event_t *event, int node, long long eventTime) __attribute__((C
void event_send_packet_done_handle (event_t *event, struct TOS_state *state) __attribute__((C
void packet_sim_init ()
result_t packet_sim_transmit (TOS_MsgPtr msg)

Variables

int byteTransmitTime = BYTE_TIME * 2
int initBackoffLow = 10 * BYTE_TIME
int initBackoffHigh = 20 * BYTE_TIME
int backoffLow = 10 * BYTE_TIME
int backoffHigh = 20 * BYTE_TIME
int txChangeLatency = 30 * BYTE_TIME
int preambleLength = 20
int headerLength = 7
TOS_MsgPtr packet_transmitting [TOSNODES]
IncomingMsgincoming [TOSNODES]
link_t * cc1000_connectivity [TOSNODES]
void spontaneous


Define Documentation

#define BIT_TIME   104

This is a drop-in replacement for TOSSIM's radio stack that operates at the packet, rather than the bit, level. In preliminary testing it performs about 100 times faster than the default bit-level radio stack. Obviously it does not capture the subtleties and behavior of the bit-level simulation, but, it is useful for testing and simulating large networks.

To use this code, all you need to do is add the line PFLAGS = -I/path/to/tinyos/broken/experimental/mdw/tossim to your application Makefile, then rebuild your application with 'make pc'.

This packet-level simulation is compatible with TOSSIM's lossy radio models, so if you are using "-r lossy" or setting link-level loss probabilities with TinyViz, it will work.

Philip Levis - pal@cs.berkeley.edu

Definition at line 54 of file packet_sim.c.

#define BYTE_TIME   (8 * BIT_TIME)

Definition at line 55 of file packet_sim.c.


Function Documentation

void event_backoff_create ( event_t *  event,
int  node,
long long  eventTime 
)

Definition at line 130 of file packet_sim.c.

void event_backoff_handle ( event_t *  event,
struct TOS_state state 
)

void event_receive_packet_create ( event_t *  event,
int  node,
long long  eventTime,
IncomingMsg msg 
)

void event_receive_packet_handle ( event_t *  event,
struct TOS_state state 
)

void event_send_packet_done_create ( event_t *  event,
int  node,
long long  eventTime 
)

void event_send_packet_done_handle ( event_t *  event,
struct TOS_state state 
)

void event_start_transmit_create ( event_t *  event,
int  node,
long long  eventTime 
)

void event_start_transmit_handle ( event_t *  event,
struct TOS_state state 
)

void initialBackoff (  ) 

Definition at line 115 of file packet_sim.c.

void packet_sim_init (  ) 

Definition at line 91 of file packet_sim.c.

result_t packet_sim_transmit ( TOS_MsgPtr  msg  ) 

Definition at line 106 of file packet_sim.c.


Variable Documentation

int backoffHigh = 20 * BYTE_TIME

Definition at line 61 of file packet_sim.c.

int backoffLow = 10 * BYTE_TIME

Definition at line 60 of file packet_sim.c.

int byteTransmitTime = BYTE_TIME * 2

Definition at line 57 of file packet_sim.c.

link_t* cc1000_connectivity[TOSNODES]

Definition at line 76 of file packet_sim.c.

int headerLength = 7

Definition at line 64 of file packet_sim.c.

IncomingMsg* incoming[TOSNODES]

Definition at line 75 of file packet_sim.c.

int initBackoffHigh = 20 * BYTE_TIME

Definition at line 59 of file packet_sim.c.

int initBackoffLow = 10 * BYTE_TIME

Definition at line 58 of file packet_sim.c.

TOS_MsgPtr packet_transmitting[TOSNODES]

Definition at line 74 of file packet_sim.c.

int preambleLength = 20

Definition at line 63 of file packet_sim.c.

Definition at line 80 of file packet_sim.c.

int txChangeLatency = 30 * BYTE_TIME

Definition at line 62 of file packet_sim.c.


© 2008, Los Alamos National Security, LLC.