A simple project with inet

86 views
Skip to first unread message

Ghobad Zarrinchian

unread,
Aug 25, 2014, 3:12:17 PM8/25/14
to omn...@googlegroups.com
Hi all
I'm a new user in inet framework and want to use this framework to implement a simple scenario. I have installed inet and i know how to import it to my project but i don't know how to proceed further. I know that this scenario may seems too simple to implement and can be done with a short review of inet document. But i don't have much time to study the document. So please help me and provide me a step-by-step procedure to do the simulation.

The scenario is:

I have 4 nodes, each with a specific IP address.
  for example: node1:"10.10.10.10" , node2:"10.10.10.11" , node3:"10.10.10.12" , and node4:"10.10.10.13".

These nodes must be connected to each other using a simple router.
I want to create a simple message with a specific name like the one showed below:
cMessage *msg=new cMessage("my_msg");    (cPacket can be used as well)

Assume that we want to create the above message in node1 and send it to node 2 through the network. node2 receives the message and performs a specific operation. For example, send a message to node3 or to node4 or sends an ack back to node1. All communications in my scenario are under internet protocol (TCP/IP).

Please help me to implement the network and provide me required procedure to do it, such as setting ip addresses, delivering the created packet in node1 to the standard host to send through the network, and every other important steps.

Mohsen Sichani

unread,
Aug 26, 2014, 1:28:36 AM8/26/14
to omn...@googlegroups.com
Hi Ghobad, 

Your project is not very simple as it looks to me especially cmessage part. it needs lots of modification. 
To be honest, I think it is better to be more specific.

You can find many example in example folder of inet,



Good luck

cheers
Mohsen

Ghobad Zarrinchian

unread,
Aug 26, 2014, 1:40:11 AM8/26/14
to omn...@googlegroups.com
Thanks for your reply. My problem is mainly concerned about how to code a specific application for a standard host. i.e. how to create a packet at a specific time and determine its destination node. I want to code my own traffic generator in a Standard Host and determine it's inter-arrival time distribution.
Regards


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

Ghobad Zarrinchian

unread,
Aug 26, 2014, 1:41:15 AM8/26/14
to omn...@googlegroups.com
I don't know which file should i edit to change the default application of a node.

Mohsen Sichani

unread,
Aug 26, 2014, 2:22:02 AM8/26/14
to omn...@googlegroups.com
What do u mean by default application?


If you want that decision to be made in network layer, you should modify the network layer, In you example (because you have mentioned ack), Transport layer is a candidate


You received this message because you are subscribed to a topic in the Google Groups "omnetpp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/MfjpmOw4Ph0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.

Mohsen Sichani

unread,
Aug 26, 2014, 2:23:48 AM8/26/14
to omn...@googlegroups.com
it seems you want to do sth in App layer,

Plz take a look at 

or the application src, either tcpapp or udpapp,....



--
You received this message because you are subscribed to a topic in the Google Groups "omnetpp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/MfjpmOw4Ph0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.

Ghobad Zarrinchian

unread,
Aug 26, 2014, 2:46:50 AM8/26/14
to omn...@googlegroups.com
Yes i want to work in Application layer. As i said in my scenario, when a node (given node 2) receives a packet, it should perform a specific operation based on the received packet. For example, it should send another packet to node3 or node4. In a typical omnetpp projects without inet framework, there is a function called "HandleMessage( )" which we can use to code what is needed. I want to know where we should make such decisions in an inet standard host? how can i define application layer behavior?

Michael Kirsche

unread,
Aug 26, 2014, 3:48:29 AM8/26/14
to omn...@googlegroups.com
Every simple module has a handleMessage() function.
As Mohsen wrote, check the INET/INETMANET examples!
They use a TCP/IP stack, where usually an application layer module or protocol is used to "generate traffic".
In your case, you want to either modify or write your own TCP/UDP application module. There are various modules available, you can even go down and use an IPvxTrafficGenerator. It all depends on what protocols you want to use and where exactly you want to hook in inside the protocol stack.

Ghobad Zarrinchian

unread,
Aug 26, 2014, 4:44:25 AM8/26/14
to omn...@googlegroups.com
It seems that IPTrafficGenerator is not a simple module. It's an interface module and i don't know how to access and manipulate its "HandleMessage()" function. Could you please help me doing this? Thanks.

Michael Kirsche

unread,
Aug 26, 2014, 7:29:39 AM8/26/14
to omn...@googlegroups.com
And why didn't you simply check the implementation of the interface class/module?

There are two other simple modules in the same folder: IPvXTrafGen and IPvXTrafSink.
Each with their own NED and .cc/.h files.

You could change those modules and use them or subclass from the interface module and create your own IP traffic generator.
Reply all
Reply to author
Forward
0 new messages