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

Networking concepts
Networking conceptsNetworking concepts
Networking conceptsritajindal2
 
Mqtt(Message queue telemetry protocol) presentation
Mqtt(Message queue telemetry protocol) presentation Mqtt(Message queue telemetry protocol) presentation
Mqtt(Message queue telemetry protocol) presentation Piyush Rathi
 
Kelompok 3 tiga lantai 4 ruangan masing-masing lantai
Kelompok 3 tiga lantai 4 ruangan masing-masing lantaiKelompok 3 tiga lantai 4 ruangan masing-masing lantai
Kelompok 3 tiga lantai 4 ruangan masing-masing lantaiWilly Winas
 
MQTT
MQTTMQTT
MQTTESUG
 
A Network Of Networks For Slide Share
A Network Of Networks For Slide ShareA Network Of Networks For Slide Share
A Network Of Networks For Slide Shareitsvineeth209
 
Message queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatMessage queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatHamdamboy (함담보이)
 
Building Powerful IoT Apps with AWS IoT and Websockets
Building Powerful IoT Apps with AWS IoT and WebsocketsBuilding Powerful IoT Apps with AWS IoT and Websockets
Building Powerful IoT Apps with AWS IoT and WebsocketsAmazon Web Services
 
Low Latency Mobile Messaging using MQTT
Low Latency Mobile Messaging using MQTTLow Latency Mobile Messaging using MQTT
Low Latency Mobile Messaging using MQTTHenrik Sjöstrand
 
Cisco packet tracer router
Cisco packet tracer  routerCisco packet tracer  router
Cisco packet tracer routerrishi ram khanal
 
Social messenger introduction
Social messenger introductionSocial messenger introduction
Social messenger introductiondeepakrajput022
 
CCCNA R&S-03-Fundamentals of Ethernet LANs
CCCNA R&S-03-Fundamentals of Ethernet LANsCCCNA R&S-03-Fundamentals of Ethernet LANs
CCCNA R&S-03-Fundamentals of Ethernet LANsAmir Jafari
 

What's hot (16)

Introduction to OMNeT++
Introduction to OMNeT++Introduction to OMNeT++
Introduction to OMNeT++
 
Networking concepts
Networking conceptsNetworking concepts
Networking concepts
 
NS3 Overview
NS3 OverviewNS3 Overview
NS3 Overview
 
Mqtt(Message queue telemetry protocol) presentation
Mqtt(Message queue telemetry protocol) presentation Mqtt(Message queue telemetry protocol) presentation
Mqtt(Message queue telemetry protocol) presentation
 
MQTT Introduction
MQTT IntroductionMQTT Introduction
MQTT Introduction
 
IPC with Qt
IPC with QtIPC with Qt
IPC with Qt
 
Kelompok 3 tiga lantai 4 ruangan masing-masing lantai
Kelompok 3 tiga lantai 4 ruangan masing-masing lantaiKelompok 3 tiga lantai 4 ruangan masing-masing lantai
Kelompok 3 tiga lantai 4 ruangan masing-masing lantai
 
MQTT
MQTTMQTT
MQTT
 
A Network Of Networks For Slide Share
A Network Of Networks For Slide ShareA Network Of Networks For Slide Share
A Network Of Networks For Slide Share
 
Message queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatMessage queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message format
 
Building Powerful IoT Apps with AWS IoT and Websockets
Building Powerful IoT Apps with AWS IoT and WebsocketsBuilding Powerful IoT Apps with AWS IoT and Websockets
Building Powerful IoT Apps with AWS IoT and Websockets
 
Low Latency Mobile Messaging using MQTT
Low Latency Mobile Messaging using MQTTLow Latency Mobile Messaging using MQTT
Low Latency Mobile Messaging using MQTT
 
Ptt softswitch
Ptt softswitchPtt softswitch
Ptt softswitch
 
Cisco packet tracer router
Cisco packet tracer  routerCisco packet tracer  router
Cisco packet tracer router
 
Social messenger introduction
Social messenger introductionSocial messenger introduction
Social messenger introduction
 
CCCNA R&S-03-Fundamentals of Ethernet LANs
CCCNA R&S-03-Fundamentals of Ethernet LANsCCCNA R&S-03-Fundamentals of Ethernet LANs
CCCNA R&S-03-Fundamentals of Ethernet LANs
 

Viewers also liked

Tutorial 4 adding some details
Tutorial 4   adding some details Tutorial 4   adding some details
Tutorial 4 adding some details Mohd Batati
 
Tutorial 3 getting started with omnet
Tutorial 3   getting started with omnetTutorial 3   getting started with omnet
Tutorial 3 getting started with omnetMohd Batati
 
Tutorial 1 installing mixim and mixnet
Tutorial 1   installing mixim and mixnetTutorial 1   installing mixim and mixnet
Tutorial 1 installing mixim and mixnetMohd Batati
 
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++Mohd Batati
 
Tutorial 6 queues & arrays & results recording
Tutorial 6   queues & arrays & results recording Tutorial 6   queues & arrays & results recording
Tutorial 6 queues & arrays & results recording Mohd Batati
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Pradeep Kumar TS
 
Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network Ahmed Nour
 

Viewers also liked (11)

Tutorial 4 adding some details
Tutorial 4   adding some details Tutorial 4   adding some details
Tutorial 4 adding some details
 
Tutorial 3 getting started with omnet
Tutorial 3   getting started with omnetTutorial 3   getting started with omnet
Tutorial 3 getting started with omnet
 
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
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)
 
Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network
 
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++
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 

Similar to Modifying Node Code to Add Custom Packet Headers

maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazineMax Kleiner
 
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 Python Ireland
 
MQTT enabling the smallest things
MQTT enabling the smallest thingsMQTT enabling the smallest things
MQTT enabling the smallest thingsIan Craggs
 
DMKit_2.0_README_1
DMKit_2.0_README_1DMKit_2.0_README_1
DMKit_2.0_README_1ibtesting
 
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 M2MBenjamin Cabé
 
WiMAX implementation in ns3
WiMAX implementation in ns3WiMAX implementation in ns3
WiMAX implementation in ns3Mustafa Khaleel
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..cscarcas
 
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 QEWDRob Tweed
 
CloudStack and cloud-init
CloudStack and cloud-initCloudStack and cloud-init
CloudStack and cloud-initMarcusS13
 
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 ContentAlpen-Adria-Universität
 
MQTT in Reactive Blocks
MQTT in Reactive BlocksMQTT in Reactive Blocks
MQTT in Reactive BlocksBitreactive
 
Jafka guide
Jafka guideJafka guide
Jafka guideAdy Liu
 
Maxbox starter18
Maxbox starter18Maxbox starter18
Maxbox starter18Max Kleiner
 

Similar to Modifying Node Code to Add Custom Packet Headers (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
 
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
 
An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0
 
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

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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 WorkerThousandEyes
 
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
 
[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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
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
 
[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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Modifying Node Code to Add Custom Packet Headers

  • 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