SlideShare a Scribd company logo
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

More Related Content

What's hot

Congestion control and quality of service
Congestion control and quality of serviceCongestion control and quality of service
Congestion control and quality of service
JUW Jinnah University for Women
 
Routing algorithm network layer
Routing algorithm  network layerRouting algorithm  network layer
Routing algorithm network layer
sambhenilesh
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Dr. SELVAGANESAN S
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets
myrajendra
 
Computer network switching
Computer network switchingComputer network switching
Computer network switching
Shivani Godha
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
selvakumar_b1985
 
wireless sensor network
wireless sensor networkwireless sensor network
wireless sensor network
A. Shamel
 
IPv4
IPv4IPv4
switching techniques in data communication and networking
switching techniques in data communication and networkingswitching techniques in data communication and networking
switching techniques in data communication and networking
Harshita Yadav
 
Mobile Network Layer
Mobile Network LayerMobile Network Layer
Mobile Network Layer
Rahul Hada
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
hodcsencet
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
Shehara Abeythunga
 
Shortest path algorithm
Shortest  path algorithmShortest  path algorithm
Shortest path algorithm
Subrata Kumer Paul
 
Routing
RoutingRouting
Routing
Saima Azam
 
Error control
Error controlError control
Error control
selvakumar_b1985
 
Distance vector routing
Distance vector routingDistance vector routing
Distance vector routing
Siddique Ibrahim
 
Data link layer
Data link layer Data link layer
Data link layer
Mukesh Chinta
 

What's hot (20)

Multiple access protocol
Multiple access protocolMultiple access protocol
Multiple access protocol
 
Congestion control and quality of service
Congestion control and quality of serviceCongestion control and quality of service
Congestion control and quality of service
 
Transport layer
Transport layerTransport layer
Transport layer
 
Routing
RoutingRouting
Routing
 
Routing algorithm network layer
Routing algorithm  network layerRouting algorithm  network layer
Routing algorithm network layer
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets
 
Computer network switching
Computer network switchingComputer network switching
Computer network switching
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
 
wireless sensor network
wireless sensor networkwireless sensor network
wireless sensor network
 
IPv4
IPv4IPv4
IPv4
 
switching techniques in data communication and networking
switching techniques in data communication and networkingswitching techniques in data communication and networking
switching techniques in data communication and networking
 
Mobile Network Layer
Mobile Network LayerMobile Network Layer
Mobile Network Layer
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Shortest path algorithm
Shortest  path algorithmShortest  path algorithm
Shortest path algorithm
 
Routing
RoutingRouting
Routing
 
Error control
Error controlError control
Error control
 
Distance vector routing
Distance vector routingDistance vector routing
Distance vector routing
 
Data link layer
Data link layer Data link layer
Data link layer
 

Viewers also liked

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
Pradeep Kumar TS
 
Challenges in Embedded Computing
Challenges in Embedded ComputingChallenges in Embedded Computing
Challenges in Embedded Computing
Pradeep Kumar TS
 
Operating System fo IoT
Operating System fo IoTOperating System fo IoT
Operating System fo IoT
Pradeep Kumar TS
 
Introduction to TCP
Introduction to TCPIntroduction to TCP
Introduction to TCP
Pradeep 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 mixnet
Mohd 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
 
Computer Networks Omnet
Computer Networks OmnetComputer Networks Omnet
Computer Networks Omnet
Shivam Maheshwari
 
Tutorial 3 getting started with omnet
Tutorial 3   getting started with omnetTutorial 3   getting started with omnet
Tutorial 3 getting started with omnet
Mohd 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 NS2
Rihab Chebbah
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
Alpen-Adria-Universität
 
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 NS2
amreshrai02
 

Viewers also liked (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 to 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 singh
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
Mandi 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 back
Victor_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, 10gen
MongoDB
 
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 R
mickey24
 
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
MajedAboubennah
 
8 congestion-ipv6
8 congestion-ipv68 congestion-ipv6
8 congestion-ipv6
Olivier Bonaventure
 
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовRust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Yandex
 
What Reika Taught us
What Reika Taught usWhat 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
SreeLaya9
 
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
Spark Summit
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go Programming
Lin Yo-An
 
Python
PythonPython
Python
Wei-Bo Chen
 
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
 
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
Prakash Chockalingam
 

Similar to 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
 

More from Pradeep Kumar TS

Digital Portfolio and Footprint
Digital Portfolio and FootprintDigital Portfolio and Footprint
Digital Portfolio and Footprint
Pradeep Kumar TS
 
Open book Examination
Open book ExaminationOpen book Examination
Open book Examination
Pradeep 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 Graduates
Pradeep Kumar TS
 
Protothreads
ProtothreadsProtothreads
Protothreads
Pradeep Kumar TS
 
6LoWPAN
6LoWPAN 6LoWPAN
Software Defined Networks
Software Defined NetworksSoftware Defined Networks
Software Defined Networks
Pradeep Kumar TS
 
Higher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingHigher Order Thinking - Question paper setting
Higher Order Thinking - Question paper setting
Pradeep Kumar TS
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication Protocols
Pradeep Kumar TS
 
IoT Applications
IoT ApplicationsIoT Applications
IoT Applications
Pradeep 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 Networks
Pradeep Kumar TS
 
Mannasim for NS2
Mannasim for NS2Mannasim for NS2
Mannasim for NS2
Pradeep Kumar TS
 
Recompiling network simulator 2
Recompiling network simulator 2Recompiling network simulator 2
Recompiling network simulator 2
Pradeep Kumar TS
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2
Pradeep Kumar TS
 
Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2
Pradeep Kumar TS
 
Installation of ns2
Installation of ns2Installation of ns2
Installation of ns2
Pradeep Kumar TS
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
Pradeep Kumar TS
 
Software Defined Networking - 1
Software Defined Networking - 1Software Defined Networking - 1
Software Defined Networking - 1
Pradeep Kumar TS
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2
Pradeep Kumar TS
 
Software Defined Networking - 3
Software Defined Networking - 3Software Defined Networking - 3
Software Defined Networking - 3
Pradeep Kumar TS
 

More from 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
 

Recently uploaded

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Reflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdfReflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdf
amberjdewit93
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
christianmathematics
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 

Recently uploaded (20)

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Reflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdfReflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 

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