LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 05-24-2015, 03:00 AM   #1
naserqw
LQ Newbie
 
Registered: Feb 2015
Posts: 7

Rep: Reputation: Disabled
Unhappy get NO.of Path Breaks from trace file


hello

i want get number of path break form simulation of AODV routing protocol with ns2.35.

after searching in net and looking drop result in "ns/trace/cmu-trace.h" i got that "DROP_RTR_MAC_CALLBACK " when occur that path was broken.
in trace file i looking for "CBK" and in awk script i write this code::

Code:
BEGIN {

# Variables defining the reason for the dropped packets
CBK = 0;
CBK_= 0;

keeptimmer=0;

routing_packets=0;

}
{
event = $1;
    time = $2;
    node = $3;
    type = $4;
    reason = $5;
    node2 = $5;
    packetid = $6;
    mac_sub_type=$7;
    size=$8;
    source = $11;
    dest = $10;
    energy=$14;
# Check for the dropped packets


	if (reason == "CBK")

        {
	
	if (time != keeptimer)
		{
		
		keeptimer=time;
		if (event == "D")
				{
				  
				    if (mac_sub_type == "cbr")
			    		CBK++;
				    else
					CBK_++;
				}
		}
	}

}
END {
 printf ("%d ",CBK ) >> "drops.txt";
}
my question is:is my way true to get number of path break???
tnx
 
Old 05-26-2015, 03:34 AM   #2
naserqw
LQ Newbie
 
Registered: Feb 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
is there no one answre to me????
 
  


Reply

Tags
ns2, ns2+awk



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
Creation of subdomain breaks file paths to css folder/file. k3lt01 Programming 4 11-06-2014 03:33 AM
running nam file in ns2 it gives warning as trace file events are not sorted by time s20 Linux - Software 0 07-19-2013 09:45 PM
cp --parents /d1/.d2/d3/foo.txt /e1/ breaks the path at 1st '.', even with -a. stf92 Linux - Newbie 2 06-14-2011 04:54 AM
detect file deletion on an operating system and trace the file history or activity? lovsis Linux - Security 2 10-19-2010 08:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 11:09 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