README~
上传用户:joranyuan
上传日期:2022-06-23
资源大小:3306k
文件大小:3k
- Notes on Z-MAC implementation:
- Z-MAC works in two phases (for full description, please see the Z-MAC
- paper) - a) DRAND slot assignment
- b) Data Transmission
- DRAND
- -----
- The code for DRAND slot assignment is located in tos/system/Drand*
- Currently, it has the following limitations which can be changed
- in the file DrandMSG.h:
- - DRAND contains tables for neighbor information. The
- size of these tables can be controlled statically by changing the following
- variables:
- enum {
- MAX_NBR = 20,
- MAX_ONE_HOP = 15
- };
- MAX_NBR is the total number of one+two hop neighbors
- MAX_ONE_HOP is the total number of one hop neighbors
- This has an effect on the code size and the packet size.
- These values were chosen for our testbed, and hence we had to use a default
- packet size of 70 bytes (in tos/types.h):
- #ifndef TOSH_DATA_LENGTH
- #define TOSH_DATA_LENGTH 70
- #endif
- This could have an effect when using UART_MSG, since it expects a default
- packet size of 29 bytes. We used SODbg so we did not face any problems.
- - The time for DRAND completion is a function of the network density.
- As a thumb rule, in a network with about 20 one/two hop neighbors, DRAND
- completes in about 2-3 minutes. This has to be kept in mind while testing
- on your testbed.
- The time allocated for each phase in DRAND is as follows:
- enum {
- HELLO_PERIOD = 30000L,
- HELLO_INTERVAL = 500,
- GRANT_INTERVAL = 100,
- REPORT_INTERVAL = 100,
- REPORT_XPERIOD = 1000,
- FRAME_INTERVAL = 100,
- FRAME_XPERIOD = 1000,
- DRAND_PERIOD = 120000L,
- REPORT_PERIOD = 30000L,
- };
- HELLO_PERIOD = 30000L --> total time for neighbor discovery = 30s
- HELLO_INTERVAL = 500 --> time between two neighbor discovery 'beacons'
- GRANT_INTERVAL = 100
- REPORT_INTERVAL = 100
- REPORT_XPERIOD = 1000
- FRAME_INTERVAL = 100
- FRAME_XPERIOD = 1000
- (above) time for various phases within DRAND, this should probably not be changed.
- DRAND_PERIOD = 120000L --> total time allocated for DRAND = 120s or two minutes
- REPORT_PERIOD = 30000L --> time after DRAND for slot/frame dissemination = 30s
- These time values can be used as-is for medium sized networks. Hence, data
- transmission should start only after:
- HELLO_PERIOD + DRAND_PERIOD + REPORT_PERIOD + 30s
- The final 30s is for a phase called 'FRAME PHASE' where the local
- frame size is disseminated.
- A simple application for testig DRAND alone can be found in apps/TestBedTopology. Please
- see the README inside the directory for further instructions.
- Z-MAC
- -----
- - Z-MAC has been implemented on top of B-MAC. The only files changed are:
- tos/platform/mica2/CC1000RadioIntM.nc --> real implementation code
- tos/platform/mica2/CC1000RAdioC.nc --> component connectivity
- additional files for system parameters are in:
- tos/platform/mica2/zmaConst.h --> contains To/Tno parameters, which you might like to vary
- tos/platform/mica2/zmacInfo.h --> contains ecn/time sync message structures
- In case you need to run B-MAC, the original files are present in:
- tos/platform/mica2/orig
- - Z-MAC needs the neighbor slot information provided by DRAND. This information can
- be input in two ways:
- - invoke DRAND every time at initialization (normal operation)
- - invoke DRAND once, get the neighbor table, and input it statically (testing)
- Both modes of operation are supported.
- For details on running Z-MAC, we have included a MultiHop application,
- apps/MultiHopThroughput. Please see the README in that directory.