Sending custom data in ping payload in INET implementation of AODV protocol

507 views
Skip to first unread message

Avinash Chauhan

unread,
Apr 6, 2016, 11:47:16 AM4/6/16
to OMNeT++ Users
Respected all,

I intend to use AODV protocol to route simple data packets between a set of nodes in a custom network. To meet that requirement, I tried including INET in my omnet++ project references and additionally, copied the code files for Ping App (which is being used by AODV protocol) into my project space.

My initial aim was to:
1) Update the Ping Payload .msg file to hold floating point values in an array. This gave errors on building the omnet++ project. "PingPayload_m.hh" and "PingPayload_m.cc" self generated files do not make the corresponding get and set methods for the newly added properties. Note that I copied the code files related to PingApp into my project so that any code changes made in those files do not reflect in the INET project and are local to my omnet++ project
2) Next I tried encapsulating my float temperature values inside the unsigned char array provided by PingPayload. In the PingApp::sendPing() method inside the PingApp.cc file, I create an unsigned array that holds my temperature value as a char array. I then assign the first element of this array to the PingPayload packet using the following line of code: "msg->setData(0, darray[0])". The objective was to transport a number 3 as a "3" inside the char array of the ping payload. This throws the following error: "Array of size 0 indexed by 0". The sense it gives me is that the ping payload array defined by the PingPayload.msg is not initialized. How do I initialize it with some space so that it can hold on the value I send?

I am new to C++ and OMNET++.
* My objective is to send some custom data inside the ping payload packet used by the Ping App application in INET.
* My overall objective is to send my custom data in my separate omnet++ project through AODV protocol. Now this protocol in the INET sample examples uses ping packets. Hence I want to firstly see if I can keep my custom data inside the Ping App packet, and then hope for this packet to be transferred between my nodes (which shall be of the type AODVRouter) using the AODV protocol.

I am not very sure if the language used by me maintains the decorum of the group and I am sorry if it does not. Looking forward to any leads on the issues I have mentioned. Thanking you in advance.

Avinash Chauhan

unread,
Apr 19, 2016, 7:06:51 AM4/19/16
to OMNeT++ Users
I am now able to send custom data inside PingApp packets. I have also made a simple project that refers INET projects and have copied the code for PingApp.cc in my project namespace to customize it to send custom data. The .ned file of my project uses AODVRouter.ned that refers to a WirelessHost which refers to a StandardHost which is inside my project namespace and uses my custom PingApp implementation.

The next requirement is to have a cluster head which is a node with a integer address but which should extend an AODVRouter. The problem is that the AODVRouter works with string addresses and I do not know where would I have to map the address from a string address to an int address. Any leads on this will be most helpful. Thanks in advance.

Muddasir Rahim

unread,
Apr 19, 2016, 11:45:27 AM4/19/16
to omn...@googlegroups.com
inbox me



--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.


Message has been deleted

Avinash Chauhan

unread,
May 30, 2016, 7:06:42 AM5/30/16
to OMNeT++ Users, muddas...@yahoo.com
Hello Muddasir,

Where do I inbox you separately? I do not find any option of that kind here.

Salma El-shaarawi

unread,
Feb 20, 2019, 3:55:54 AM2/20/19
to OMNeT++ Users
plz could u help me in clustering using inet.i'm new to this 
Reply all
Reply to author
Forward
0 new messages