LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-08-2012, 03:46 AM   #1
avinash20
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Rep: Reputation: Disabled
problem in modifying cmu-trace.cc file in ns2.34


hi everybody im implementing grayhole in ns2.34 in red hat linux 5 i have performed all the steps of modifying different files of ns2.34 but i dont know how to modify the cmu-trace.cc file please somebody help me its urgent
 
Old 09-08-2012, 08:35 PM   #2
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora, Arch
Posts: 568

Rep: Reputation: 64
Quote:
Originally Posted by avinash20 View Post
hi everybody im implementing grayhole in ns2.34 in red hat linux 5 i have performed all the steps of modifying different files of ns2.34 but i dont know how to modify the cmu-trace.cc file please somebody help me its urgent
Ah! You didn't give us many hints, but I found cmu-trace.cc.

Now, what do you want to modify it to do? And why the urgency? And what the heck is grayhole?
 
Old 09-09-2012, 02:55 AM   #3
avinash20
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
@KenJackson
thanks sir for paying attention grayhole is a type of attack in routing done by some malicious node, by modifying cmu-trace.cc i mean that like for aodv in cmu-trace.cc there is script like

void
858 CMUTrace::format_aodv(Packet *p, int offset)
859 {
860 struct hdr_aodv *ah = HDR_AODV(p);
861 struct hdr_aodv_request *rq = HDR_AODV_REQUEST(p);
862 struct hdr_aodv_reply *rp = HDR_AODV_REPLY(p);
863
864
865 switch(ah->ah_type) {
866 case AODVTYPE_RREQ:
867
868 if (pt_->tagged()) {
869 sprintf(pt_->buffer() + offset,
870 "-aodv:t %x -aodv:h %d -aodv:b %d -aodv:d %d "
871 "-aodv:ds %d -aodv:s %d -aodv:ss %d "
872 "-aodv:c REQUEST ",
873 rq->rq_type,
874 rq->rq_hop_count,
875 rq->rq_bcast_id,
876 rq->rq_dst,
877 rq->rq_dst_seqno,
878 rq->rq_src,
879 rq->rq_src_seqno);
880 } else if (newtrace_) {
881
882 sprintf(pt_->buffer() + offset,
883 "-P aodv -Pt 0x%x -Ph %d -Pb %d -Pd %d -Pds %d -Ps %d -Pss %d -Pc REQUEST ",
884 rq->rq_type,
885 rq->rq_hop_count,
886 rq->rq_bcast_id,
887 rq->rq_dst,
888 rq->rq_dst_seqno,
889 rq->rq_src,
890 rq->rq_src_seqno);
891
892
893 } else {
894
895 sprintf(pt_->buffer() + offset,
896 "[0x%x %d %d [%d %d] [%d %d]] (REQUEST)",
897 rq->rq_type,
898 rq->rq_hop_count,
899 rq->rq_bcast_id,
900 rq->rq_dst,
901 rq->rq_dst_seqno,
902 rq->rq_src,
903 rq->rq_src_seqno);
904 }
905 break;
906
907 case AODVTYPE_RREP:
908 case AODVTYPE_HELLO:
909 case AODVTYPE_RERR:
910
911 if (pt_->tagged()) {
912 sprintf(pt_->buffer() + offset,
913 "-aodv:t %x -aodv:h %d -aodv:d %d -adov:ds %d "
914 "-aodv:l %f -aodv:c %s ",
915 rp->rp_type,
916 rp->rp_hop_count,
917 rp->rp_dst,
918 rp->rp_dst_seqno,
919 rp->rp_lifetime,
920 rp->rp_type == AODVTYPE_RREP ? "REPLY" :
921 (rp->rp_type == AODVTYPE_RERR ? "ERROR" :
922 "HELLO"));
923 } else if (newtrace_) {
924
925 sprintf(pt_->buffer() + offset,
926 "-P aodv -Pt 0x%x -Ph %d -Pd %d -Pds %d -Pl %f -Pc %s ",
927 rp->rp_type,
928 rp->rp_hop_count,
929 rp->rp_dst,
930 rp->rp_dst_seqno,
931 rp->rp_lifetime,
932 rp->rp_type == AODVTYPE_RREP ? "REPLY" :
933 (rp->rp_type == AODVTYPE_RERR ? "ERROR" :
934 "HELLO"));
935 } else {
936
937 sprintf(pt_->buffer() + offset,
938 "[0x%x %d [%d %d] %f] (%s)",
939 rp->rp_type,
940 rp->rp_hop_count,
941 rp->rp_dst,
942 rp->rp_dst_seqno,
943 rp->rp_lifetime,
944 rp->rp_type == AODVTYPE_RREP ? "REPLY" :
945 (rp->rp_type == AODVTYPE_RERR ? "ERROR" :
946 "HELLO"));
947 }
948 break;
949
950 default:
951 #ifdef WIN32
952 fprintf(stderr,
953 "CMUTrace::format_aodv: invalid AODV packet type\n");
954 #else
955 fprintf(stderr,
956 "%s: invalid AODV packet type\n", __FUNCTION__);
957 #endif
958 abort();
959 }
960 }
961
962 // AOMDV patch
963 void

like above i have also to add script for grayhole attack in cmutrace
 
Old 09-12-2012, 06:06 AM   #4
avinash20
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
invalid command name "Agent/Antnet"

hi every one i got this error while run tcl of antnet algo in ns2.34 red hat linux 5

invalid command name "Agent/Antnet"
while executing
"Agent/Antnet create _o139 0"
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new Agent/Antnet $i"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $sz} {incr i} {
set nn($i) [ new Agent/Antnet $i]
}"
(file "ring.tcl" line 30)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sir, While installing ns2.34 on fedora 16 got the error : trace/cmu-trace.cc 1327:22 jeevanpinto Linux - Newbie 2 06-28-2012 03:35 AM
NS2 trace file raji27 Linux - Wireless Networking 2 10-14-2011 01:00 AM
ns2 trace file Stanley33 Programming 1 03-02-2011 08:31 AM
problem in traffic trace file genration(VBR) in ns2.34 sanviarch Linux - Networking 4 09-15-2010 01:16 PM


All times are GMT -5. The time now is 11:42 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration