Forum Replies Created
@fizieee wrote:
hi,
i think the reason behind this is because AODV send a broadcast route request message (RREQ) i.e. 1 RREQ sent, and you get RREP (route reply) from all its neighbouring nodes.so if you want to count the number of successfully received msg, you should specify the packet size (payload) of interest.
i found this AWK script which might be useful:
BEGIN {
recvdSize = 0
startTime = 1e6
stopTime = 0
}{
# Trace line format: normal
if ($2 != “-t”) {
event = $1
time = $2
node_id = $3
flow_id = 0
pkt_id = $7 ;#seq no
pkt_size = $9
flow_t = $8
level = $4
dreason = $6
}
# Trace line format: new ($ns_ use-newtrace)
if ($2 == “-t”) {
event = $1
time = $3
node_id = $5
flow_id = $39
pkt_id = $41
pkt_size = $37
flow_t = $35
level = $19
}# Store packets send time & count #packets sent
if (level == “AGT” && flow_id == flow &&
sendTime[pkt_id]==0 && (event == “+” || event == “s”) && pkt_size >= pkt) {
if (time < startTime) {
startTime = time
}
sendTime[pkt_id] = time
this_flow = flow_t
sendNum ++
}
# Update total received packets’ size and store packets arrival time
if (level == “AGT” && flow_id == flow && event == “r” && pkt_size >= pkt) {
if (time > stopTime) {
stopTime = time
}
# Rip off the header
hdr_size = pkt_size % pkt
pkt_size -= hdr_size
# Store received packet’s size
recvdSize += pkt_size
# Store packet’s reception time
recvTime[pkt_id] = time
}
}END {
for (i in recvTime) {
if (sendTime == 0) {
printf(“nErrorn”,i)
}
delay += recvTime – sendTime
recvdNum ++
}
printf(” %15s: %gn”, “sendPkts”, sendNum)
printf(” %15s: %gn”, “receivedPkts”, recvdNum)
}
My Perl 5 lines code is much better because it’s supposed to make your same work! Don’t you know Perl?
@Tapasya wrote:
Hi everyone,
can anyone say me how to implement saodv in ns-2? I think some changes need to be done to AODV code, Can anyone please help me with this code? It would be great help and, please, its urgent.
Looking forward for your reply.thanks,
Tapasya
any news here?
I’m interested as well.
You have to count from AGT to AGT like this:
#PERL CODE PORTION
while () {
if (/AGT/ && /^s/){
$agtsent++;
} elsif (/AGT/ && /^r/) {
$agtrcv++;
}
}