This tar ball contains an ad hoc implementation of the MAC Layer. It includes the following: 1) TOS3 environment the MAC layer is based on. 2) MAC layer code: MACPacketObj.c MACPacketObj.h MACDefines.h 3) An emulator used to gather results and debug the MAC protocol FSM. The emulator files are: macsim.c macsim.h motemain.c motemain.h bsmain.c bsmain.h Makefile.fullpc How to Make ----------- To make the emulator, simply type "make -f Makefile.fullpc". The executable is called "macsim". How to Run the Emulator ----------------------- Type "macsim [space config file] [time config file] [simulation endtime]" at prompt. Space config file defines the number of motes or base stations, reachibility table, bit error rate (BER) and time to start collecting data (start). A sample space config file is below: num_motes: 3 num_bs: 0 scenario: expbf.sink2.ber1.120ms.full start: 650000 BER: 10000 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1 "scenario" is simple a string for the emulator to create output files for. The reachibility table is a matrix where mote N can hear mote M if there is a 1 at row N and column M. The communication is not assumed to be symmetric (i.e. mote M cannot hear mote N if there is no 1 at row M, col N). Time config file defines the period, id, starting time of the motes/base station and destination ID. A sample file is shown below: 0: none 1: 20, 700, 0 2: 20, 700, 0 3: 20, 700, 0 4: 20, 700, 0 5: 20, 600, 0 6: 20, 7000, 0 7: 20, 7000, 0 8: 20, 7000, 0 9: 20, 7000, 0 10: 20, 7000, 0 11: 20, 7000, 0 12: 20, 7000, 0 In this example, mote0 is not sending any packet and it acts as a sink node for all other motes (i.e. all other motes has mote0 as destination). The first column is mote ID. Second column is when motes should start sending data (in this case, at 20th bit time). The third column is the period between packets (in bit times). Simluation endtime defines the time (in bit time) to stop simulation.