Download presentation
Presentation is loading. Please wait.
1
Ad Hoc Networking using Flooding protocol
2
Flooding Protocol
3
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
4
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.
5
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.
6
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.
7
Flooding Protocol Lab.
8
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.
9
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; .. }
10
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; }
11
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.
12
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() {
13
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; }
14
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; }
15
TOSSIM Flooding Lab
16
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
17
TOSSIM : Flooding protocol Lab 2.
Host PC flooding compile
18
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.