LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   error: format_rtaodv: invalid RTAODV packet type (https://www.linuxquestions.org/questions/linux-software-2/error-format_rtaodv-invalid-rtaodv-packet-type-4175528097/)

mary1001 12-12-2014 11:49 AM

error: format_rtaodv: invalid RTAODV packet type
 
hi
i add a new routing protocol like aodv and called it: rtaodv
now i write a tcl script to run this routing protocol but i have this error :

me@HP-PC ~/Desktop/ns-allinone-2.35/ns-2.35/tcl/ex $ ns sm2.tcl
num_nodes is set 27
INITIALIZE THE LIST xListHead
Starting Simulation...
format_rtaodv: invalid RTAODV packet type


can any one help me please ?!!!!

knudfl 12-12-2014 02:10 PM

New functions, packet types, etc. can be added to :
ns-2.35/tcl/{ files.tcl }.

When added, and compiled into a new executable 'ns',
the new "words" can be used in a `simulation.tcl' file.

? May be your "RTAODV packet" should be added to ns-packet.tcl ?

-

mary1001 12-15-2014 12:47 AM

i had checked anythig that you said but i still have this problem ...!!!

knudfl 12-15-2014 02:41 AM

← #3 .
Quote:

I had checked anything
May be your new protocol can be compared to AODV ?
This is where you have the AODV code :
ns-2.35/aodv/{ aodv.cc, aodv.h, aodv_packet.h, aodv_rqueue.cc, aodv_rtable.cc }
ns-2.35/aomdv/{ aomdv.cc, aomdv_logs.cc }
ns-2.35/common/packet.h
ns-2.35/queue/{ dsr-priqueue.cc, priqueue.cc, rtqueue.cc }
ns-2.35/routing/{ rttable.cc, rttable.h }
ns-2.35/tcl/lib/{ ns-agent.tcl, ns-lib.tcl, ns-mobilenode.tcl, ns-packet.tcl }
ns-2.35/trace/{ cmu-trace.cc, cmu-trace.h }

-

mary1001 12-19-2014 01:59 PM

hi
i detected that my problem was NULL in ah header packet type. in this location:

} (RTAODV::recvAODV(Packet *p
; (struct hdr_rtaodv *ah = HDR_RTAODV(p
.
.
.
;(if(ah->ah_type!=NULL) printf("ah in rtaodv %x", ah->ah_type
;(else printf("ah in rtaodv is null \n
}(switch(ah->ah_type

case RTAODVTYPE_RREQ:
recvRequest(p);
break;

IN cmu_trace.cc


void
CMUTrace::format_rtaodv(Packet *p, int offset)
{
struct hdr_rtaodv *ah = HDR_RTAODV(p);
.
.
.
;("if (ah->ah_type==NULL) printf("\n ah is null \n
;(else printf("ah_type == %x" , ah->ah_type

switch(ah->ah_type) {
case RTAODVTYPE_RREQ:
.
.


i add fprint command there to undrestand that ah_type is NULL or not. yes ah_type was NULL.
now what should i do. i checked every things....
the erroe is :

me@HP-PC ~/e $ ns sm3.tcl
num_nodes is set 4
INITIALIZE THE LIST xListHead
Starting Simulation...

ah is null
format_rtaodv: invalid RTAODV packet type


All times are GMT -5. The time now is 09:26 AM.