SlideShare a Scribd company logo
By
Mohammed Amer Al-Batati

         2012
 Let every node send a packet periodically.
 How? Time to go to C++ files.
 The model behavior is defined by the user as C++ code.




                            The class has to be registered with OMNeT++
                            via the Define_Module() macro. The Define_
                            Module() line should always be put into .cc or
                            .cpp files and not header file (.h).
1) initialize(). This method is invoked after
   OMNeT++ has set up the network.
2) handleMessage(cMessage *msg). It is invoked
   with the message as parameter whenever the
   module receives a message. handleMessage() is
   expected to process the message, and then
   return.
3) finish(). It is called when the simulation has
   terminated successfully, and its recommended
   use is the recording of summary statistics.
 The message can arrive:
  1.  From another module or
  2. From the same module (self-messages
     are used to implement timers).
 Add the following code in Node.cc




                                      Why??
 Each node has a limited energy (e,g.; 100mW).
 Each transmission operation consumes energy (e.g.;
  0.8mW per transmission).
 Make the initial energy variable.
 Make the transmission interval variable.
 When a node cannot transmit a packet (the remaining
  energy is less than 0.8mW), then it stops sending data
  (dies).
1. Modifying NED file:
2. Modifying .h file




                          Is it
                       important??
3. Modifying .cc file
3. Modifying .cc file   Sir, Can I use
                        CTRL+SHIFT+F
                        and CTRL+SPACE
                        here?
3. Modifying .cc file   Sir, Can I use
                        CTRL+SHIFT+F
                             Thanks!!
                        and CTRL+SPACE
                        here?
 Be sure that the previous run was closed.
 Run the experiment, every thing should work fine.
   The events are shown in the Tkenv view.
 Inspect the network
 By double-clicking on either node1 or node 2, we can
  see the detailed implementation of our Nodes.
 But the variables (tx_interval and energy) are not
  there.
 To watch them, add WATCH(var) statement
 OMNeT++ provides WATCH() and a set of other
  macros to allow variables to be inspectable in Tkenv.
 Always put watches in initialize()
 Syntax: WATCH(var)
                                         Save and
                                         Rebuild
 In previous experiments, we were using the default
  values of both Tx_interval and Energy.
 Using different parameters can be achieved using the
  INI file.
 Open “omnetpp.ini” file.
 There are two modes, open the Source mode.
 In previous experiments, we were using the default
  values of both Tx_interval and Energy.
 Using different parameters can be achieved using the
  INI file.
 Open “omnetpp.ini” file.
 There are two modes, open the Source mode.
 Models can have a large number of parameters to be
  configured, and it would be tedious to set them one-
  by-one in omnetpp.ini.
 OMNeT++ supports wildcard patterns which allow for
  setting several model parameters at once.
 Assume we want to test our system (Node) with two
  types of traffic: high and low. We can create a separate
  section for each type as follows:




 For every run, we need to select a specific ‘Config name’ .

More Related Content

What's hot (20)

