SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Introduction to Layer 2 switching
Introduction to Layer 2 switchingIntroduction to Layer 2 switching
Introduction to Layer 2 switchingaibad ahmed
 
Cisco ACL
Cisco ACLCisco ACL
Cisco ACLfaust0
 
Mobile Networks Overview (2G / 3G / 4G-LTE)
Mobile Networks Overview (2G / 3G / 4G-LTE)Mobile Networks Overview (2G / 3G / 4G-LTE)
Mobile Networks Overview (2G / 3G / 4G-LTE)Hamidreza Bolhasani
 
Mobile ip overview
Mobile ip overviewMobile ip overview
Mobile ip overviewpriya Nithya
 
Routing in Manet
Routing in ManetRouting in Manet
Routing in Manetshiujinghan
 
Chapter 10 : Application layer
Chapter 10 : Application layerChapter 10 : Application layer
Chapter 10 : Application layerteknetir
 
Lecture 11 14. Adhoc routing protocols cont..
Lecture 11 14. Adhoc  routing protocols cont..Lecture 11 14. Adhoc  routing protocols cont..
Lecture 11 14. Adhoc routing protocols cont..Chandra Meena
 
Topic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingTopic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingDr Rajiv Srivastava
 
Mobile Network Layer
Mobile Network LayerMobile Network Layer
Mobile Network LayerRahul Hada
 
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOLEnhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOLNutan Singh
 
Working with NS2
Working with NS2Working with NS2
Working with NS2chanchal214
 

Tendances (20)

Icmp
IcmpIcmp
Icmp
 
Introduction to Layer 2 switching
Introduction to Layer 2 switchingIntroduction to Layer 2 switching
Introduction to Layer 2 switching
 
Congestion Control
Congestion ControlCongestion Control
Congestion Control
 
Cisco ACL
Cisco ACLCisco ACL
Cisco ACL
 
Mobile Networks Overview (2G / 3G / 4G-LTE)
Mobile Networks Overview (2G / 3G / 4G-LTE)Mobile Networks Overview (2G / 3G / 4G-LTE)
Mobile Networks Overview (2G / 3G / 4G-LTE)
 
Mobile ip overview
Mobile ip overviewMobile ip overview
Mobile ip overview
 
Routing in Manet
Routing in ManetRouting in Manet
Routing in Manet
 
Chapter 10 : Application layer
Chapter 10 : Application layerChapter 10 : Application layer
Chapter 10 : Application layer
 
Lecture 11 14. Adhoc routing protocols cont..
Lecture 11 14. Adhoc  routing protocols cont..Lecture 11 14. Adhoc  routing protocols cont..
Lecture 11 14. Adhoc routing protocols cont..
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
Topic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingTopic: Virtual circuit & message switching
Topic: Virtual circuit & message switching
 
Lte1841
Lte1841Lte1841
Lte1841
 
Mobile Network Layer
Mobile Network LayerMobile Network Layer
Mobile Network Layer
 
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOLEnhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
 
12. mobile ip
12. mobile ip12. mobile ip
12. mobile ip
 
Working with NS2
Working with NS2Working with NS2
Working with NS2
 
Tout atm
Tout atmTout atm
Tout atm
 
AODV protocol
AODV protocolAODV protocol
AODV protocol
 
RACH Procedures
RACH ProceduresRACH Procedures
RACH Procedures
 
Protocolos de enrutamiento
Protocolos de enrutamiento Protocolos de enrutamiento
Protocolos de enrutamiento
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 
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
 

Similaire à 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
 
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
 
So you think you can stream.pptx
So you think you can stream.pptxSo you think you can stream.pptx
So you think you can stream.pptx
 

Plus 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
 

Plus 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
 

Dernier

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 

Dernier (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

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