Course Solutions Uncategorized (Solved) : Flooding Node Floods Packet Neighbor Nodes Packets Continue Flood Reaches S Final Destinat Q31101780 . . . .

(Solved) : Flooding Node Floods Packet Neighbor Nodes Packets Continue Flood Reaches S Final Destinat Q31101780 . . . .

 

Flooding:

Each node floods a packet to all it neighbornodes.

These packets continue to flood until it reaches it’sfinal destination.

Must work as pings and ping replies.

Only use information accessible from the packet and it’sheaders.

CODE:

Node.nc

#include <Timer.h>

#include “includes/command.h”

#include “includes/packet.h”

#include “includes/CommandMsg.h”

#include “includes/sendInfo.h”

#include “includes/channels.h”

module Node{

uses interface Boot;

uses interface SplitControl as AMControl;

uses interface Receive;

uses interface SimpleSend as Sender;

uses interface CommandHandler;

}

implementation{

pack sendPackage;

// Prototypes

void makePack(pack *Package, uint16_t src, uint16_t dest,uint16_t TTL, uint16_t Protocol, uint16_t seq, uint8_t *payload,uint8_t length);

event void Boot.booted(){

call AMControl.start();

dbg(GENERAL_CHANNEL, “Bootedn”);

}

event void AMControl.startDone(error_t err){

if(err == SUCCESS){

dbg(GENERAL_CHANNEL, “Radio Onn”);

}else{

//Retry until successful

call AMControl.start();

}

}

event void AMControl.stopDone(error_t err){}

event message_t* Receive.receive(message_t* msg, void* payload,uint8_t len){

dbg(GENERAL_CHANNEL, “Packet Receivedn”);

if(len==sizeof(pack)){

pack* myMsg=(pack*) payload;

dbg(GENERAL_CHANNEL, “Package Payload: %sn”,myMsg->payload);

return msg;

}

dbg(GENERAL_CHANNEL,

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post