PDF
Building scalable network applications with Netty (as presented on NLJUG JFal...
Jaap ter Woerds
 
PDF
Adam Sitnik "State of the .NET Performance"
Yulia Tsisyk
 
ODP
Apachecon Eu 2008 Mina
Niklas Gustavsson
 
PDF
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
Python Ireland
 
PPT
Python multithreading session 9 - shanmugam
Navaneethan Naveen
 
PPTX
.NET Multithreading/Multitasking
Sasha Kravchuk
 
PPT
Multi threading
Maryam Ansari
 
PPTX
Pawan industrial training presentation on Hadoop, Clustering and Network virt...
PAWANNAYAK15
 
PDF
Introduction+To+Java+Concurrency
King's College London
 
PPTX
Python Training in Bangalore | Multi threading | Learnbay.in
Learnbayin
 
PPTX
.NET: Thread Synchronization Constructs
Sasha Kravchuk
 
PPTX
Multi-Threading
Robert MacLean
 
PPT
Smalltalk in a .NET World
ESUG
 
PPT
Threads c sharp
Karthick Suresh
 
PDF
Chainer v2 and future dev plan
Seiya Tokui
 
ODP
Multithreading 101
Tim Penhey
 
PDF
Chainer v2 alpha
Seiya Tokui
 
PDF
Introduction to ns2
Pradeep Kumar TS
 
PPTX
Threading in C#
Medhat Dawoud
 
Building scalable network applications with Netty (as presented on NLJUG JFal...
Jaap ter Woerds
 
Adam Sitnik "State of the .NET Performance"
Yulia Tsisyk
 
Apachecon Eu 2008 Mina
Niklas Gustavsson
 
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
Python Ireland
 
Python multithreading session 9 - shanmugam
Navaneethan Naveen
 
.NET Multithreading/Multitasking
Sasha Kravchuk
 
Multi threading
Maryam Ansari
 
Pawan industrial training presentation on Hadoop, Clustering and Network virt...
PAWANNAYAK15
 
Introduction+To+Java+Concurrency
King's College London
 
Python Training in Bangalore | Multi threading | Learnbay.in
Learnbayin
 
.NET: Thread Synchronization Constructs
Sasha Kravchuk
 
Multi-Threading
Robert MacLean
 
Smalltalk in a .NET World
ESUG
 
Threads c sharp
Karthick Suresh
 
Chainer v2 and future dev plan
Seiya Tokui
 
Multithreading 101
Tim Penhey
 
Chainer v2 alpha
Seiya Tokui
 
Introduction to ns2
Pradeep Kumar TS
 
Threading in C#
Medhat Dawoud
 

Similar to Tutorial 4 adding some details (20)

PDF
Computer Networks Omnet
Shivam Maheshwari
 
PDF
Open Dayligth usando SDN-NFV
Open Networking Perú (Opennetsoft)
 
PPTX
An Introduction to OMNeT++ 5.1
Alpen-Adria-Universität
 
PDF
An Introduction to OMNeT++ 5.4
Alpen-Adria-Universität
 
PDF
Deep Learning in theano
Massimo Quadrana
 
PDF
Introduction to OMNeT++
Md. Mahedee Hasan
 
DOCX
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
felicidaddinwoodie
 
PPT
Suyash Thesis Presentation
Tanvee Katyal
 
PPTX
An Introduction to OMNeT++ 6.0
Alpen-Adria-Universität
 
PPT
Inter process communication
Mohd Tousif
 
PPT
Tech talk
Preeti Patwa
 
PDF
Embedded c
Nandan Desai
 
PPT
Extending ns
yogiinmood
 
DOCX
Mca2050 computer architecture
smumbahelp
 
PDF
genalg
Oliver Fishstein
 
PDF
CE150--Hongyi Huang
Bridget (Hongyi) Huang
 
PDF
6. TinyOS_2.pdf
Jesus Cordero
 
PPTX
Matlab-3.pptx
aboma2hawi
 
PPS
Mote Mote Radio Communication
Ankit Singh
 
PPT
Mirage: ML kernels in the cloud (ML Workshop 2010)
Anil Madhavapeddy
 
Computer Networks Omnet
Shivam Maheshwari
 
Open Dayligth usando SDN-NFV
Open Networking Perú (Opennetsoft)
 
An Introduction to OMNeT++ 5.1
Alpen-Adria-Universität
 
An Introduction to OMNeT++ 5.4
Alpen-Adria-Universität
 
Deep Learning in theano
Massimo Quadrana
 
Introduction to OMNeT++
Md. Mahedee Hasan
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
felicidaddinwoodie
 
Suyash Thesis Presentation
Tanvee Katyal
 
An Introduction to OMNeT++ 6.0
Alpen-Adria-Universität
 
Inter process communication
Mohd Tousif
 
Tech talk
Preeti Patwa
 
Embedded c
Nandan Desai
 
Extending ns
yogiinmood
 
Mca2050 computer architecture
smumbahelp
 
CE150--Hongyi Huang
Bridget (Hongyi) Huang
 
6. TinyOS_2.pdf
Jesus Cordero
 
Matlab-3.pptx
aboma2hawi
 
Mote Mote Radio Communication
Ankit Singh
 
Mirage: ML kernels in the cloud (ML Workshop 2010)
Anil Madhavapeddy
 
Ad

Recently uploaded (20)

PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Français Patch Tuesday - Juillet
Ivanti
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
July Patch Tuesday
Ivanti
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Français Patch Tuesday - Juillet
Ivanti
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Ad

Tutorial 4 adding some details

  • 2.  Let every node send a packet periodically.  How? Time to go to C++ files.  The model behavior is defined by the user as C++ code. The class has to be registered with OMNeT++ via the Define_Module() macro. The Define_ Module() line should always be put into .cc or .cpp files and not header file (.h).
  • 3. 1) initialize(). This method is invoked after OMNeT++ has set up the network. 2) handleMessage(cMessage *msg). It is invoked with the message as parameter whenever the module receives a message. handleMessage() is expected to process the message, and then return. 3) finish(). It is called when the simulation has terminated successfully, and its recommended use is the recording of summary statistics.
  • 4.  The message can arrive: 1. From another module or 2. From the same module (self-messages are used to implement timers).
  • 5.  Add the following code in Node.cc Why??
  • 6.  Each node has a limited energy (e,g.; 100mW).  Each transmission operation consumes energy (e.g.; 0.8mW per transmission).  Make the initial energy variable.  Make the transmission interval variable.  When a node cannot transmit a packet (the remaining energy is less than 0.8mW), then it stops sending data (dies).
  • 8. 2. Modifying .h file Is it important??
  • 10. 3. Modifying .cc file Sir, Can I use CTRL+SHIFT+F and CTRL+SPACE here?
  • 11. 3. Modifying .cc file Sir, Can I use CTRL+SHIFT+F Thanks!! and CTRL+SPACE here?
  • 12.  Be sure that the previous run was closed.  Run the experiment, every thing should work fine.  The events are shown in the Tkenv view.  Inspect the network  By double-clicking on either node1 or node 2, we can see the detailed implementation of our Nodes.  But the variables (tx_interval and energy) are not there.  To watch them, add WATCH(var) statement
  • 13.  OMNeT++ provides WATCH() and a set of other macros to allow variables to be inspectable in Tkenv.  Always put watches in initialize()  Syntax: WATCH(var) Save and Rebuild
  • 14.  In previous experiments, we were using the default values of both Tx_interval and Energy.  Using different parameters can be achieved using the INI file.  Open “omnetpp.ini” file.  There are two modes, open the Source mode.
  • 15.  In previous experiments, we were using the default values of both Tx_interval and Energy.  Using different parameters can be achieved using the INI file.  Open “omnetpp.ini” file.  There are two modes, open the Source mode.
  • 16.  Models can have a large number of parameters to be configured, and it would be tedious to set them one- by-one in omnetpp.ini.  OMNeT++ supports wildcard patterns which allow for setting several model parameters at once.
  • 17.  Assume we want to test our system (Node) with two types of traffic: high and low. We can create a separate section for each type as follows:  For every run, we need to select a specific ‘Config name’ .