SlideShare a Scribd company logo
1 of 20
Network simulator 2 T S PRADEEP KUMAR url : http://www.pradeepkumar.org Email: tspembedded@gmail.com Social : http://www.facebook.com/tspradeep
Overview	 Installation of NS2 Introduction to OTCL/C++ Recompiling NS2 Modification Adding a new module
Linux for Ns2 Linux Use of Linux is recommended Fedora (10, 12) If DVD Version- no need of additional package installation Install all the packages (if default installation selected, then additional packages have to be installed) Ubuntu (9.04, 9.10, 10.04, 10.10) Additional packages to be installed, there may be GCC Issues, xgraph and NAM issues Red Hat Enterprise Linux 5 (RHEL5) Cent OS is the alternative for RHEL Basic commands (ls, chmod, tar, rpm, make, gedit, vi, pwd, passwd, echo, cd, etc) Directory structure and shell prompt Path variables setting, Installation of packages and dependencies
Installation of ns2 Download from http://isi.edu/nsnam/ns/ns-build.html#allinone Copy the file under /home/pradeep(if your username is “abcdef” then home folder will be /home/abcdef) Extract it using “tar zxvf ns-allinone-2.34.tar.gz” “cd ns-allinone-2.34” “./install “ (if any errors, please correct it) Setting of paths in “.bash_profile”or “.bashrc”
Basic architecture of ns2
Directory structure of ns2
OTCL Verses C++ OTCL Interpreted Hierarchy Faster to interpret, slow to run Preferable for beginners C++ Used when dealing with a packet, agent or a protocol Compiled Hierarchy Slow to compile, faster to execute The interface between OTCL and C++ is TclCL (available as a folder in ~ns-allinone-2.34/tclcl-xxx)
TclCL TCLCL Consists of Six main classes Tcl(Methods to access the interpreted hierarchy) InstVar(binds member variable in both hierarchies together TclObject (base class of all simulation objects) TclClass(maps class of IH to class of CH) TclCommand(global access to CH from IH) EmbeddedTcl (translates OTCL Script  to C++ Code)
TclCL Each class have various member functions that are used to get compiled As a case study, lets start how to create a simple agent.
Simple Agent class TSPAgent : public Agent { public: TSPAgent(); protected: int command(intargc, const char*const* argv); private: int    tsp_var1;         double tsp_var2;         void   TSPPrivFunc(void); };
Simple Agent static class TSPAgentClass : public TclClass { public: TSPAgentClass() : TclClass("Agent/TSPAgentOtcl") {} TclObject* create(int, const char*const*) {                 return(new TSPAgent());         } } class_tsp_agent; TSPAgent::TSPAgent() : Agent(PT_UDP) {        bind("tsp_var1_otcl", &tsp_var1);        bind("tsp_var2_otcl", &tsp_var2); }
Simple Agent intTSPAgent::command(intargc, const char*const* argv) {       if(argc == 2) {            if(strcmp(argv[1], "call-tsp-priv-func") == 0) { TSPPrivFunc();                   return(TCL_OK);            }       }      return(Agent::command(argc, argv)); }
Simple Agent void TSPAgent::TSPPrivFunc(void) { Tcl& tcl = Tcl::instance(); tcl.eval("puts quot;Message From TSPPrivFuncquot;"); tcl.evalf("puts quot;     tsp_var1 = %dquot;", tsp_var1); tcl.evalf("puts quot;     tsp_var2 = %fquot;", tsp_var2); }
Simple Agent to Test #name it as .tcl file # Create TSPAgent set myagent [new Agent/TSPAgentOtcl] # Set configurable parameters of TSPAgent $myagent set tsp_var1_otcl 2 $myagent set tsp_var2_otcl 3.14 # Give a command to TSPAgent $myagent call-tsp-priv-fun
Case study – 2 – Multimedia over udp to build a multimedia application that runs over a UDP connection,  five rate media scaling by changing encoding and transmission policy pairs associated with scale parameter values.
Case study – 2 – Multimedia over udp Based on 5 rate 0 	0.3mb 1	0.6mb 2	0.9mb 3	1.2mb 4	1.5mb Packetsize 	1000 Random	false
Case study – 2 – Multimedia over udp When connection established, Sender/receiver agree on 5 different sets of encoding and transmission policy pairs. Sender sends with scale 0 but changes the transmission rates according to the value that the receiver notifies. The receiver is responsible for monitoring the network congestion and determine the scale factor. If congestion, then the receiver reduces the scale factor.
Where to modify ~ns-2.34 is the folder where all the cc modules are located
Where to modify
Thank you!!!

More Related Content

What's hot

What's hot (20)

Dsdv
DsdvDsdv
Dsdv
 
WSN presentation
WSN presentationWSN presentation
WSN presentation
 
Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access (CSMA)Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access (CSMA)
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
 
Media Access Control
Media Access ControlMedia Access Control
Media Access Control
 
Unicast multicast & broadcast
Unicast multicast & broadcastUnicast multicast & broadcast
Unicast multicast & broadcast
 
Mobile IP
Mobile IPMobile IP
Mobile IP
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
QoS in WSN thesis
QoS in WSN thesisQoS in WSN thesis
QoS in WSN thesis
 
AODV routing protocol
AODV routing protocolAODV routing protocol
AODV routing protocol
 
Point To Point Protocol
Point To Point ProtocolPoint To Point Protocol
Point To Point Protocol
 
Multiple access protocol
Multiple access protocolMultiple access protocol
Multiple access protocol
 
PPP (Point to Point Protocol)
PPP (Point to Point Protocol)PPP (Point to Point Protocol)
PPP (Point to Point Protocol)
 
OLSR | Optimized Link State Routing Protocol
OLSR | Optimized Link State Routing ProtocolOLSR | Optimized Link State Routing Protocol
OLSR | Optimized Link State Routing Protocol
 
Layered Architecture
Layered ArchitectureLayered Architecture
Layered Architecture
 
Fault tolerance in wsn
Fault tolerance in wsnFault tolerance in wsn
Fault tolerance in wsn
 
Routing Protocols in WSN
Routing Protocols in WSNRouting Protocols in WSN
Routing Protocols in WSN
 
Building Topology in NS3
Building Topology in NS3Building Topology in NS3
Building Topology in NS3
 
Zone Routing Protocol
Zone Routing ProtocolZone Routing Protocol
Zone Routing Protocol
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 

Viewers also liked

Viewers also liked (20)

Session 1 introduction to ns2
Session 1   introduction to ns2Session 1   introduction to ns2
Session 1 introduction to ns2
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..
 
Intoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMIntoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIM
 
~Ns2~
~Ns2~~Ns2~
~Ns2~
 
Simulation and Performance Analysis of AODV using NS-2.34
Simulation and Performance Analysis of AODV using NS-2.34Simulation and Performance Analysis of AODV using NS-2.34
Simulation and Performance Analysis of AODV using NS-2.34
 
Ns2
Ns2Ns2
Ns2
 
Wireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and ComparisonsWireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and Comparisons
 
Begineers for Qualnet
Begineers for QualnetBegineers for Qualnet
Begineers for Qualnet
 
Introduction to Qualnet
Introduction to QualnetIntroduction to Qualnet
Introduction to Qualnet
 
Introduction to Qualnet
Introduction to Qualnet Introduction to Qualnet
Introduction to Qualnet
 
Ns2
Ns2Ns2
Ns2
 
NS2: Events and Handlers
NS2: Events and HandlersNS2: Events and Handlers
NS2: Events and Handlers
 
NS2--Event Scheduler
NS2--Event SchedulerNS2--Event Scheduler
NS2--Event Scheduler
 
Use of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing AlgorithmsUse of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing Algorithms
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variables
 
Basic Packet Forwarding in NS2
Basic Packet Forwarding in NS2Basic Packet Forwarding in NS2
Basic Packet Forwarding in NS2
 
Ns2
Ns2Ns2
Ns2
 
Ns2programs
Ns2programsNs2programs
Ns2programs
 
Manet ns2
Manet ns2Manet ns2
Manet ns2
 
Protocol implementation on NS2
Protocol implementation on NS2Protocol implementation on NS2
Protocol implementation on NS2
 

Similar to 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 NS2Pradeep Kumar TS
 
Easy distributed load test with Tsung
Easy distributed load test with TsungEasy distributed load test with Tsung
Easy distributed load test with TsungNgoc Dao
 
Installation of NS2 and Congestion Control
Installation of NS2 and Congestion ControlInstallation of NS2 and Congestion Control
Installation of NS2 and Congestion Controlnanmagandh
 
Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2Max Kleiner
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4Abed Bukhari
 
httplinux.die.netman3execfork() creates a new process by.docx
httplinux.die.netman3execfork() creates a new process by.docxhttplinux.die.netman3execfork() creates a new process by.docx
httplinux.die.netman3execfork() creates a new process by.docxadampcarr67227
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsqlafa reg
 
Ns2: Introduction - Part I
Ns2: Introduction - Part INs2: Introduction - Part I
Ns2: Introduction - Part IAjit Nayak
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Giovanni Bechis
 
20100712-OTcl Command -- Getting Started
20100712-OTcl Command -- Getting Started20100712-OTcl Command -- Getting Started
20100712-OTcl Command -- Getting StartedTeerawat Issariyakul
 
Shell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdfShell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdfclarityvision
 
Creating Lazy stream in CSharp
Creating Lazy stream in CSharpCreating Lazy stream in CSharp
Creating Lazy stream in CSharpDhaval Dalal
 
Thrfit从入门到精通
Thrfit从入门到精通Thrfit从入门到精通
Thrfit从入门到精通炜龙 何
 

Similar to Network simulator 2 (20)

OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2
 
Extending ns
Extending nsExtending ns
Extending ns
 
Easy distributed load test with Tsung
Easy distributed load test with TsungEasy distributed load test with Tsung
Easy distributed load test with Tsung
 
Installation of NS2 and Congestion Control
Installation of NS2 and Congestion ControlInstallation of NS2 and Congestion Control
Installation of NS2 and Congestion Control
 
srgoc
srgocsrgoc
srgoc
 
Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
 
httplinux.die.netman3execfork() creates a new process by.docx
httplinux.die.netman3execfork() creates a new process by.docxhttplinux.die.netman3execfork() creates a new process by.docx
httplinux.die.netman3execfork() creates a new process by.docx
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsql
 
Ns2: Introduction - Part I
Ns2: Introduction - Part INs2: Introduction - Part I
Ns2: Introduction - Part I
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
 
CODEsign 2015
CODEsign 2015CODEsign 2015
CODEsign 2015
 
Microkernel Development
Microkernel DevelopmentMicrokernel Development
Microkernel Development
 
TechTalk - Dotnet
TechTalk - DotnetTechTalk - Dotnet
TechTalk - Dotnet
 
Ns network simulator
Ns network simulatorNs network simulator
Ns network simulator
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)
 
