SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
Tracing, awk and
xgraph
T S Pradeep Kumar
http://www.nsnam.com
Tracing
• Identify the performance parameters of your network
• Post processing of results in ns2
• Know the format of trace files in ns2 (old and new
trace format)
• Know a scripting language for processing the
results. AWK is the apt choice
• Compute the performance parameters
Wired Trace format
C1 C2 C3 C4
type identifier time source node dest. node
C5 C6 C7 C8
pkt name pkt size flags flow id
C9 C10 C11 C12
Source Addr. Dest. Addre Seq Num Pkt unique ID
Wired Trace Format
• Type identifier (+, -, r, d, c)
• + - enqueue
• - dequeue
• r - receive
• d - drop
• c - packet collision
Wired Trace Format
• C2: Time at which the packet tracing happend
• C3-C4 : Source and destination ID
• C5: name of the packet
• C6: packet size
Wired Trace Format
• C7: Flags
• 7 digit flag string
• - disable
• E - Explicit congestion notification (ECN)
• P - priority in the IP header
• Not in use
• A- congestion action
• E - Congestion has occured
• F - The TCP fast start is used
• N - ECN is ON
Wired Trace Format
• C8: Flow ID
• C9-C10 - Source Address and Destination
address where the format is a.b (a is the
address and b is the port)
• C11 - Sequence Number
• C12 - Packet Unique ID
AWK Scripts
• Either written in one line or written as a separate
file with extension .awk (file.awk)
• The syntax to run the awk script is
• awk -f file.awk file.tr
• gawk -f file.awk file.tr
AWK
• Syntax for AWK inside a file is
• BEGIN {
• }
• {
• }
• END {
• }
AWK
• FS - Field Separator
• RS - Record Separator
• NR - number of records
• NF - Number of fields in current record
• $0 is the current column
• $1 is the first column
• $2 is the second column and so on
Link throughput
• Ratio of
• No of bits from Node A to Node B
• to
• Observation duration (total time)
Link throughput
• BEGIN {
• lineCount = 0;totalBits = 0;
• }
• {
• if ($3=="0" &&$4=="2") {
• totalBits += 8*$6;
• if ( lineCount==0 ) {
• timeBegin = $2; lineCount++;
• } else {
• timeEnd = $2;
• };
• };
• }
• END {
• duration = timeEnd-timeBegin;
• print "Number of records is " NR;
• print "Transmission: 0 to 1";
• print " - Total transmitted bits = "
totalBits " bits";
• print " - duration = " duration " s";
• print " - Thoughput = " totalBits/
duration/1e3 " kbps.";
• };
End to End throughput
• Ratio of
• no of bits from Node A to node B whose
source is S and destination is D
• to
• Observation Destination
End to End throughput
• BEGIN {
• src1 = 0.0; dst1 = 3.1;
• src2 = 3.0; dst2 = 1.0;
• lineCount1 = 0;totalBits1 = 0;
• lineCount2 = 0;totalBits2 = 0;
• }
• {
• if ($1=="r" && $3=="2" &&$4== "3" && $9==src1 &&
$10==dst1) {
• totalBits1 += 8*$6;
• if ( lineCount1==0 ) {
• timeBegin1 = $2; lineCount1++;
• } else {
• timeEnd1 = $2;
• };
• };
• if ($1=="r" && $3=="3" &&$4== "2"
&& $9==src2 && $10==dst2) {
• totalBits2 += 8*$6;
• if ( lineCount2==0 ) {
• timeBegin2 = $2; lineCount2++;
• } else {
• timeEnd2 = $2;
• };
• };
• }
End to End Throughput
• END{
• duration = timeEnd1-timeBegin1;
• print "Transmission: source " src1 "->Destination" dst1;
• print " - Total transmitted bits = " totalBits1 " bits";
• print " - duration = " duration " s";
• print " - Thoughput = " totalBits1/duration/1e3 " kbps.";
• print " ";
• duration = timeEnd2-timeBegin2;
• print "Transmission: source " src2 "->Destination" dst2;
• print " - Total transmitted bits = " totalBits2 " bits";
• print " - duration = " duration " s";
• print " - Thoughput = " totalBits2/duration/1e3 " kbps.";
• };
Link delay
Type of Delay Begin Node End Node
Link Delay Pkt transmitter (C3) Pkt Receiver (C4)
End to End Delay Pkt Creator(C9) Pkt destructor(C10)
Delay calculation
• Average delay is ratio of
• Sum of all delay samples
• to
• number of samples

