I am assuming AODV protocol. In rtable.cc add below code
trust_entry::trust_entry()
{
//Initialize as per your need.
}
trust_entry::~trust_entry()
{
//Deconstruct as per your need.
}
trust_entry* trust_store::trust_lookup( nsaddr_t node_id)
{
trust_entry *rp = trusthead.lh_first;
for (; rp; rp = rp->trust_link.le_next) {
if (rp->node_id == node_id)
break;
}
return rp;
}
void trust_store::trust_delete( nsaddr_t node_id)
{
trust_entry *rp = trust_lookup(node_id);
if (rp)
{
LIST_REMOVE(rp, trust_link);
delete rp;
}
}
trust_entry*
trust_store::trust_insert( nsaddr_t node_id, nsaddr_t prev_node,nsaddr_t next_node,int32_t trust_value)
{
trust_entry *rp;
//assert(tr_lookup(dst_seq_no) == 0);
rp = new trust_entry;
assert(rp);
rp->node_id = node_id;
rp->prev_node = prev_node;
rp->next_node = next_node;
rp->trust_value = trust_value;
LIST_INSERT_HEAD(&trusthead, rp, trust_link);
return rp;
}
trust_entry* trust_store::trust_update( nsaddr_t node_id,nsaddr_t prev_node,nsaddr_t next_node, int32_t trust_value)
{ trust_delete(node_id);
trust_insert(node_id,prev_ node,next_node,trust_value);
}
In rtable.h add below codetrust_entry::trust_entry()
{
//Initialize as per your need.
}
trust_entry::~trust_entry()
{
//Deconstruct as per your need.
}
trust_entry* trust_store::trust_lookup(
{
trust_entry *rp = trusthead.lh_first;
for (; rp; rp = rp->trust_link.le_next) {
if (rp->node_id == node_id)
break;
}
return rp;
}
void trust_store::trust_delete(
{
trust_entry *rp = trust_lookup(node_id);
if (rp)
{
LIST_REMOVE(rp, trust_link);
delete rp;
}
}
trust_entry*
trust_store::trust_insert(
{
trust_entry *rp;
//assert(tr_lookup(dst_seq_no) == 0);
rp = new trust_entry;
assert(rp);
rp->node_id = node_id;
rp->prev_node = prev_node;
rp->next_node = next_node;
rp->trust_value = trust_value;
LIST_INSERT_HEAD(&trusthead, rp, trust_link);
return rp;
}
trust_entry* trust_store::trust_update(
{ trust_delete(node_id);
trust_insert(node_id,prev_
}
class trust_entry
{
friend class AODV;
friend class trust_store;
public:
trust_entry();
~trust_entry();
nsaddr_t node_id;
nsaddr_t prev_node;
nsaddr_t next_node;
int32_t trust_value;
protected:
LIST_ENTRY(trust_entry) trust_link;
};
class trust_store
{
public:
trust_store()
{
LIST_INIT(&trusthead);
}
trust_entry* head()
{
return trusthead.lh_first;
}
trust_entry* trust_insert(nsaddr_t node_id,nsaddr_t prev_node,nsaddr_t next_node,int32_t trust_value);
trust_entry* trust_lookup(nsaddr_t node_id);
void trust_delete(nsaddr_t node_id);
trust_entry* trust_update(nsaddr_t node_id,nsaddr_t prev_node,nsaddr_t next_node, int32_t trust_value);
private:
LIST_HEAD(trust_head, trust_entry) trusthead;
};
trust_store tstore;
Already its perfect but still if you had provided the screenshot of the output, it's likely to add advantage.
ReplyDeletePlease can you help me How to detect misbehaving/selfish node and ignore it from network.
ReplyDeleteHi! Durgesh, its a good work from u.
ReplyDeleteCan u please mail me some useful codes of ns2 related to trust model. I'm doing my project on trust model in WSN.
So it'll be a great help from U...
Thanks in advance
With Regards,
SUNIL M R
email: sungowda2008@gmail.com
Sir did you find anything?
Deletehow can i add new table for AODV to store Node ID and Dest. Seq. # of multiple RREPs????
ReplyDeletehow can i store RREQ for some time of interval at destination node in AODV routing protocol?
ReplyDeletehi did u got some clue how to do that becoz i too need to do the same .....
DeleteHas anyone implemented Trust aware routing framework (TARF) or Reputation based framework for sensor networks (RFSN) in NS2?
ReplyDeleteCan u please mail me code of aodv modified with watchdog in ns2
ReplyDeleteSo it'll be a great help from U...
Please can you help me How to detect black hole node and ignore it from network.
ReplyDeletePlease can you help me How to detect black hole node and ignore it from network.
ReplyDeleteif possible pls email me on krish05051990@gmail.com
hello! how to link trust table with nodes?? what changes i have to do?? in trace file i need those trust values.. how to add it??
ReplyDeletei add this code in ns2.35 but get error in .cc file trust_store::trust_insert(nsaddr_t node_id, nsaddr_t prev_node,nsaddr_t next_node,int32_t trust_value) missing & and ?
ReplyDeletei am facing the same problem have u solve this problem
DeleteHI Durgesh, Pls let me knw how to generate Ddos Attack using NS2. mail it to gautamjprakash@gmail.com
ReplyDeleteyou have to do ur project sir
ReplyDeletehi durgesh, pls send me a code for path recomputing with few parameters in OLSR protocol based on TRUST in MANET using NS2. mail it to veeracharm@gmail.com
ReplyDeletepls send me a code for path recomputing with few parameters in AODV protocol based on TRUST in MANET using NS2. mail it to veeracharm@gmail.com
ReplyDeletecan u send me code for trust value calculation based on node behavior.........
ReplyDeleteaodv/aodv.cc:1415:1: error: ‘tstore’ does not name a type
ReplyDeletetstore.trust_insert(node_id,prev_node,next_node,trust_value); i am geeting this error when i add last code in adov.cc file...... pls help me soon...... its urgent....... and also tell how to print the trust table.......
aodv/aodv.cc:1415:1: error: ‘tstore’ does not name a type
ReplyDeletetstore.trust_insert(node_id,prev_node,next_node,trust_value); pls help ne to solve this problem
Please can you help me How can create Blacklist in ns2.35 for AODV.
ReplyDeleteI am a student and I work in the final my project. So if you do not have mind please help me. Thanks in advance...
fawazalghfari@gmail.com
this error has occured to me,invalid command name "trust_entry::trust_entry()"
ReplyDeletewhile execinvalid command name "trust_entry::trust_entry()"
while executing
"trust_entry::trust_entry()"
(file "rtable.cc" line 1)
invoked from within
"source.orig rtable.cc"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source rtable.cc"
(file "aodvattacker.tcl" line 61)uting
"trust_entry::trust_entry()"
(file "rtable.cc" line 1)
invoked from within
"source.orig rtable.cc"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source rtable.cc"
(file "aodvattacker.tcl" line 61)
were to use this rtable.cc,rtable.h in linux ns2 code
sir i ma working in aodv routing aodv .cc and aodv.h can be modified after make comand is get error make:****no target specified make stop.
ReplyDeletemake clean
make:****no target specified make stop.
make depend
make:****no target specified make depend stop.
make sudo install
make:****no target specified make sudo stop.
how to solve thsis error
This comment has been removed by the author.
Deletecd installing ns-2.35 /ns-2.35 then execute make
Deletei need a code for trust value for sinkhole nodes in manet please mail me
ReplyDeletemail id: ajothimani05@gmail.com
hello sir how to link trust table with nodes?? what changes i have to do?? in trace file i need those trust values.. how to add it??
ReplyDeleteplease mail me the trust based aodv in ns2 for sinkhole nodes sir please help me sir
ReplyDeletedrop me a mail at durgeshpkshirsagar@gmail.com
DeleteI am working on trust and energy aware routing protocol.. Please, Help me sir. I want code for this trust based aodv.
ReplyDeletesir how to initialise i am a beginner pls help
ReplyDeletesir pls provide me code for round trip time calculation and trust value of node
ReplyDeleteemail - tejashreephatak786@gmail.com
Hi,
ReplyDeletehow to add node trust certificate in ns2? i need to have node authentication for my simulation..and need to generate certificate for each node with some parameters.
Dear sir,
ReplyDeletecan you sand me all the file in which you have done all changes for implementation of trust based AODV.
please it's really very urgent.
thanks in advance!!
my mail id: itssubhashsingh@gmail.com
How are you?
ReplyDeletecan you send me all the file in which you have done all changes for implementation of trust based AODV?
My mail id is klaudiadiah@gmail.com
sir i m working on sybil attack can u help me how to create a sybil node in ns2 and how to detect and prevent it. u can email me at waqasjunaid1@gmail.com
ReplyDeleteSir can u please help me how to avoid black hole attack in ns2
ReplyDeletesir can u pls send me ccode for trust calculation in ns-2.35.urgent pls.....mail me at shyamalajinju@gmail.com
ReplyDeletehello,
ReplyDeletei use all the steps mentioned above but i am getting Segmentation fault (core dumped) error. Can any one tell me the solution
if someone have proper code then lease mail me at anaccna@gmail.com
Deletetstore.trust_insert(node_id,prev_node,next_node,trust_value);
ReplyDeletehow to give values of node_id, prev_node,next_node nad trust_value? please help me
my mail id is gethzi.akila@gmail.com
ReplyDeleteI wanted to implement Black Hole Attack Prevention Method Using
ReplyDeleteDynamic Threshold in Mobile Ad Hoc Networks, can someone help me with its AODV NS2 Codes. my email is christopher1ermwaka@gmail.com
Otemprama_ke Chelsea Clark https://marketplace.visualstudio.com/items?itemName=7naphtmencepyo.Descargar-Bunny-s-Flowers-gratuita
ReplyDeletetricodelen