20100712-OTcl Command -- Getting Started
20100712-OTcl Command -- Getting Started20100712-OTcl Command -- Getting Started
20100712-OTcl Command -- Getting Started
 
Shell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdfShell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdf
 
Creating Lazy stream in CSharp
Creating Lazy stream in CSharpCreating Lazy stream in CSharp
Creating Lazy stream in CSharp
 
Thrfit从入门到精通
Thrfit从入门到精通Thrfit从入门到精通
Thrfit从入门到精通
 

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

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

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Network simulator 2

  • 1. Network simulator 2 T S PRADEEP KUMAR url : http://www.pradeepkumar.org Email: tspembedded@gmail.com Social : http://www.facebook.com/tspradeep
  • 2. Overview Installation of NS2 Introduction to OTCL/C++ Recompiling NS2 Modification Adding a new module
  • 3. Linux for Ns2 Linux Use of Linux is recommended Fedora (10, 12) If DVD Version- no need of additional package installation Install all the packages (if default installation selected, then additional packages have to be installed) Ubuntu (9.04, 9.10, 10.04, 10.10) Additional packages to be installed, there may be GCC Issues, xgraph and NAM issues Red Hat Enterprise Linux 5 (RHEL5) Cent OS is the alternative for RHEL Basic commands (ls, chmod, tar, rpm, make, gedit, vi, pwd, passwd, echo, cd, etc) Directory structure and shell prompt Path variables setting, Installation of packages and dependencies
  • 4. Installation of ns2 Download from http://isi.edu/nsnam/ns/ns-build.html#allinone Copy the file under /home/pradeep(if your username is “abcdef” then home folder will be /home/abcdef) Extract it using “tar zxvf ns-allinone-2.34.tar.gz” “cd ns-allinone-2.34” “./install “ (if any errors, please correct it) Setting of paths in “.bash_profile”or “.bashrc”
  • 7. OTCL Verses C++ OTCL Interpreted Hierarchy Faster to interpret, slow to run Preferable for beginners C++ Used when dealing with a packet, agent or a protocol Compiled Hierarchy Slow to compile, faster to execute The interface between OTCL and C++ is TclCL (available as a folder in ~ns-allinone-2.34/tclcl-xxx)
  • 8. TclCL TCLCL Consists of Six main classes Tcl(Methods to access the interpreted hierarchy) InstVar(binds member variable in both hierarchies together TclObject (base class of all simulation objects) TclClass(maps class of IH to class of CH) TclCommand(global access to CH from IH) EmbeddedTcl (translates OTCL Script to C++ Code)
  • 9. TclCL Each class have various member functions that are used to get compiled As a case study, lets start how to create a simple agent.
  • 10. Simple Agent class TSPAgent : public Agent { public: TSPAgent(); protected: int command(intargc, const char*const* argv); private: int tsp_var1; double tsp_var2; void TSPPrivFunc(void); };
  • 11. Simple Agent static class TSPAgentClass : public TclClass { public: TSPAgentClass() : TclClass("Agent/TSPAgentOtcl") {} TclObject* create(int, const char*const*) { return(new TSPAgent()); } } class_tsp_agent; TSPAgent::TSPAgent() : Agent(PT_UDP) { bind("tsp_var1_otcl", &tsp_var1); bind("tsp_var2_otcl", &tsp_var2); }
  • 12. Simple Agent intTSPAgent::command(intargc, const char*const* argv) { if(argc == 2) { if(strcmp(argv[1], "call-tsp-priv-func") == 0) { TSPPrivFunc(); return(TCL_OK); } } return(Agent::command(argc, argv)); }
  • 13. Simple Agent void TSPAgent::TSPPrivFunc(void) { Tcl& tcl = Tcl::instance(); tcl.eval("puts quot;Message From TSPPrivFuncquot;"); tcl.evalf("puts quot; tsp_var1 = %dquot;", tsp_var1); tcl.evalf("puts quot; tsp_var2 = %fquot;", tsp_var2); }
  • 14. Simple Agent to Test #name it as .tcl file # Create TSPAgent set myagent [new Agent/TSPAgentOtcl] # Set configurable parameters of TSPAgent $myagent set tsp_var1_otcl 2 $myagent set tsp_var2_otcl 3.14 # Give a command to TSPAgent $myagent call-tsp-priv-fun
  • 15. Case study – 2 – Multimedia over udp to build a multimedia application that runs over a UDP connection, five rate media scaling by changing encoding and transmission policy pairs associated with scale parameter values.
  • 16. Case study – 2 – Multimedia over udp Based on 5 rate 0 0.3mb 1 0.6mb 2 0.9mb 3 1.2mb 4 1.5mb Packetsize 1000 Random false
  • 17. Case study – 2 – Multimedia over udp When connection established, Sender/receiver agree on 5 different sets of encoding and transmission policy pairs. Sender sends with scale 0 but changes the transmission rates according to the value that the receiver notifies. The receiver is responsible for monitoring the network congestion and determine the scale factor. If congestion, then the receiver reduces the scale factor.
  • 18. Where to modify ~ns-2.34 is the folder where all the cc modules are located