HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossiping Protocol
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossiping Protocol Introduction
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossiping Protocol Introduction Gossiping Concept –Gossiping uses probabilistic packet delivery rather than flooding involves too many nodes to forward. –Gossiping uses hello msg as an advertising packet to figure out how many one-hop neighbor exists. –Select one node among neighbors and send data to the node in uni-cast manner.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossping Protocol Introduction Gossiping problem –Gossiping selects randomly a neighbor which may not be efficient. –There are some failed delivery as shown in following figure.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossping Vs Flooding Gossiping & Flooding Comparison –Packet delivery ratio of Gossiping is low. –Gossiping is more efficient in energy conservation
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossiping Protocol Lab
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 TempMon Program –TempMon program deliver temperature data every 5 second to the sink node (node 0) by a routing protocol. –In TempMon program, user easily selects a routing protocol. –TempMon configuration is for selecting Routing algorithm (Gossiping). TempMon location for Gossiping – c:\Programfiles\UCB\cygwin\opt\tinyos ‐ 1.x\contrib\zigbex\adhoc \gossiping
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 TempMon.nc –Components TimerC Temp : temperature GenericComm : RF MHGossipingRouter : routing … configuration TempMon {} implementation { components Main, TempMonM, TimerC, Temp, GenericComm as Comm, MHGossipingRouter as Router ; Main.StdControl -> TempMonM.StdControl; Main.StdControl -> Router.StdControl; … TempMonM.Send -> Router.Send[AM_TEMPMONMSG]; TempMonM.GlobalTime -> Router.GlobalTime;.. }
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 MHGossipingRouter.nc –MHFloodingPSM is used to packet handling for MHFloodingRouter component. –. includes MH; configuration MHGossipingRouter { … } implementation { components MHEngineM, MHGossipingPSM, GenericComm as Comm, QueuedSend, TimerC, SimpleTime, TimeSyncM, LedsC; … MHEngineM.RouteSelect -> MHGossipingPSM.RouteSelect; … }
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 MHGossipingRouter.nc MHGossipingPSM.nc (1) includes AM; includes MH; module MHGossipingPSM { provides { interface StdControl; interface RouteSelect; } } implementation { //... // neighbor management static void updateTableEntry ( … ) {... } task void updateTable() {... }
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 MHGossipingRouter.nc MHGossipingPSM.nc (2) task void advertise() {... call SendMsg.send(TOS_BCAST_ADDR, … ) … } command result_t StdControl.init() { … call Random.init(); return SUCCESS; } command result_t StdControl.start() { return call Timer.start (TIMER_REPEAT, ROUTE_UPDATE_RATE); } command result_t StdControl.stop() { return call Timer.stop(); } advertise packet
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 MHGossipingRouter.nc MHGossipingPSM.nc (3) command result_t RouteSelect.selectRoute (msg, id) { … if (pMHMsg->sendingNode != TOS_LOCAL_ADDRESS ) { pMHMsg->sendingNode = TOS_LOCAL_ADDRESS ; pMHMsg->hopCount++; } if ( TOS_LOCAL_ADDRESS == BASE_STATION_ADDRESS ) { msg->addr = TOS_UART_ADDR; }
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 MHGossipingRouter.nc MHGossipingPSM.nc (4) else if (entries > 0) { uint16_t num = call Random.rand() % entries; int i; for (i = 0; i < entries; i++) { if (neighbourTable[num].nodeAlive == TRUE){ msg->addr = neighbourTable[num].nodeID; break; } else { num++; num = num % entries; } … if (pMHMsg->hopCount < MAX_HOP_COUNT … ) {... return SUCCESS; }... return FAIL; } rand() –select a node in neighbor table. Check TTL
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 MHGossipingRouter.nc MHGossipingPSM.nc (5) command result_t RouteSelect.initializeFields ( … ) { … } event result_t Timer.fired() { post updateTable(); post advertise(); return SUCCESS; } event TOS_MsgPtr ReceiveMsg.receive ( … ) { … }
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 TOSSIM Gossiping Lab
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 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 gossiping make pc
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 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