LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-01-2016, 05:16 AM   #1
sarkardipikacse
LQ Newbie
 
Registered: Feb 2016
Posts: 6

Rep: Reputation: Disabled
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
 
Old 03-01-2016, 07:37 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by sarkardipikacse View Post
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?
 
  


Reply

Tags
ns2


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
grayhole attack in ns2 using aodv protocol absharma Linux - Newbie 19 12-29-2016 02:26 PM
Number of hops along a route using AODV protocol in ns2.35 sarkardipikacse Linux - Newbie 3 03-01-2016 08:42 AM
Number of hops along a route using AODV protocol in ns2.35 sarkardipikacse Linux - Newbie 1 02-16-2016 02:09 PM
Route Repair in VANET under AODV in ns2 Nyarkanyuy LinuxQuestions.org Member Intro 0 12-04-2014 02:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:02 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration