SlideShare a Scribd company logo
1 of 17
By
Mohammed Amer Al-Batati

         2012
 In our network we can’t add more than two nodes.
 The reason is that, Node.ned defines only one input
  gate and one output gate.
 The solution is to use gate vectors instead of single
  gates.



 A more advanced solution is to use inout gate, which
  is basically an input and an output gate glued together.
 Let’s modify our plan. When a node decides to
 transmit a message, it have to select a random
 destination. Therefore, we need to modify Node.cc
 file.
 Goto to “mynetwork”-> add more nodes -> connect
 them to each other then run the experiment. As
 follows:
 Depending on the model domain, message objects
  represent events, packets, commands, jobs, customers
  or other kinds of entities.
 There are cMessage and cPacket Classes.
 The cPacket class extends cMessage.
 cPacket is used for network packets (frames,
  datagrams,     transport    packets,  etc.)   in   a
  communication network, and cMessage is used for
  everything else.
   For   example, encapsulation and         decapsulation
    operations are only used with cPacket.
 cMessage *msg = new cMessage();
 cMessage *msg = new cMessage("timer");
 cMessage *msg = new cMessage("timer", kind);
 msg->setKind( kind );
 msg->setBitLength( length );
 msg->setTimestamp( simtime );
 int K = msg->getKind();
 int L = msg->getBitLength();
 simtime_t T = msg->getTimestamp();
 …etc
 cMessage *copy = msg->dup();




                                 … one slide…
                                  …one line…
 Example

    IP


   MAC




 MAC        IP
 Inspecting cMessage objects (previous code).
 Modify Node.cc code to include the encapsulation
  example.




 Save, build and run.
 Inspecting cPacekt objects (new code).
 Example
 Assume that the following cPacket was received as
 “MACdata”.
                 MAC         IP



 After using the following decapsulation statement:




            IP                       MAC
 Assume that you want to add your own header
 between IP and MAC.

                       MyHeader


                 MAC              IP




          Name            ID           Year
 Assume that you want to add your own header
 between IP and MAC.

                       MyHeader


                 MAC              IP




          Name            ID           Year
 From Project Explorer: right-click on myproject ->
  New -> Message Definition (.msg) -> name it
  (myHeader) -> Next -> Select New Message File ->
  Next -> Finish.
 Add our fields:




 Save and Build.
 OMNet++ generates .cc and .h (myHeader_m.cc and
  myHeader_m.h).
 Your needs are generated.




 How to use it.
 To use your new message:           At Node.cc

    1. Include the needed header.
    2. Use “myHeader” as “cPacket”
    3. That is it!
    Insert it between IP and MAC

More Related Content

What's hot

Embarqués temps réel
Embarqués temps réelEmbarqués temps réel
Embarqués temps réel
mikhailether
 
Cour systeme d'exploitation sghaier anouar
Cour systeme d'exploitation sghaier anouarCour systeme d'exploitation sghaier anouar
Cour systeme d'exploitation sghaier anouar
Anouar Sghaier
 

What's hot (20)

An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0
 
Sécurité dans le cloud
Sécurité dans le cloudSécurité dans le cloud
Sécurité dans le cloud
 
Modélisation par Objets - Introduction - De Merise à UML
Modélisation par Objets - Introduction - De Merise à UMLModélisation par Objets - Introduction - De Merise à UML
Modélisation par Objets - Introduction - De Merise à UML
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)
 
Agents intelligents
Agents intelligentsAgents intelligents
Agents intelligents
 
Distributed Computing
Distributed ComputingDistributed Computing
Distributed Computing
 
Cluster Schedulers
Cluster SchedulersCluster Schedulers
Cluster Schedulers
 
Embarqués temps réel
Embarqués temps réelEmbarqués temps réel
Embarqués temps réel
 
Distributed system notes unit I
Distributed system notes unit IDistributed system notes unit I
Distributed system notes unit I
 
Task scheduling Survey in Cloud Computing
Task scheduling Survey in Cloud ComputingTask scheduling Survey in Cloud Computing
Task scheduling Survey in Cloud Computing
 
Underlying principles of parallel and distributed computing
Underlying principles of parallel and distributed computingUnderlying principles of parallel and distributed computing
Underlying principles of parallel and distributed computing
 
Data storage security in cloud computing
Data storage security in cloud computingData storage security in cloud computing
Data storage security in cloud computing
 
Design Scenario Network Analysis & Design
Design Scenario Network Analysis & Design   Design Scenario Network Analysis & Design
Design Scenario Network Analysis & Design
 
Tp n 5 linux
Tp n 5 linuxTp n 5 linux
Tp n 5 linux
 
Cour systeme d'exploitation sghaier anouar
Cour systeme d'exploitation sghaier anouarCour systeme d'exploitation sghaier anouar
Cour systeme d'exploitation sghaier anouar
 
Systèmes multi agents concepts et mise en oeuvre avec le middleware jade
Systèmes multi agents concepts et mise en oeuvre avec le middleware jadeSystèmes multi agents concepts et mise en oeuvre avec le middleware jade
Systèmes multi agents concepts et mise en oeuvre avec le middleware jade
 
La sécurité du Cloud Computing
La sécurité du Cloud ComputingLa sécurité du Cloud Computing
La sécurité du Cloud Computing
 
Problème De Sac à Dos
Problème De Sac à Dos Problème De Sac à Dos
Problème De Sac à Dos
 
OSI REFRENCE MODEL by- Mujmmil Shaikh
OSI REFRENCE MODEL by- Mujmmil ShaikhOSI REFRENCE MODEL by- Mujmmil Shaikh
OSI REFRENCE MODEL by- Mujmmil Shaikh
 

Viewers also liked (7)

Tutorial 4 adding some details
Tutorial 4   adding some details Tutorial 4   adding some details
Tutorial 4 adding some details
 
Tutorial 1 installing mixim and mixnet
Tutorial 1   installing mixim and mixnetTutorial 1   installing mixim and mixnet
Tutorial 1 installing mixim and mixnet
 
Tutorial 2 downloading and i nstalling omnet++
Tutorial 2   downloading and i nstalling omnet++Tutorial 2   downloading and i nstalling omnet++
Tutorial 2 downloading and i nstalling omnet++
 
Tutorial 6 queues & arrays & results recording
Tutorial 6   queues & arrays & results recording Tutorial 6   queues & arrays & results recording
Tutorial 6 queues & arrays & results recording
 
Traffic Classification
Traffic ClassificationTraffic Classification
Traffic Classification
 
Manual
ManualManual
Manual
 
Introduction to om ne t++
Introduction to om ne t++Introduction to om ne t++
Introduction to om ne t++
 

Similar to Tutorial 5 adding more nodes

DMKit_2.0_README_1
DMKit_2.0_README_1DMKit_2.0_README_1
DMKit_2.0_README_1
ibtesting
 
An MXM-based Application for Sharing Protected Content
An MXM-based Application for Sharing Protected ContentAn MXM-based Application for Sharing Protected Content
An MXM-based Application for Sharing Protected Content
Alpen-Adria-Universität
 

Similar to Tutorial 5 adding more nodes (20)

maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_Magazine
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
 
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
 
MQTT enabling the smallest things
MQTT enabling the smallest thingsMQTT enabling the smallest things
MQTT enabling the smallest things
 
Objective c intro (1)
Objective c intro (1)Objective c intro (1)
Objective c intro (1)
 
Extending ns
Extending nsExtending ns
Extending ns
 
Introduction to OMNeT++
Introduction to OMNeT++Introduction to OMNeT++
Introduction to OMNeT++
 
DMKit_2.0_README_1
DMKit_2.0_README_1DMKit_2.0_README_1
DMKit_2.0_README_1
 
Leveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MLeveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2M
 
WiMAX implementation in ns3
WiMAX implementation in ns3WiMAX implementation in ns3
WiMAX implementation in ns3
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..
 
6. TinyOS_2.pdf
6. TinyOS_2.pdf6. TinyOS_2.pdf
6. TinyOS_2.pdf
 
EWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWD
EWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWDEWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWD
EWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWD
 
CloudStack and cloud-init
CloudStack and cloud-initCloudStack and cloud-init
CloudStack and cloud-init
 
An MXM-based Application for Sharing Protected Content
An MXM-based Application for Sharing Protected ContentAn MXM-based Application for Sharing Protected Content
An MXM-based Application for Sharing Protected Content
 
MQTT in Reactive Blocks
MQTT in Reactive BlocksMQTT in Reactive Blocks
MQTT in Reactive Blocks
 
Jafka guide
Jafka guideJafka guide
Jafka guide
 
INET for Starters
INET for StartersINET for Starters
INET for Starters
 
An Introduction to OMNeT++ 5.4
An Introduction to OMNeT++ 5.4An Introduction to OMNeT++ 5.4
An Introduction to OMNeT++ 5.4
 
Maxbox starter18
Maxbox starter18Maxbox starter18
Maxbox starter18
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Tutorial 5 adding more nodes

  • 2.  In our network we can’t add more than two nodes.  The reason is that, Node.ned defines only one input gate and one output gate.  The solution is to use gate vectors instead of single gates.  A more advanced solution is to use inout gate, which is basically an input and an output gate glued together.
  • 3.  Let’s modify our plan. When a node decides to transmit a message, it have to select a random destination. Therefore, we need to modify Node.cc file.
  • 4.  Goto to “mynetwork”-> add more nodes -> connect them to each other then run the experiment. As follows:
  • 5.  Depending on the model domain, message objects represent events, packets, commands, jobs, customers or other kinds of entities.  There are cMessage and cPacket Classes.  The cPacket class extends cMessage.  cPacket is used for network packets (frames, datagrams, transport packets, etc.) in a communication network, and cMessage is used for everything else.  For example, encapsulation and decapsulation operations are only used with cPacket.
  • 6.  cMessage *msg = new cMessage();  cMessage *msg = new cMessage("timer");  cMessage *msg = new cMessage("timer", kind);  msg->setKind( kind );  msg->setBitLength( length );  msg->setTimestamp( simtime );  int K = msg->getKind();  int L = msg->getBitLength();  simtime_t T = msg->getTimestamp();  …etc
  • 7.  cMessage *copy = msg->dup(); … one slide… …one line…
  • 8.  Example IP MAC MAC IP
  • 9.  Inspecting cMessage objects (previous code).
  • 10.  Modify Node.cc code to include the encapsulation example.  Save, build and run.
  • 11.  Inspecting cPacekt objects (new code).
  • 12.  Example  Assume that the following cPacket was received as “MACdata”. MAC IP  After using the following decapsulation statement: IP MAC
  • 13.  Assume that you want to add your own header between IP and MAC. MyHeader MAC IP Name ID Year
  • 14.  Assume that you want to add your own header between IP and MAC. MyHeader MAC IP Name ID Year
  • 15.  From Project Explorer: right-click on myproject -> New -> Message Definition (.msg) -> name it (myHeader) -> Next -> Select New Message File -> Next -> Finish.  Add our fields:  Save and Build.
  • 16.  OMNet++ generates .cc and .h (myHeader_m.cc and myHeader_m.h).  Your needs are generated.  How to use it.
  • 17.  To use your new message: At Node.cc 1. Include the needed header. 2. Use “myHeader” as “cPacket” 3. That is it!  Insert it between IP and MAC