Ad Hoc Networking using Flooding protocol
Flooding Protocol 2018-06-24
Wireless Multi-hop communication Delivery mechanism from a node to destination node which is unreachable. Using neighbors data can be forwarded to remote node route A->B->C->D 2018-06-24
Flooding protocol 1 Flooding protocol No specific path, all nodes are joined to forward data by broadcasting. Source node first broadcasts data to neighbors, neighbors received data again broadcast the data repeatedly. The packet eventually spread out like Flooding. 2018-06-24
Flooding protocol 2 Sequence number and TTL. It happens same packet broadcasting over and over (infinite loop) To avoid loop, packet is tagged with sequence number so that can prevent sending identical packet. By assign TTL(Time-To-Live) to each packet, if it is reached to threshold (predefined), then trash the packet. 2018-06-24
Flooding protocol 3 Flooding protocol limitation Identical packets receiving occurs . Performance depending on RF power (strength) Too many nodes are involved for delivery Even arrived to final destination, but still forwarding happens by other nodes. Short network life time due to high power consumption High probability of confliction. 2018-06-24
Flooding Protocol Lab. 2018-06-24
TempMon Program TempMon program TempMon Location TempMon program deliver temperature data every five second to the sink node (node 0) by a routing protocol. In TempMon program, user easily selects a routing protocol. TempMon Location Flooding protocol enabled TempMon locationc:\ Programfiles\UCB\cygwin\opt\tinyos‐1.x\contrib\zigbex\adhoc\flooding. 2018-06-24
TempMon.nc TempMon.nc Components TimerC Temp : temperature GenericComm : RF MHFloodingRouter : flooding … configuration TempMon {} implementation { components Main, TempMonM, TimerC, Temp, GenericComm as Comm, MHFloodingRouter as Router; Main.StdControl -> TempMonM.StdControl; Main.StdControl -> Router.StdControl; TempMonM.Send -> Router.Send[AM_TEMPMONMSG]; TempMonM.GlobalTime -> Router.GlobalTime; .. } 2018-06-24
MHFloodingRouter.nc MHFloodingRouter.nc MHFloodingPSM is used to packet handling for MHFloodingRouter component. includes MH; configuration MHFloodingRouter { … } implementation { components MHEngineM, MHFloodingPSM, GenericComm as Comm, QueuedSend, TimerC, SimpleTime, TimeSyncM, LedsC; … MHEngineM.RouteSelect -> MHFloodingPSM.RouteSelect; } 2018-06-24
MHFloodingPSM.nc MHFloodingPSM.nc (1) includes AM; includes MH; module MHFloodingPSM { provides { interface StdControl; interface RouteSelect; } } implementation { // ... static uint16_t getSeqNo() uint16_t temp = seqNo++; seqNo = seqNo % MAX_SEQ_NO; return temp; getSeqNo() : Sequence number assigned to packet. 2018-06-24
MHFloodingPSM.nc MHFloodingPSM.nc (2) // log ging void addLogEntry(uint16_t id, uint16_t seqno) {...} bool inLog(uint16_t id, uint16_t seqno) { ... } command result_t StdControl.init() { seqNo = 0; entries = 0; index = 0; return SUCCESS; } command result_t StdControl.start() { command result_t StdControl.stop() { 2018-06-24
MHFloodingPSM.nc MHFloodingPSM.nc (3) command result_t RouteSelect.selectRoute (msg, id) { MHMessage *pMHMsg = (MHMessage *) &msg->data[0]; if((pMHMsg->originNode==TOS_LOCAL_ADDRESS) && (pMHMsg->hopCount == 0)) { pMHMsg->seqNo = getSeqNo(); } else if (inLog(…->seqNo) == FALSE) { pMHMsg->sendingNode = TOS_LOCAL_ADDRESS; pMHMsg->hopCount++; } else{ ... return FAIL; } 2018-06-24
MHFloodingPSM.nc MHFloodingPSM.nc (4) if (TOS_LOCAL_ADDRESS == BASE_STATION_ADDRESS) { msg->addr = TOS_UART_ADDR; } else { msg->addr = TOS_BCAST_ADDR; } if (pMHMsg->hopCount < MAX_HOP_COUNT || msg->addr == TOS_UART_ADDR) { addLogEntry(…->originNode, …->seqNo); ... return SUCCESS; ... return FAIL; } 2018-06-24
TOSSIM Flooding Lab 2018-06-24
TOSSIM : Flooding protocol Lab 1. start cygwin and move to. To confirm by TOSSIM, type following command in cygwin build/pc/ main.exe – Running on Host PC cd /opt/tinyos‐1.x/contrib/zigbex/adhoc cd flooding make pc 2018-06-24
TOSSIM : Flooding protocol Lab 2. Host PC flooding compile 2018-06-24
TOSSIM Run Tinyviz Execute tinyviz to see TOSSIM as follows. User can check flooding by watching blinking LED /opt/tinyos-1.x/tools/java/net/tinyos/sim/tinyviz -run ./build/pc/main.exe 100 2018-06-24