SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
Introduction to NS2
T S Pradeep Kumar
VIT Chennai
http://www.nsnam.com
http://www.pradeepkumar.org
pradeepkumarts@gmail.com
1
2
✤Linux Vs Windows
✤Network Simulation
✤Introduction to NS2
✤NS2 Architecture
✤OTCL
Overview
• Verss
Use Linux
Because….
✤Support has been stopped beyond
NS-2.27 in windows
✤Package Configuration is tedious in
windows
✤Use NS2 at your own risk in windows
✤Also now the recent architecture of
windows8x family is experiencing lot
of difficulties in tuning cygwin or
mingw.
3
Ò Linux for NS2
✕You may use any distributions like Ubuntu, Fedora, Linux
Mint, RHEL/CentOS, etc.
É Know basic commands (ls, chmod, tar, rpm, make, gedit, vi,
pwd, passwd, echo, cd, etc)
É Know the directory structure and shell prompt in linux and NS2
É Understand Path variables setting, Installation of packages and
dependencies for corresponding distribution.
4
Basic Linux Commands
✤ ls – to list the directory contents
✤ chmod – changing the mode of the file
✤ tar – tape archive (to compress or decompress)
✤ rpm – a type of installation file for linux
✤ make – to compile or recompile in linux
✤ gedit or vi – editors (similar like notepad)
✤ pwd - present working directory
✤ passwd – to change the user passwd
✤ echo – to echo to the screen
✤ cd – change directory
✤ mkdir – to create a directory
5
TS PRADEEP KUMAR
6
✤ To run the install file within the directory scope
✤ $prompt] ./install
✤ To run the install file in global scope is
✤ $prompt] install
Linux basics
TS PRADEEP KUMAR
✤ Approaches
✤ Experiment
✤ Put all network Devices and measure the results/performance
✤ Pros - realistic
✤ Cons - Expensive/Sometime impossible
✤ Mathematical model
✤ Model devices using a graph model
✤ Insight
✤ Need to make assumptions
✤ Simulation
✤ Use programming to represent devices
✤ Easy and can be easily verified
✤ Not much insight, need to make assumptions
Network Simulation
7
TS PRADEEP KUMAR
A B C
✤ Network Simulation
✤ Event Driven
✤ Every event provide a reference to the next event (Example: using
pointer)
✤ Simulation finishes
✤ When there are no more events
✤ At pre-specified time
8
Network Simulation
TS PRADEEP KUMAR
✤ NS is a discrete event simulator
✤ It provides support for
✤ Simulation of TCP
✤ Routing
✤ Huge number of protocols ranging from wired to wireless
networks
✤ Supports the addition of new entities like agent, packet,
application, queue, protocol, routing, etc.
9
About NS2
TS PRADEEP KUMAR
✤ NS2 is not a polished or a finished product
✤ Errors/Bugs are being discovered and corrected.
✤ Users of ns are requested to verify that the results are
not invalidated by bugs.
10
About NS2
TS PRADEEP KUMAR
✤ Network Simulator 2 is an event driven Simulator
✤ It consists of
✤ C++ (Internally)
✤ OTCL (User Interface)
✤ TclCL (Interface between C++ and OTCL)
11
NS2 Architecture
TS PRADEEP KUMAR
12
NS2 Architecture
TS PRADEEP KUMAR
13
NS2 Architecture
14
✤ NS is a OTCL interpreter with network simulation
object libraries
✤ Relation between TCL & OTCL is similar to C & C++
✤ To run a Tcl File and animation file
✤ ns filename.tcl (or) tclsh filename.tcl
✤ nam filename.nam
15
OTCL
# Create a class call "mom" and add a member function call "greet"
Class mom
mom instproc greet {} {
$self instvar age_
puts "$age_ years old mom say:
How are you doing?"
}
16
OTCL Example
# Create a child class of "mom" called "kid" and overide
the member function "greet"
Class kid -superclass mom
kid instproc greet {} {
$self instvar age_
puts "$age_ years old kid say:
What's up, dude?"
}
17
OTCL Example
✤ # Create a mom and a kid object set each age
✤ set a [new mom]
✤ $a set age_ 45
✤ set b [new kid]
✤ $b set age_ 15
✤ # Calling member function "greet" of each object
✤ $a greet
✤ $b greet
18
OTCL Example
To run the above file
✤ Open an Editor preferably gedit or Text Editor in Linux
✤ Type the program
✤ Mom Class
✤ Kid Class
✤ creation of object of both classes
✤ Run the File using
✤ ns momkid.tcl
19
01
Questions?????