Más contenido relacionado

La actualidad más candente

Routing algorithm
Routing algorithmRouting algorithm
Routing algorithmBushra M
 
Computer networks a tanenbaum - 5th editionee
Computer networks   a tanenbaum - 5th editioneeComputer networks   a tanenbaum - 5th editionee
Computer networks a tanenbaum - 5th editioneepawan1809
 
Chapter 4 - Digital Transmission
Chapter 4 - Digital TransmissionChapter 4 - Digital Transmission
Chapter 4 - Digital TransmissionWayne Jones Jnr
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocolManusha Dilan
 
Addressing in networking (IP,MAC,Port addressing)
Addressing in networking (IP,MAC,Port addressing)Addressing in networking (IP,MAC,Port addressing)
Addressing in networking (IP,MAC,Port addressing)Geethu Jose
 
Multiple Access in Computer Network
Multiple Access in Computer NetworkMultiple Access in Computer Network
Multiple Access in Computer NetworkHitesh Mohapatra
 
Congestion control
Congestion controlCongestion control
Congestion controlNithin Raj
 
7. data link layer error detection and correction codes - parity and checksum
7. data link layer   error detection and correction codes - parity and checksum7. data link layer   error detection and correction codes - parity and checksum
7. data link layer error detection and correction codes - parity and checksumJAIGANESH SEKAR
 
Computer Networks Lecture Notes 01
Computer Networks Lecture Notes 01Computer Networks Lecture Notes 01
Computer Networks Lecture Notes 01Sreedhar Chowdam
 
Data Communication & Computer Networks : Unipolar & Polar coding
Data Communication & Computer Networks : Unipolar & Polar codingData Communication & Computer Networks : Unipolar & Polar coding
Data Communication & Computer Networks : Unipolar & Polar codingDr Rajiv Srivastava
 

La actualidad más candente (20)

Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Huffman tree
Huffman tree Huffman tree
Huffman tree
 
05 signal encoding
05 signal encoding05 signal encoding
05 signal encoding
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
 
Computer networks a tanenbaum - 5th editionee
Computer networks   a tanenbaum - 5th editioneeComputer networks   a tanenbaum - 5th editionee
Computer networks a tanenbaum - 5th editionee
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Chapter 4 - Digital Transmission
Chapter 4 - Digital TransmissionChapter 4 - Digital Transmission
Chapter 4 - Digital Transmission
 
2. data and signals
2. data and signals2. data and signals
2. data and signals
 
Admission control
Admission controlAdmission control
Admission control
 
GO BACK N PROTOCOL
GO BACK N PROTOCOLGO BACK N PROTOCOL
GO BACK N PROTOCOL
 
Data Link Layer| Error Detection
Data Link Layer| Error DetectionData Link Layer| Error Detection
Data Link Layer| Error Detection
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocol
 
Data and signals
Data and signalsData and signals
Data and signals
 
Addressing in networking (IP,MAC,Port addressing)
Addressing in networking (IP,MAC,Port addressing)Addressing in networking (IP,MAC,Port addressing)
Addressing in networking (IP,MAC,Port addressing)
 
Multiple Access in Computer Network
Multiple Access in Computer NetworkMultiple Access in Computer Network
Multiple Access in Computer Network
 
Huffman coding
Huffman coding Huffman coding
Huffman coding
 
Congestion control
Congestion controlCongestion control
Congestion control
 
7. data link layer error detection and correction codes - parity and checksum
7. data link layer   error detection and correction codes - parity and checksum7. data link layer   error detection and correction codes - parity and checksum
7. data link layer error detection and correction codes - parity and checksum
 
Computer Networks Lecture Notes 01
Computer Networks Lecture Notes 01Computer Networks Lecture Notes 01
Computer Networks Lecture Notes 01
 
