LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Number of hops along a route using AODV protocol in ns2.35 (https://www.linuxquestions.org/questions/linux-newbie-8/number-of-hops-along-a-route-using-aodv-protocol-in-ns2-35-a-4175573635/)

sarkardipikacse 03-01-2016 05:16 AM

Number of hops along a route using AODV protocol in ns2.35
 
In aodv.cc I put this below printf to show the number of hops from a particular source to destination node.

AODV::recvRequest(Packet *p) {
printf("Hop_Count_ %d | from %d to %d \n \n",rq->rq_hop_count,ih->saddr(),ih->daddr());//Additional

It is showing me output like this which is not correct I guess.Can anyone suggest me where I am wrong.

num_nodes is set 30
INITIALIZE THE LIST xListHead
Starting Simulation........
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 1856.3
SORTING LISTS ...DONE!
Hop_Count_ 1 | from 0 to -1

Hop_Count_ 1 | from 0 to -1

Hop_Count_ 1 | from 21 to -1

Hop_Count_ 1 | from 0 to -1

Hop_Count_ 1 | from 0 to -1

Hop_Count_ 1 | from 15 to -1

Hop_Count_ 1 | from 9 to -1

Hop_Count_ 1 | from 4 to -1

Hop_Count_ 1 | from 15 to -1

Hop_Count_ 2 | from 16 to -1

Hop_Count_ 1 | from 4 to -1

Hop_Count_ 1 | from 14 to -1

Hop_Count_ 1 | from 9 to -1

TB0ne 03-01-2016 07:37 AM

Quote:

Originally Posted by sarkardipikacse (Post 5508361)
In aodv.cc I put this below printf to show the number of hops from a particular source to destination node.
Code:

AODV::recvRequest(Packet *p) {
printf("Hop_Count_ %d | from %d to %d \n \n",rq->rq_hop_count,ih->saddr(),ih->daddr());//Additional

It is showing me output like this which is not correct I guess.Can anyone suggest me where I am wrong.
Code:


num_nodes is set 30
INITIALIZE THE LIST xListHead
Starting Simulation........
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 1856.3
SORTING LISTS ...DONE!

Hop_Count_ 1 | from 0 to -1
Hop_Count_ 1 | from 0 to -1
Hop_Count_ 1 | from 21 to -1
Hop_Count_ 1 | from 0 to -1
Hop_Count_ 1 | from 0 to -1
Hop_Count_ 1 | from 15 to -1
Hop_Count_ 1 | from 9 to -1
Hop_Count_ 1 | from 4 to -1
Hop_Count_ 1 | from 15 to -1
Hop_Count_ 2 | from 16 to -1
Hop_Count_ 1 | from 4 to -1
Hop_Count_ 1 | from 14 to -1
Hop_Count_ 1 | from 9 to -1


First, you really should have posted this in one of your TWO other threads, about this same issue, as a follow-up. Secondly, when posting code, please use CODE tags to make things more readable.

And again, as you've been asked before, POST YOUR CODE...seeing two lines doesn't tell us much at all. And you say you 'guess' the output is incorrect....why? What were you expecting?


All times are GMT -5. The time now is 07:41 AM.