Asymmetric Detection

Download Report

Transcript Asymmetric Detection

Symmetric
Detection
Overview
• In this phase, each mote will
maintain a neighbor table.
• It provide a command bool
isSymmetric(uint16_t neighborID)
for the backbone creation phase .
• The judgment is based on the
statistic.
Overview
• Provides interface
– SDNeighborTable
– StdControl
• Used components
– SDM
– RoutingC
– RandomLFSR
– TimerC
– TinyAlloc
Data Structure
sendId
2
size Data
1
18
Every neighborID occupies 2 bytes, so one packet
can accommodate 18/2=9 neighborID
MAX_NEIGHBOR = 40
Totally we need 5 packets at most.
MAX_SD_BUFFER_SIZE = (MAX_NEIGHBOR+5)/10,
Shall we use MAX_NEIGHBOR/9+1?
Or shall we change the
SD_PAYLOAD_SIZE
= 18 ?
Data Structure
typedef struct{
uint16_t neighborID[MAX_NEIGHBOR];
uint8_t symmChannel[MAX_NEIGHBOR];
uint8_t asymmChannel[MAX_NEIGHBOR];
uint8_t noChannel[MAX_NEIGHBOR];
uint8_t currStatus[MAX_NEIGHBOR];
/* 0------noChannel
1------asymmChannel
2------symmeChannel
*/
uint8_t aliveLastTime[MAX_NEIGHBOR];
} NEIGHBOR_TABLE;
Note: neighborID[0..MAX_NEIGHBOR] is initialed to be 0xffff
Workflow
Scan the neighbor table
Generate packets to be send
Start a new Timer
Check
Neighbor
table
Check
Neighbor
table
Send
Packet
Interval of T1:SEND_BEACON_PERIOD
Interval of T2:(Random.rand()) % (SEND_BEACON_PERIOD/global_size)
Workflow
• How about the last packet in the T1
interval
• If the process to generate packets is
too long or due to other delay, then
the last packet will be lost.
• Guarantee that
SEND_BEACON_PERIOD/global_size
- beacon_delay > 640
Rules
• checkNT() will examine the previous
round status and update the statistical
value.
• Once a mote receive a packet, it examine
the sendID first, then examine the string of
neighbor ID to judge whether it is
symmetric in previous round.
• If a node does not receive a packet from a
certain node in a round &&nodeId is in the
neighbortable-> no channel in this round.
Overflow
checkNT
Syn[0]=1
Neighbor[0]=11
Node 10
Node 11
Cur[0]=asy
Cur[0]=sym
Cur[0]=asy
Cur[0]=sym
checkNT
Syn[0]=1
noChan[0]=1
Cur[0]=noChan
Cur[0]=sym
checkNT
Syn[0]=1
noChan[0]=2
Cur[0]=noChan
Cur[0]=asy
Neighbor[0]=10
checkNT
Syn[0]=1
checkNT
Syn[0]=2
checkNT
Syn[0]=2
Ayn[0]=1
Parameters
• SEND_BEACON_PERIOD
– Interval for T1
• CHECKNT_WAIT_TIMES
– In which round it starts to do checkNT()
• global_threshold
– numSymm /(numAsymm + numSymm
+ numNone) >= (global_threshold/100)
• Also, the system should carefully the
number of round to detect symmetric
Parameters
checkNT
Syn[0]=1
Neighbor[0]=11
Node 10
Node 11
Cur[0]=asy
Cur[0]=sym
Cur[0]=asy
Cur[0]=sym
checkNT
Syn[0]=1
noChan[0]=1
Cur[0]=noChan
Cur[0]=sym
checkNT
Syn[0]=1
noChan[0]=2
Cur[0]=noChan
Cur[0]=asy
Neighbor[0]=10
checkNT
Syn[0]=1
checkNT
Syn[0]=2
checkNT
Syn[0]=2
Ayn[0]=1
If the motes are fully synchronized ,then the third time it could do checkNT()
•
If motes are not fully synchronized, then forth timer is the best time to
start do checkNT().
• Neighbor table: 7byte*MAX_NEIGHBOR
• MAX_SD_BUFFER_SIZE*sizeof(TOS_Msg))
• If we do not plan to do the judgment on
multiple rounds. Then we do not need to
have
uint8_t
symmChannel[MAX_NEIGHBOR];
uint8_t
uint8_t
uint8_t
asymmChannel[MAX_NEIGHBOR];
noChannel[MAX_NEIGHBOR];
aliveLastTime[MAX_NEIGHBOR];