Data Communication & Computer Networks : Unipolar & Polar coding
Data Communication & Computer Networks : Unipolar & Polar codingData Communication & Computer Networks : Unipolar & Polar coding
Data Communication & Computer Networks : Unipolar & Polar coding
 

Destacado

Virtual classrooms and labs using Big Blue Button
Virtual classrooms and labs using Big Blue ButtonVirtual classrooms and labs using Big Blue Button
Virtual classrooms and labs using Big Blue ButtonPradeep Kumar TS
 
Challenges in Embedded Computing
Challenges in Embedded ComputingChallenges in Embedded Computing
Challenges in Embedded ComputingPradeep Kumar TS
 
Tutorial 2 downloading and i nstalling omnet++
Tutorial 2   downloading and i nstalling omnet++Tutorial 2   downloading and i nstalling omnet++
Tutorial 2 downloading and i nstalling omnet++Mohd Batati
 
Tutorial 5 adding more nodes
Tutorial 5   adding more nodes Tutorial 5   adding more nodes
Tutorial 5 adding more nodes Mohd Batati
 
Tutorial 4 adding some details
Tutorial 4   adding some details Tutorial 4   adding some details
Tutorial 4 adding some details Mohd Batati
 
Tutorial 6 queues & arrays & results recording
Tutorial 6   queues & arrays & results recording Tutorial 6   queues & arrays & results recording
Tutorial 6 queues & arrays & results recording Mohd Batati
 
Tutorial 1 installing mixim and mixnet
Tutorial 1   installing mixim and mixnetTutorial 1   installing mixim and mixnet
Tutorial 1 installing mixim and mixnetMohd Batati
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Pradeep Kumar TS
 
Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network Ahmed Nour
 
Tutorial 3 getting started with omnet
Tutorial 3   getting started with omnetTutorial 3   getting started with omnet
Tutorial 3 getting started with omnetMohd Batati
 
Simulation d'un réseau Ad-Hoc sous NS2
Simulation d'un réseau Ad-Hoc sous NS2Simulation d'un réseau Ad-Hoc sous NS2
Simulation d'un réseau Ad-Hoc sous NS2Rihab Chebbah
 
Simulation using OMNet++
Simulation using OMNet++Simulation using OMNet++
Simulation using OMNet++jeromy fu
 
Protocol implementation on NS2
Protocol implementation on NS2Protocol implementation on NS2
Protocol implementation on NS2amreshrai02
 

Destacado (20)

Virtual classrooms and labs using Big Blue Button
Virtual classrooms and labs using Big Blue ButtonVirtual classrooms and labs using Big Blue Button
Virtual classrooms and labs using Big Blue Button
 
Challenges in Embedded Computing
Challenges in Embedded ComputingChallenges in Embedded Computing
Challenges in Embedded Computing
 
Operating System fo IoT
Operating System fo IoTOperating System fo IoT
Operating System fo IoT
 
Introduction to TCP
Introduction to TCPIntroduction to TCP
Introduction to TCP
 
Tutorial 2 downloading and i nstalling omnet++
Tutorial 2   downloading and i nstalling omnet++Tutorial 2   downloading and i nstalling omnet++
Tutorial 2 downloading and i nstalling omnet++
 
Tutorial 5 adding more nodes
Tutorial 5   adding more nodes Tutorial 5   adding more nodes
Tutorial 5 adding more nodes
 
Tutorial 4 adding some details
Tutorial 4   adding some details Tutorial 4   adding some details
Tutorial 4 adding some details
 
Tutorial 6 queues & arrays & results recording
Tutorial 6   queues & arrays & results recording Tutorial 6   queues & arrays & results recording
Tutorial 6 queues & arrays & results recording
 
Tutorial 1 installing mixim and mixnet
Tutorial 1   installing mixim and mixnetTutorial 1   installing mixim and mixnet
Tutorial 1 installing mixim and mixnet
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)
 
Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network
 
Ns2 x graphs
Ns2 x graphsNs2 x graphs
Ns2 x graphs
 
Computer Networks Omnet
Computer Networks OmnetComputer Networks Omnet
Computer Networks Omnet
 