Weitere ähnliche Inhalte

Was ist angesagt?

User Datagram protocol For Msc CS
User Datagram protocol For Msc CSUser Datagram protocol For Msc CS
User Datagram protocol For Msc CS
Thanveen
 
Data communication lab manual
Data communication lab manualData communication lab manual
Data communication lab manual
Nafe Singh Yadav
 

Was ist angesagt? (20)

QOS (Quality of Services) - Computer Networks
 QOS (Quality of Services) - Computer Networks QOS (Quality of Services) - Computer Networks
QOS (Quality of Services) - Computer Networks
 
User Datagram protocol For Msc CS
User Datagram protocol For Msc CSUser Datagram protocol For Msc CS
User Datagram protocol For Msc CS
 
Transport layer
Transport layer Transport layer
Transport layer
 
Data communication and networks by B. Forouzan
Data communication and networks by B. ForouzanData communication and networks by B. Forouzan
Data communication and networks by B. Forouzan
 
Unit 3 Network Layer PPT
Unit 3 Network Layer PPTUnit 3 Network Layer PPT
Unit 3 Network Layer PPT
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Network layer tanenbaum
Network layer tanenbaumNetwork layer tanenbaum
Network layer tanenbaum
 
IPv4
IPv4IPv4
IPv4
 
Data communication lab manual
Data communication lab manualData communication lab manual
Data communication lab manual
 
Data link layer
Data link layer Data link layer
Data link layer
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networks
 
Stop and-wait protocol
Stop and-wait protocolStop and-wait protocol
Stop and-wait protocol
 
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
 
IEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and ServicesIEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and Services
 
Tcp
TcpTcp
Tcp
 
Osi model
Osi modelOsi model
Osi model
 
Socket System Calls
Socket System CallsSocket System Calls
Socket System Calls
 
Snmp
SnmpSnmp
Snmp
 
Tutorial on IEEE 802.15.4e standard
Tutorial on IEEE 802.15.4e standardTutorial on IEEE 802.15.4e standard
Tutorial on IEEE 802.15.4e standard
 
ns-3 Tutorial
ns-3 Tutorialns-3 Tutorial
ns-3 Tutorial
 

Ähnlich wie Introduction to ns2

Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
DataStax Academy
 
study-of-network-simulator.pdf
study-of-network-simulator.pdfstudy-of-network-simulator.pdf
study-of-network-simulator.pdf
Jayaprasanna4
 
NS2-tutorial.ppt
NS2-tutorial.pptNS2-tutorial.ppt
NS2-tutorial.ppt
Wajath
 

Ähnlich wie Introduction to ns2 (20)

Session 1 introduction to ns2
Session 1   introduction to ns2Session 1   introduction to ns2
Session 1 introduction to ns2
 
Tut hemant ns2
Tut hemant ns2Tut hemant ns2
Tut hemant ns2
 
Ns fundamentals 1
Ns fundamentals 1Ns fundamentals 1
Ns fundamentals 1
 
Network Simulator Tutorial
Network Simulator TutorialNetwork Simulator Tutorial
Network Simulator Tutorial
 
Ns2
Ns2Ns2
Ns2
 
MySQL up and running 30 minutes.pdf
MySQL up and running 30 minutes.pdfMySQL up and running 30 minutes.pdf
MySQL up and running 30 minutes.pdf
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linux
 
Ns2pre
Ns2preNs2pre
Ns2pre
 
Venkat ns2
Venkat ns2Venkat ns2
Venkat ns2
 
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhereNew Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
 
Nsby examples
Nsby examplesNsby examples
Nsby examples
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12x
 
Sge
SgeSge
Sge
 
study-of-network-simulator.pdf
study-of-network-simulator.pdfstudy-of-network-simulator.pdf
study-of-network-simulator.pdf
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
Systemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveSystemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to love
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..
 
NS2-tutorial.ppt
NS2-tutorial.pptNS2-tutorial.ppt
NS2-tutorial.ppt
 
1 session installation
1 session installation1 session installation
1 session installation
 

Mehr von Pradeep Kumar TS

Mehr von 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
 
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
 
Tracing and awk in ns2
Tracing and awk in ns2Tracing and awk in ns2
Tracing and awk in ns2
 

