SlideShare une entreprise Scribd logo
1  sur  16
Outlines
 Wireless TCL script
 How to build wireless scenarios
 Mobility and traffic (setdest & cbrgen.tcl)
 DSR trace file
 Using AWK for calculating
 Routing overhead
 PDR( Packet Delivery Ratio)
Wireless TCL Script (1/3)
 Mobile node parameters
 Channel type (Channel/WirelessChannel)
 Propagation model (Propagation/TwoRayGround)
 Interface type (Phy/WirelessPhy)
 MAC layer protocol (Mac/802_11)
 Routing protocol (DSR)
 Interface Queue type (CMUPriQueue - for DSR)
 Interface Queue Length (50)
 Antenna type (Antenna/OmniAntenna)
 LL type (LL)
 Read chapter 16 in ns-documentation
 Use wireless.tcl example in tclex folder
Wireless TCL Script (2/3)
# unity gain, omni-directional antennas
# set up the antennas to be centered in the node
and 1.5 meters above it
Antenna/OmniAntenna set X_ 0
Antenna/OmniAntenna set Y_ 0
Antenna/OmniAntenna set Z_ 1.5
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0
Wireless TCL Script(3/3)
 How to reduce the trace output file size
set AgentTrace ON
set RouterTrace ON
set MacTrace ON
 Generating data traffic and mobility scenarios
set val(cp) "../mobility/scene/cbr-3-test"
set val(sc) "../mobility/scene/scen-3-test"
Wireless Scenario (Mobility)
 Provide initial (X,Y, for now Z=0) co-ordinates for mobile
nodes
$node_(0) set X_ 5.0
$node_(0) set Y_ 2.0
$node_(0) set Z_ 0.0
$node_(1) set X_ 390.0
$node_(1) set Y_ 385.0
$node_(1) set Z_ 0.0
 Now produce some simple node movements
# Node_(1) starts to move towards node_(0)
$ns_ at 50.0 "$node_(1) setdest 25.0 20.0 0.0"
$ns_ at 10.0 "$node_(0) setdest 20.0 18.0 0.0"
# Node_(1) then starts to move away from node_(0)
$ns_ at 100.0 "$node_(1) setdest 490.0 480.0 0.0"
Wireless scenario ( Traffic)
# Setup traffic flow between nodes
# TCP connections between node_(0) and node_(1)
set tcp [new Agent/TCP]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns_ attach-agent $node_(0) $tcp
$ns_ attach-agent $node_(1) $sink
$ns_ connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns_ at 10.0 "$ftp start"
Setdet
 A script has been provided which generates these
movements automatically in a separate file
 To generate this, use the setdest script present in
ns/indep-utils/cmu-scen-gen/ directory.
 Examples:
 setdest -v 1 -n 20 -p 2.0 -M 10.0 -t 200 -x 500 -y 500 > scen-20_v1.tcl
 setdest -v 2 -n 20 -s 1 -m 1 -M 10.0 -t 200 -P 1 -p 2.0 -x 500 -y 500 >
scen-20_v2.tcl
Cbrgen.tcl
 Generates traffic automatically in a separate file
 script present in ns/indep-utils/cmu-scen-gen/
directory
ns cbrgen.tcl [-type cbr|tcp] [-nn nodes] [-seed
seed] [-mc connections][-rate rate] >output.tcl
 Example:
 ns cbrgen.tcl –type cbr –nn 50 –seed 1 –mc 10 –
rate 4 > cbr-50-10-4
A Typical DSR trace format
(1/3)
 s 606.210364161 _39_ RTR --- 1306 DSR 44 [13a a 27 800] ------- [39:255 8:255 255 8] 2 [0 0] [0 0
0 0->0] [1 1 8 39->10]
 s: means send
606.210364161: time stamp
_39_: node id
RTR: means router message
1306: uid of this packet
DSR: DSR agent
44: size in the common header hdr_cmn()
 [13a a 27 800] MAC detail: 13a: means the expected transmission time ( note
that packet size is large, 44 bytes, 314second?)
a: means the receiving node: 10
27: means the sending node is 39
800: IP header: 0x0800, (ETHERTYPE_ARP is
0x0806)
DSR Trace Format (2/3)
 [39:255 8:255 255 8] IP detail: src address: IP 39 means 0.0.0.39
