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

Open source network forensics and advanced pcap analysis
Open source network forensics and advanced pcap analysisOpen source network forensics and advanced pcap analysis
Open source network forensics and advanced pcap analysisGTKlondike
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingMichelle Holley
 
DevConf 2014 Kernel Networking Walkthrough
DevConf 2014   Kernel Networking WalkthroughDevConf 2014   Kernel Networking Walkthrough
DevConf 2014 Kernel Networking WalkthroughThomas Graf
 
Socket programming
Socket programmingSocket programming
Socket programmingAnurag Tomar
 
nftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewallnftables - the evolution of Linux Firewall
nftables - the evolution of Linux FirewallMarian Marinov
 
GRE (generic routing encapsulation)
GRE (generic routing encapsulation)GRE (generic routing encapsulation)
GRE (generic routing encapsulation)Netwax Lab
 
Troubleshooting Firewalls (2012 San Diego)
Troubleshooting Firewalls (2012 San Diego)Troubleshooting Firewalls (2012 San Diego)
Troubleshooting Firewalls (2012 San Diego)Cisco Security
 
BGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and DiscussionBGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and DiscussionAPNIC
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingKernel TLV
 
DDoS Mitigation using BGP Flowspec
DDoS Mitigation using BGP Flowspec DDoS Mitigation using BGP Flowspec
DDoS Mitigation using BGP Flowspec APNIC
 
Wireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filtersWireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filtersYoram Orzach
 

What's hot (20)

Open source network forensics and advanced pcap analysis
Open source network forensics and advanced pcap analysisOpen source network forensics and advanced pcap analysis
Open source network forensics and advanced pcap analysis
 
Snort IPS
Snort IPSSnort IPS
Snort IPS
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
 
DevConf 2014 Kernel Networking Walkthrough
DevConf 2014   Kernel Networking WalkthroughDevConf 2014   Kernel Networking Walkthrough
DevConf 2014 Kernel Networking Walkthrough
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Dpdk performance
Dpdk performanceDpdk performance
Dpdk performance
 
nftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewallnftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewall
 
Wireshark Tutorial
Wireshark TutorialWireshark Tutorial
Wireshark Tutorial
 
GRE (generic routing encapsulation)
GRE (generic routing encapsulation)GRE (generic routing encapsulation)
GRE (generic routing encapsulation)
 
Troubleshooting Firewalls (2012 San Diego)
Troubleshooting Firewalls (2012 San Diego)Troubleshooting Firewalls (2012 San Diego)
Troubleshooting Firewalls (2012 San Diego)
 
5. icmp
5. icmp5. icmp
5. icmp
 
BGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and DiscussionBGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and Discussion
 
Mobile IP
Mobile IPMobile IP
Mobile IP
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
 
DDoS Mitigation using BGP Flowspec
DDoS Mitigation using BGP Flowspec DDoS Mitigation using BGP Flowspec
DDoS Mitigation using BGP Flowspec
 
NS3 Overview
NS3 OverviewNS3 Overview
NS3 Overview
 
Iperf Tutorial
Iperf Tutorial Iperf Tutorial
Iperf Tutorial
 
Wireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filtersWireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filters
 
Tuto VP IPSEC Site-to-site
Tuto VP IPSEC Site-to-siteTuto VP IPSEC Site-to-site
Tuto VP IPSEC Site-to-site
 

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..
 
TinyOS 2.1 Tutorial: TOSSIM
TinyOS 2.1 Tutorial: TOSSIMTinyOS 2.1 Tutorial: TOSSIM
TinyOS 2.1 Tutorial: TOSSIM
 
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
 

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

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

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