Kürzlich hochgeladen

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Kürzlich hochgeladen (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%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 Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%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
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Introduction to ns2

  • 1. Introduction to NS2 T S Pradeep Kumar VIT Chennai http://www.nsnam.com http://www.pradeepkumar.org pradeepkumarts@gmail.com 1
  • 2. 2 ✤Linux Vs Windows ✤Network Simulation ✤Introduction to NS2 ✤NS2 Architecture ✤OTCL Overview
  • 3. • Verss Use Linux Because…. ✤Support has been stopped beyond NS-2.27 in windows ✤Package Configuration is tedious in windows ✤Use NS2 at your own risk in windows ✤Also now the recent architecture of windows8x family is experiencing lot of difficulties in tuning cygwin or mingw. 3
  • 4. Ò Linux for NS2 ✕You may use any distributions like Ubuntu, Fedora, Linux Mint, RHEL/CentOS, etc. É Know basic commands (ls, chmod, tar, rpm, make, gedit, vi, pwd, passwd, echo, cd, etc) É Know the directory structure and shell prompt in linux and NS2 É Understand Path variables setting, Installation of packages and dependencies for corresponding distribution. 4
  • 5. Basic Linux Commands ✤ ls – to list the directory contents ✤ chmod – changing the mode of the file ✤ tar – tape archive (to compress or decompress) ✤ rpm – a type of installation file for linux ✤ make – to compile or recompile in linux ✤ gedit or vi – editors (similar like notepad) ✤ pwd - present working directory ✤ passwd – to change the user passwd ✤ echo – to echo to the screen ✤ cd – change directory ✤ mkdir – to create a directory 5
  • 6. TS PRADEEP KUMAR 6 ✤ To run the install file within the directory scope ✤ $prompt] ./install ✤ To run the install file in global scope is ✤ $prompt] install Linux basics
  • 7. TS PRADEEP KUMAR ✤ Approaches ✤ Experiment ✤ Put all network Devices and measure the results/performance ✤ Pros - realistic ✤ Cons - Expensive/Sometime impossible ✤ Mathematical model ✤ Model devices using a graph model ✤ Insight ✤ Need to make assumptions ✤ Simulation ✤ Use programming to represent devices ✤ Easy and can be easily verified ✤ Not much insight, need to make assumptions Network Simulation 7
  • 8. TS PRADEEP KUMAR A B C ✤ Network Simulation ✤ Event Driven ✤ Every event provide a reference to the next event (Example: using pointer) ✤ Simulation finishes ✤ When there are no more events ✤ At pre-specified time 8 Network Simulation
  • 9. TS PRADEEP KUMAR ✤ NS is a discrete event simulator ✤ It provides support for ✤ Simulation of TCP ✤ Routing ✤ Huge number of protocols ranging from wired to wireless networks ✤ Supports the addition of new entities like agent, packet, application, queue, protocol, routing, etc. 9 About NS2
  • 10. TS PRADEEP KUMAR ✤ NS2 is not a polished or a finished product ✤ Errors/Bugs are being discovered and corrected. ✤ Users of ns are requested to verify that the results are not invalidated by bugs. 10 About NS2
  • 11. TS PRADEEP KUMAR ✤ Network Simulator 2 is an event driven Simulator ✤ It consists of ✤ C++ (Internally) ✤ OTCL (User Interface) ✤ TclCL (Interface between C++ and OTCL) 11 NS2 Architecture
  • 12. TS PRADEEP KUMAR 12 NS2 Architecture
  • 13. TS PRADEEP KUMAR 13 NS2 Architecture
  • 14. 14
  • 15. ✤ NS is a OTCL interpreter with network simulation object libraries ✤ Relation between TCL & OTCL is similar to C & C++ ✤ To run a Tcl File and animation file ✤ ns filename.tcl (or) tclsh filename.tcl ✤ nam filename.nam 15 OTCL
  • 16. # Create a class call "mom" and add a member function call "greet" Class mom mom instproc greet {} { $self instvar age_ puts "$age_ years old mom say: How are you doing?" } 16 OTCL Example
  • 17. # Create a child class of "mom" called "kid" and overide the member function "greet" Class kid -superclass mom kid instproc greet {} { $self instvar age_ puts "$age_ years old kid say: What's up, dude?" } 17 OTCL Example
  • 18. ✤ # Create a mom and a kid object set each age ✤ set a [new mom] ✤ $a set age_ 45 ✤ set b [new kid] ✤ $b set age_ 15 ✤ # Calling member function "greet" of each object ✤ $a greet ✤ $b greet 18 OTCL Example
  • 19. To run the above file ✤ Open an Editor preferably gedit or Text Editor in Linux ✤ Type the program ✤ Mom Class ✤ Kid Class ✤ creation of object of both classes ✤ Run the File using ✤ ns momkid.tcl 19