Tutorial 3 getting started with omnet
Tutorial 3   getting started with omnetTutorial 3   getting started with omnet
Tutorial 3 getting started with omnet
 
Simulation d'un réseau Ad-Hoc sous NS2
Simulation d'un réseau Ad-Hoc sous NS2Simulation d'un réseau Ad-Hoc sous NS2
Simulation d'un réseau Ad-Hoc sous NS2
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 
Simulation using OMNet++
Simulation using OMNet++Simulation using OMNet++
Simulation using OMNet++
 
Ns2
Ns2Ns2
Ns2
 
Protocol implementation on NS2
Protocol implementation on NS2Protocol implementation on NS2
Protocol implementation on NS2
 
thesis
thesisthesis
thesis
 

Similar a Tracing and awk in ns2

Mcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhMcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhDIVYA SINGH
 
R for Pirates. ESCCONF October 27, 2011
R for Pirates. ESCCONF October 27, 2011R for Pirates. ESCCONF October 27, 2011
R for Pirates. ESCCONF October 27, 2011Mandi Walls
 
Data Wars: The Bloody Enterprise strikes back
Data Wars: The Bloody Enterprise strikes backData Wars: The Bloody Enterprise strikes back
Data Wars: The Bloody Enterprise strikes backVictor_Cr
 
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_08-08-2022_C_...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_08-08-2022_C_...FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_08-08-2022_C_...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_08-08-2022_C_...AntareepMajumder
 
ELK stack at weibo.com
ELK stack at weibo.comELK stack at weibo.com
ELK stack at weibo.com琛琳 饶
 
Schema Design by Chad Tindel, Solution Architect, 10gen
Schema Design  by Chad Tindel, Solution Architect, 10genSchema Design  by Chad Tindel, Solution Architect, 10gen
Schema Design by Chad Tindel, Solution Architect, 10genMongoDB
 
NS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt IIINS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt IIIAjit Nayak
 
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...Data Con LA
 
Parallel Computing in R
Parallel Computing in RParallel Computing in R
Parallel Computing in Rmickey24
 
Introduction to sockets tcp ip protocol.ppt
Introduction to sockets tcp ip protocol.pptIntroduction to sockets tcp ip protocol.ppt
Introduction to sockets tcp ip protocol.pptMajedAboubennah
 
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовRust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовYandex
 
Unit I - 1R introduction to R program.pptx
Unit I - 1R introduction to R program.pptxUnit I - 1R introduction to R program.pptx
Unit I - 1R introduction to R program.pptxSreeLaya9
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go ProgrammingLin Yo-An
 
Big Data-Driven Applications with Cassandra and Spark
Big Data-Driven Applications  with Cassandra and SparkBig Data-Driven Applications  with Cassandra and Spark
Big Data-Driven Applications with Cassandra and SparkArtem Chebotko
 

Similar a Tracing and awk in ns2 (20)

Mcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhMcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singh
 
R for Pirates. ESCCONF October 27, 2011
R for Pirates. ESCCONF October 27, 2011R for Pirates. ESCCONF October 27, 2011
R for Pirates. ESCCONF October 27, 2011
 
Data Wars: The Bloody Enterprise strikes back
Data Wars: The Bloody Enterprise strikes backData Wars: The Bloody Enterprise strikes back
Data Wars: The Bloody Enterprise strikes back
 
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_08-08-2022_C_...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_08-08-2022_C_...FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_08-08-2022_C_...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_08-08-2022_C_...
 
ELK stack at weibo.com
ELK stack at weibo.comELK stack at weibo.com
ELK stack at weibo.com
 
201901-SRv6.pdf
201901-SRv6.pdf201901-SRv6.pdf
201901-SRv6.pdf
 
Schema Design by Chad Tindel, Solution Architect, 10gen
Schema Design  by Chad Tindel, Solution Architect, 10genSchema Design  by Chad Tindel, Solution Architect, 10gen
Schema Design by Chad Tindel, Solution Architect, 10gen
 
NS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt IIINS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt III
 
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
 
Parallel Computing in R
Parallel Computing in RParallel Computing in R
Parallel Computing in R
 