port 255
dst address: IP 8 means 0.0.0.8
port 255
TTL: 255
Next-hop: 8
 TTL (time to live ) you can use it to know the
number of hops
DSR Trace Format (3/3)
 2 [0 0] [0 0 0 0->0] [1 1 8 39->10] DSR detail:
 2: num_addrs()
 [0 0] route-request option, this is not a route
request, the second 0 is labeled for sequence
number
 [0 0 0 0->0] route-reply option: [ " route-reply?"
"Rreq seqno" "reply length" "dst of src route", "src
of the src route"]
 [1 1 8 39->10], 1: shows this is a route error
1: number of route errors
8: tp notify node 8.
39->10: link 39-10 is broken
Calculating Routing Overhead &
PDR
 Routing overhead =
 sum of routing packets / sum of data packets
 PDR = Packet Delivery Ratio
 PDR =
 sum of packets sent/ sum of successfully received
packets
 How to extract the number of
 Routing packets
 $cat out.tr |grep "^s.*MAC.*DSR" | wc –l
 Data packets
 $cat out.tr |grep "^s.*MAC.*cbr" | wc –l
Routing Overhead (AWK code)
 BEGIN {dsrpktno = 0; dsrbyte = 0; cbrpktno =
0; cbrbyte = 0; }
{
$1~/s/ && /DSR/ && /MAC/ { dsrpktno ++ ;
dsrbyte+=$8 ;}
$1~/s/ && /cbr/ && /MAC/ { cbrpktno ++ ;
cbrbyte+=$8; }
}
END { print ( dsrpktno/cbrpktno, dsrbyte
/cbrbyte) }
PDR (AWK code)
 BEGIN {Scbr=0; Rcbr=0; }
{
$1~/s/ && /cbr/ && /AGT/ { Scbr ++ ;}
$1~/r/ && /cbr/ && /AGT/ { Rcbr++ ;}
}
END { print ( “PDR=“,Scbr/Rcbr) }
References
 http://www.winlab.rutgers.edu/%7Ezhibinwu/html/dsr_trace_anlysis.html
 http://www.winlab.rutgers.edu/~zhibinwu/html/network_simulator_2.html
 http://www.isi.edu/nsnam/ns/ns-documentation.html

Contenu connexe

Tendances

Wireless Sensor Networks
Wireless Sensor NetworksWireless Sensor Networks
Wireless Sensor Networksrajatmal4
 
Security in wireless sensor network
Security in wireless sensor networkSecurity in wireless sensor network
Security in wireless sensor networkAdit Pathak
 
Multiplexing
MultiplexingMultiplexing
Multiplexingstooty s
 
Security in mobile ad hoc networks
Security in mobile ad hoc networksSecurity in mobile ad hoc networks
Security in mobile ad hoc networksPiyush Mittal
 
Unit 2 -1 ADHOC WIRELESS NETWORK MOBILE COMPUTING
Unit 2 -1 ADHOC WIRELESS NETWORK  MOBILE COMPUTINGUnit 2 -1 ADHOC WIRELESS NETWORK  MOBILE COMPUTING
Unit 2 -1 ADHOC WIRELESS NETWORK MOBILE COMPUTINGdevika g
 
Destination Sequenced Distance Vector Routing (DSDV)
Destination Sequenced Distance Vector Routing (DSDV)Destination Sequenced Distance Vector Routing (DSDV)
Destination Sequenced Distance Vector Routing (DSDV)ArunChokkalingam
 
mobile ad-hoc network (MANET) and its applications
mobile ad-hoc network (MANET) and its applicationsmobile ad-hoc network (MANET) and its applications
mobile ad-hoc network (MANET) and its applicationsAman Gupta
 
Security issues in manet
Security issues in manetSecurity issues in manet
Security issues in manetflowerjaan
 
Basic Architecture of Wireless Sensor Network
Basic Architecture of Wireless Sensor NetworkBasic Architecture of Wireless Sensor Network
Basic Architecture of Wireless Sensor NetworkKarthik
 
Mobile Communication Broadcast System Jochen Schiller
Mobile Communication Broadcast System Jochen SchillerMobile Communication Broadcast System Jochen Schiller
Mobile Communication Broadcast System Jochen SchillerSonali Chauhan
 
Wireless sensor networks
Wireless sensor networksWireless sensor networks
Wireless sensor networksGodspowerAgbulu
 
security in wireless sensor networks
security in wireless sensor networkssecurity in wireless sensor networks
security in wireless sensor networksVishnu Kudumula
 
GSM Cell planning and frequency reuse
GSM Cell planning and frequency reuseGSM Cell planning and frequency reuse
GSM Cell planning and frequency reuseShashank Asthana
 
Working with NS2
Working with NS2Working with NS2
Working with NS2chanchal214
 
Mobile computing unit-5
Mobile computing unit-5Mobile computing unit-5
Mobile computing unit-5Ramesh Babu
 
Underwater wireless sensor networks
Underwater wireless sensor networksUnderwater wireless sensor networks
Underwater wireless sensor networksŞüheda Acar
 
Fault tolerance in wsn
Fault tolerance in wsnFault tolerance in wsn
Fault tolerance in wsnElham Hormozi
 

Tendances (20)

Wireless Sensor Networks
Wireless Sensor NetworksWireless Sensor Networks
Wireless Sensor Networks
 
Security in wireless sensor network
Security in wireless sensor networkSecurity in wireless sensor network
Security in wireless sensor network
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
Security in mobile ad hoc networks
Security in mobile ad hoc networksSecurity in mobile ad hoc networks
Security in mobile ad hoc networks
 
Unit 2 -1 ADHOC WIRELESS NETWORK MOBILE COMPUTING
Unit 2 -1 ADHOC WIRELESS NETWORK  MOBILE COMPUTINGUnit 2 -1 ADHOC WIRELESS NETWORK  MOBILE COMPUTING
Unit 2 -1 ADHOC WIRELESS NETWORK MOBILE COMPUTING
 
Basic networking
Basic networkingBasic networking
Basic networking
 
Destination Sequenced Distance Vector Routing (DSDV)
Destination Sequenced Distance Vector Routing (DSDV)Destination Sequenced Distance Vector Routing (DSDV)
Destination Sequenced Distance Vector Routing (DSDV)
 
mobile ad-hoc network (MANET) and its applications
mobile ad-hoc network (MANET) and its applicationsmobile ad-hoc network (MANET) and its applications
mobile ad-hoc network (MANET) and its applications
 
Security issues in manet
Security issues in manetSecurity issues in manet
Security issues in manet
 
Basic Architecture of Wireless Sensor Network
Basic Architecture of Wireless Sensor NetworkBasic Architecture of Wireless Sensor Network
Basic Architecture of Wireless Sensor Network
 
Mobile Communication Broadcast System Jochen Schiller
Mobile Communication Broadcast System Jochen SchillerMobile Communication Broadcast System Jochen Schiller
Mobile Communication Broadcast System Jochen Schiller
 
Wireless LAN Technoloy
Wireless LAN TechnoloyWireless LAN Technoloy
Wireless LAN Technoloy
 
Wireless sensor networks
Wireless sensor networksWireless sensor networks
Wireless sensor networks
 
security in wireless sensor networks
security in wireless sensor networkssecurity in wireless sensor networks
security in wireless sensor networks
 
GSM Cell planning and frequency reuse
GSM Cell planning and frequency reuseGSM Cell planning and frequency reuse
GSM Cell planning and frequency reuse
 
Working with NS2
Working with NS2Working with NS2
Working with NS2
 
Mobile computing unit-5
Mobile computing unit-5Mobile computing unit-5
Mobile computing unit-5
 
Computer network
Computer networkComputer network
Computer network
 
Underwater wireless sensor networks
Underwater wireless sensor networksUnderwater wireless sensor networks
Underwater wireless sensor networks
 
Fault tolerance in wsn
Fault tolerance in wsnFault tolerance in wsn
Fault tolerance in wsn
 

Similaire à Ns2 introduction 2

Similaire à Ns2 introduction 2 (20)

study-of-network-simulator.pdf
study-of-network-simulator.pdfstudy-of-network-simulator.pdf
study-of-network-simulator.pdf
 
Ns network simulator
Ns network simulatorNs network simulator
Ns network simulator
 
cscn1819.pdf
cscn1819.pdfcscn1819.pdf
cscn1819.pdf
 
Glomosim scenarios
Glomosim scenariosGlomosim scenarios
Glomosim scenarios
 
Ns2
Ns2Ns2
Ns2
 
Ns 2 Network Simulator An Introduction
Ns 2 Network Simulator An IntroductionNs 2 Network Simulator An Introduction
Ns 2 Network Simulator An Introduction
 
Ns2
Ns2Ns2
Ns2
 
Error Control in Multimedia Communications using Wireless Sensor Networks report
Error Control in Multimedia Communications using Wireless Sensor Networks reportError Control in Multimedia Communications using Wireless Sensor Networks report
Error Control in Multimedia Communications using Wireless Sensor Networks report
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
NS2-tutorial.pdf
NS2-tutorial.pdfNS2-tutorial.pdf
NS2-tutorial.pdf
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
~Ns2~
~Ns2~~Ns2~
~Ns2~
 
NS2-tutorial.ppt
NS2-tutorial.pptNS2-tutorial.ppt
NS2-tutorial.ppt
 
Ns fundamentals 1
Ns fundamentals 1Ns fundamentals 1
Ns fundamentals 1
 
Router Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditionsRouter Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditions
 
Tut hemant ns2
Tut hemant ns2Tut hemant ns2
Tut hemant ns2
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
NS-2 Tutorial
NS-2 TutorialNS-2 Tutorial
NS-2 Tutorial
 
CN 1.docx
CN 1.docxCN 1.docx
CN 1.docx
 

Dernier

%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 

Dernier (20)

%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 

Ns2 introduction 2

  • 1.
  • 2. Outlines  Wireless TCL script  How to build wireless scenarios  Mobility and traffic (setdest & cbrgen.tcl)  DSR trace file  Using AWK for calculating  Routing overhead  PDR( Packet Delivery Ratio)
  • 3. Wireless TCL Script (1/3)  Mobile node parameters  Channel type (Channel/WirelessChannel)  Propagation model (Propagation/TwoRayGround)  Interface type (Phy/WirelessPhy)  MAC layer protocol (Mac/802_11)  Routing protocol (DSR)  Interface Queue type (CMUPriQueue - for DSR)  Interface Queue Length (50)  Antenna type (Antenna/OmniAntenna)  LL type (LL)  Read chapter 16 in ns-documentation  Use wireless.tcl example in tclex folder
  • 4. Wireless TCL Script (2/3) # unity gain, omni-directional antennas # set up the antennas to be centered in the node and 1.5 meters above it Antenna/OmniAntenna set X_ 0 Antenna/OmniAntenna set Y_ 0 Antenna/OmniAntenna set Z_ 1.5 Antenna/OmniAntenna set Gt_ 1.0 Antenna/OmniAntenna set Gr_ 1.0
  • 5. Wireless TCL Script(3/3)  How to reduce the trace output file size set AgentTrace ON set RouterTrace ON set MacTrace ON  Generating data traffic and mobility scenarios set val(cp) "../mobility/scene/cbr-3-test" set val(sc) "../mobility/scene/scen-3-test"
  • 6. Wireless Scenario (Mobility)  Provide initial (X,Y, for now Z=0) co-ordinates for mobile nodes $node_(0) set X_ 5.0 $node_(0) set Y_ 2.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 390.0 $node_(1) set Y_ 385.0 $node_(1) set Z_ 0.0  Now produce some simple node movements # Node_(1) starts to move towards node_(0) $ns_ at 50.0 "$node_(1) setdest 25.0 20.0 0.0" $ns_ at 10.0 "$node_(0) setdest 20.0 18.0 0.0" # Node_(1) then starts to move away from node_(0) $ns_ at 100.0 "$node_(1) setdest 490.0 480.0 0.0"
  • 7. Wireless scenario ( Traffic) # Setup traffic flow between nodes # TCP connections between node_(0) and node_(1) set tcp [new Agent/TCP] $tcp set class_ 2 set sink [new Agent/TCPSink] $ns_ attach-agent $node_(0) $tcp $ns_ attach-agent $node_(1) $sink $ns_ connect $tcp $sink set ftp [new Application/FTP] $ftp attach-agent $tcp $ns_ at 10.0 "$ftp start"
  • 8. Setdet  A script has been provided which generates these movements automatically in a separate file  To generate this, use the setdest script present in ns/indep-utils/cmu-scen-gen/ directory.  Examples:  setdest -v 1 -n 20 -p 2.0 -M 10.0 -t 200 -x 500 -y 500 > scen-20_v1.tcl  setdest -v 2 -n 20 -s 1 -m 1 -M 10.0 -t 200 -P 1 -p 2.0 -x 500 -y 500 > scen-20_v2.tcl
  • 9. Cbrgen.tcl  Generates traffic automatically in a separate file  script present in ns/indep-utils/cmu-scen-gen/ directory ns cbrgen.tcl [-type cbr|tcp] [-nn nodes] [-seed seed] [-mc connections][-rate rate] >output.tcl  Example:  ns cbrgen.tcl –type cbr –nn 50 –seed 1 –mc 10 – rate 4 > cbr-50-10-4
  • 10. A Typical DSR trace format (1/3)  s 606.210364161 _39_ RTR --- 1306 DSR 44 [13a a 27 800] ------- [39:255 8:255 255 8] 2 [0 0] [0 0 0 0->0] [1 1 8 39->10]  s: means send 606.210364161: time stamp _39_: node id RTR: means router message 1306: uid of this packet DSR: DSR agent 44: size in the common header hdr_cmn()  [13a a 27 800] MAC detail: 13a: means the expected transmission time ( note that packet size is large, 44 bytes, 314second?) a: means the receiving node: 10 27: means the sending node is 39 800: IP header: 0x0800, (ETHERTYPE_ARP is 0x0806)
  • 11. DSR Trace Format (2/3)  [39:255 8:255 255 8] IP detail: src address: IP 39 means 0.0.0.39 port 255 dst address: IP 8 means 0.0.0.8 port 255 TTL: 255 Next-hop: 8  TTL (time to live ) you can use it to know the number of hops
  • 12. DSR Trace Format (3/3)  2 [0 0] [0 0 0 0->0] [1 1 8 39->10] DSR detail:  2: num_addrs()  [0 0] route-request option, this is not a route request, the second 0 is labeled for sequence number  [0 0 0 0->0] route-reply option: [ " route-reply?" "Rreq seqno" "reply length" "dst of src route", "src of the src route"]  [1 1 8 39->10], 1: shows this is a route error 1: number of route errors 8: tp notify node 8. 39->10: link 39-10 is broken
  • 13. Calculating Routing Overhead & PDR  Routing overhead =  sum of routing packets / sum of data packets  PDR = Packet Delivery Ratio  PDR =  sum of packets sent/ sum of successfully received packets  How to extract the number of  Routing packets  $cat out.tr |grep "^s.*MAC.*DSR" | wc –l  Data packets  $cat out.tr |grep "^s.*MAC.*cbr" | wc –l
  • 14. Routing Overhead (AWK code)  BEGIN {dsrpktno = 0; dsrbyte = 0; cbrpktno = 0; cbrbyte = 0; } { $1~/s/ && /DSR/ && /MAC/ { dsrpktno ++ ; dsrbyte+=$8 ;} $1~/s/ && /cbr/ && /MAC/ { cbrpktno ++ ; cbrbyte+=$8; } } END { print ( dsrpktno/cbrpktno, dsrbyte /cbrbyte) }
  • 15. PDR (AWK code)  BEGIN {Scbr=0; Rcbr=0; } { $1~/s/ && /cbr/ && /AGT/ { Scbr ++ ;} $1~/r/ && /cbr/ && /AGT/ { Rcbr++ ;} } END { print ( “PDR=“,Scbr/Rcbr) }