[Ns-developers] aodv extension - new header problem
vincent.nauwelaers at student.kuleuven.ac.be
Thu Apr 20 07:36:27 PDT 2006
The only reason known to me, because I just experienced it today,
is that the packet is freed (Packet::free(pkt)).
If you read values after freeing it, the result will give all zeros.
Follow the packet through all the code.
I hope this is, what you did wrong.
greetings from Belgium !
----- Original Message -----
From: "Cenker Demir" <cdemir at stevens.edu>
To: <ns-developers at ISI.EDU>
Sent: Tuesday, April 18, 2006 4:09 PM
Subject: Re: [Ns-developers] aodv extension - new header problem
> Hello Vincent, thank you for your reply.
> What I did was; I added a header to aodv_a (i named the extended
> version aodv as aodv_a) a packet header, in aodv_a_packet.h:
> #define HDR_AODV_A_PAYMENT(P) ((struct
> and I also put the struct for my new header in the same file
> Than, in aodv_a.cc, I used this header putting a metric value in it.
> My problem is;
> when recv(Packet *p, Handler*) function in aodv_a.cc calls
> rt_resolve(Packet *p) function to find a route for the packet,
> rt_resolve(Packet *p) checks if there is a known route for the packet.
> If there is not, then it puts the packet into its queue by calling
> Then, as soon as the node gets a route reply for this packet's
> destination, it dequeues all the packets to this destination by calling
> rqueue.deque(rt->rt_dst). Then it calls the forward function, which is:
> AODV_A::forward(aodv_a_rt_entry *rt, Packet *p, double delay). Then,
> all these packets are scheduled.
> My question is: when I change my payment header's value in
> rt_resolve(Packet *p) and call the forward function, the value is still
> there. However, when I change the value in recvReply(), after dequeuing
> the packet, the value in my header becomes 0.
> I can get the info for my metric (payment value) only after getting
> route replies, so there is no way for me to set the value in
> rt_resolve(Packet *p) when I do not have a route. So, I have to set my
> value in recvReply(), after the packets are dequeued.
> I will really appreciate if anyone has an idea...
> Best regards
> Vincent Nauwelaers wrote:
> >to me it already is unclear what the forward function is,
> >I suspect a function of the AODV Agent, please specify
> >your question with relevant code. Maybe some default values
> >are used ...
> >good luck
> >----- Original Message -----
> >From: "Cenker Demir" <cdemir at stevens.edu>
> >To: <ns-developers at ISI.EDU>
> >Sent: Monday, April 17, 2006 8:30 PM
> >Subject: [Ns-developers] aodv extension - new header problem
> >> Dear ns developers,
> >> I am trying to write an extension code which uses aodv - with
> >> In order to do that, I added a new header type to other aodv header
> >> types. However, I use this header with data packets cbr/udp, and I put
> >> the header into data packets. The problem that I experienced is; when
> >> change a value in this new header in -for instance- recvReply function
> >> to something non-zero, the value becomes "0" when forward function
> >> receives the packet.
> >> I sent the question to ns-users first, after looking for the answer in
> >> ns-archive, however could not get any response. Then I thought someone
> >> maybe able to answer the question in ns-developers list. I will really
> >> appreciate if anyone answers my question.
> >> Best regards
> >> Cenker
More information about the Ns-developers