Introduction to sockets tcp ip protocol.ppt
Introduction to sockets tcp ip protocol.pptIntroduction to sockets tcp ip protocol.ppt
Introduction to sockets tcp ip protocol.ppt
 
8 congestion-ipv6
8 congestion-ipv68 congestion-ipv6
8 congestion-ipv6
 
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовRust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
 
What Reika Taught us
What Reika Taught usWhat Reika Taught us
What Reika Taught us
 
Unit I - 1R introduction to R program.pptx
Unit I - 1R introduction to R program.pptxUnit I - 1R introduction to R program.pptx
Unit I - 1R introduction to R program.pptx
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted Malaska
 
Raptor codes
Raptor codesRaptor codes
Raptor codes
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go Programming
 
Python
PythonPython
Python
 
Big Data-Driven Applications with Cassandra and Spark
Big Data-Driven Applications  with Cassandra and SparkBig Data-Driven Applications  with Cassandra and Spark
Big Data-Driven Applications with Cassandra and Spark
 

Más de Pradeep Kumar TS

Digital Portfolio and Footprint
Digital Portfolio and FootprintDigital Portfolio and Footprint
Digital Portfolio and FootprintPradeep Kumar TS
 
Software Define Networking (SDN)
Software Define Networking (SDN)Software Define Networking (SDN)
Software Define Networking (SDN)Pradeep Kumar TS
 
What next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesWhat next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesPradeep Kumar TS
 
Higher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingHigher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingPradeep Kumar TS
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication ProtocolsPradeep Kumar TS
 
RPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksRPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksPradeep Kumar TS
 
Recompiling network simulator 2
Recompiling network simulator 2Recompiling network simulator 2
Recompiling network simulator 2Pradeep Kumar TS
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2Pradeep Kumar TS
 
Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Pradeep Kumar TS
 
Software Defined Networking - 1
Software Defined Networking - 1Software Defined Networking - 1
Software Defined Networking - 1Pradeep Kumar TS
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2Pradeep Kumar TS
 
Software Defined Networking - 3
Software Defined Networking - 3Software Defined Networking - 3
Software Defined Networking - 3Pradeep Kumar TS
 

Más de Pradeep Kumar TS (20)

Digital Portfolio and Footprint
Digital Portfolio and FootprintDigital Portfolio and Footprint
Digital Portfolio and Footprint
 
Open book Examination
Open book ExaminationOpen book Examination
Open book Examination
 
Software Define Networking (SDN)
Software Define Networking (SDN)Software Define Networking (SDN)
Software Define Networking (SDN)
 
What next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesWhat next - Career Enhancement of Graduates
What next - Career Enhancement of Graduates
 
Protothreads
ProtothreadsProtothreads
Protothreads
 
6LoWPAN
6LoWPAN 6LoWPAN
6LoWPAN
 
Software Defined Networks
Software Defined NetworksSoftware Defined Networks
Software Defined Networks
 
Higher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingHigher Order Thinking - Question paper setting
Higher Order Thinking - Question paper setting
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication Protocols
 
IoT Applications
IoT ApplicationsIoT Applications
IoT Applications
 
RPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksRPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy Networks
 
Mannasim for NS2
Mannasim for NS2Mannasim for NS2
Mannasim for NS2
 
Recompiling network simulator 2
Recompiling network simulator 2Recompiling network simulator 2
Recompiling network simulator 2
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2
 
Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2
 
Installation of ns2
Installation of ns2Installation of ns2
Installation of ns2
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
Software Defined Networking - 1
Software Defined Networking - 1Software Defined Networking - 1
Software Defined Networking - 1
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2
 
Software Defined Networking - 3
Software Defined Networking - 3Software Defined Networking - 3
Software Defined Networking - 3
 

Último

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 

Último (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 

Tracing and awk in ns2

  • 1. Tracing, awk and xgraph T S Pradeep Kumar http://www.nsnam.com
  • 2. Tracing • Identify the performance parameters of your network • Post processing of results in ns2 • Know the format of trace files in ns2 (old and new trace format) • Know a scripting language for processing the results. AWK is the apt choice • Compute the performance parameters
  • 3. Wired Trace format C1 C2 C3 C4 type identifier time source node dest. node C5 C6 C7 C8 pkt name pkt size flags flow id C9 C10 C11 C12 Source Addr. Dest. Addre Seq Num Pkt unique ID
  • 4. Wired Trace Format • Type identifier (+, -, r, d, c) • + - enqueue • - dequeue • r - receive • d - drop • c - packet collision
  • 5. Wired Trace Format • C2: Time at which the packet tracing happend • C3-C4 : Source and destination ID • C5: name of the packet • C6: packet size
  • 6. Wired Trace Format • C7: Flags • 7 digit flag string • - disable • E - Explicit congestion notification (ECN) • P - priority in the IP header • Not in use • A- congestion action • E - Congestion has occured • F - The TCP fast start is used • N - ECN is ON
  • 7. Wired Trace Format • C8: Flow ID • C9-C10 - Source Address and Destination address where the format is a.b (a is the address and b is the port) • C11 - Sequence Number • C12 - Packet Unique ID
  • 8. AWK Scripts • Either written in one line or written as a separate file with extension .awk (file.awk) • The syntax to run the awk script is • awk -f file.awk file.tr • gawk -f file.awk file.tr
  • 9. AWK • Syntax for AWK inside a file is • BEGIN { • } • { • } • END { • }
  • 10. AWK • FS - Field Separator • RS - Record Separator • NR - number of records • NF - Number of fields in current record • $0 is the current column • $1 is the first column • $2 is the second column and so on
  • 11. Link throughput • Ratio of • No of bits from Node A to Node B • to • Observation duration (total time)
  • 12. Link throughput • BEGIN { • lineCount = 0;totalBits = 0; • } • { • if ($3=="0" &&$4=="2") { • totalBits += 8*$6; • if ( lineCount==0 ) { • timeBegin = $2; lineCount++; • } else { • timeEnd = $2; • }; • }; • } • END { • duration = timeEnd-timeBegin; • print "Number of records is " NR; • print "Transmission: 0 to 1"; • print " - Total transmitted bits = " totalBits " bits"; • print " - duration = " duration " s"; • print " - Thoughput = " totalBits/ duration/1e3 " kbps."; • };
  • 13. End to End throughput • Ratio of • no of bits from Node A to node B whose source is S and destination is D • to • Observation Destination
  • 14. End to End throughput • BEGIN { • src1 = 0.0; dst1 = 3.1; • src2 = 3.0; dst2 = 1.0; • lineCount1 = 0;totalBits1 = 0; • lineCount2 = 0;totalBits2 = 0; • } • { • if ($1=="r" && $3=="2" &&$4== "3" && $9==src1 && $10==dst1) { • totalBits1 += 8*$6; • if ( lineCount1==0 ) { • timeBegin1 = $2; lineCount1++; • } else { • timeEnd1 = $2; • }; • }; • if ($1=="r" && $3=="3" &&$4== "2" && $9==src2 && $10==dst2) { • totalBits2 += 8*$6; • if ( lineCount2==0 ) { • timeBegin2 = $2; lineCount2++; • } else { • timeEnd2 = $2; • }; • }; • }
  • 15. End to End Throughput • END{ • duration = timeEnd1-timeBegin1; • print "Transmission: source " src1 "->Destination" dst1; • print " - Total transmitted bits = " totalBits1 " bits"; • print " - duration = " duration " s"; • print " - Thoughput = " totalBits1/duration/1e3 " kbps."; • print " "; • duration = timeEnd2-timeBegin2; • print "Transmission: source " src2 "->Destination" dst2; • print " - Total transmitted bits = " totalBits2 " bits"; • print " - duration = " duration " s"; • print " - Thoughput = " totalBits2/duration/1e3 " kbps."; • };
  • 16. Link delay Type of Delay Begin Node End Node Link Delay Pkt transmitter (C3) Pkt Receiver (C4) End to End Delay Pkt Creator(C9) Pkt destructor(C10)
  • 17. Delay calculation • Average delay is ratio of • Sum of all delay samples • to • number of samples