Migrating to INET 4.2.5 - Sending a cMessage as a cPacketChunk

260 views
Skip to first unread message

Alberto Núñez

unread,
Jun 11, 2021, 12:14:11 PM6/11/21
to OMNeT++ Users
Hi!

I am migrating the SIMCAN simulation framework -- currently working in omnet++ 5.2.1 and INET 3.6.4 -- to omnet 6 and INET 4.2.5. 

The code compiles well but I am having difficulties to send messages through TcpSocket. In the previous versions of INET, a cMessage could be sent through a TcpSocket using socket->send(). However, in the current version of INET, I need to 'include' a cMessage object in a Packet using the cPacketChunk object. I have read the documentation, and the migration guide, but I could not find the answer for this. 

How can I insert/obtain a cMessage object from/to the Packet object?

Any help would be appreciated! ;)

Thanks a lot,
Alberto
 

Rudolf Hornig

unread,
Jun 14, 2021, 8:30:27 AM6/14/21
to OMNeT++ Users
You cannot send cMessage in a Packet. You are sending Chunks (which are a representation of bytes) in a Packet. i.e. application data is also have to be represented as a Chunk not as a message. i.e. you extend FieldsChunk instead of Message when you define your application data. See how it is done in other applications (search for *.msg files in the inet/applications folders)

Alberto Núñez

unread,
Jun 16, 2021, 6:07:10 AM6/16/21
to OMNeT++ Users
Hi Rudolf,

Thanks for the help! I am creating custom messages -- extending from the FieldsChunk class -- and now I can send data through TCP sockets. Its a start ;) Now I have to serialize all the data...

Bests,
Alberto

Shivani Nazare

unread,
Jun 24, 2021, 2:13:50 PM6/24/21
to OMNeT++ Users
 I encountered this error when i was running Simu5G example . What may be the reason? 

18:03:49 **** Incremental Build of configuration gcc-debug for project simu5G ****
make MODE=debug -j4 all 
make[1]: Entering directory '/e/omnetpp-5.6.2-src-windows/omnetpp-5.6.2/samples/Simu5G-1.1.0/Simu5G-1.1.0/src'
MSGC: apps/cbr/CbrPacket.msg
MSGC: apps/d2dMultihop/MultihopD2DPacket.msg
MSGC: apps/alert/AlertPacket.msg
MSGC: apps/burst/BurstPacket.msg
apps/alert/AlertPacket.msg:16: Error: cannot resolve import 'inet.common.INETDefs'
apps/alert/AlertPacket.msg:17: Error: cannot resolve import 'inet.common.packet.chunk.Chunk'
apps/alert/AlertPacket.msg:20: Error: 'AlertPacket': unknown base class 'inet::FieldsChunk'
apps/d2dMultihop/MultihopD2DPacket.msg:12: Error: cannot resolve import 'inet.common.INETDefs'
apps/d2dMultihop/MultihopD2DPacket.msg:13: Error: cannot resolve import 'inet.common.packet.chunk.Chunk'
apps/d2dMultihop/MultihopD2DPacket.msg:14: Error: cannot resolve import 'inet.common.geometry.Geometry'
apps/d2dMultihop/MultihopD2DPacket.msg:27: Error: 'MultihopD2DPacket': unknown base class 'inet::FieldsChunk'
apps/d2dMultihop/MultihopD2DPacket.msg:31: Error: unknown type 'inet::Coord' for field 'srcCoord' in 'MultihopD2DPacket'
apps/d2dMultihop/MultihopD2DPacket.msg:42: Error: Unknown field 'chunkLength' (not found in any super class)
apps/burst/BurstPacket.msg:12: Error: cannot resolve import 'inet.common.INETDefs'
apps/burst/BurstPacket.msg:13: Error: cannot resolve import 'inet.common.packet.chunk.Chunk'
apps/burst/BurstPacket.msg:20: Error: 'BurstPacket': unknown base class 'inet::FieldsChunk'
make[1]: *** [Makefile:334: apps/d2dMultihop/MultihopD2DPacket_m.h] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:334: apps/burst/BurstPacket_m.h] Error 1
make[1]: *** [Makefile:334: apps/alert/AlertPacket_m.h] Error 1
apps/cbr/CbrPacket.msg:16: Error: cannot resolve import 'inet.common.INETDefs'
apps/cbr/CbrPacket.msg:17: Error: cannot resolve import 'inet.common.packet.chunk.Chunk'
apps/cbr/CbrPacket.msg:19: Error: 'CbrPacket': unknown base class 'inet::FieldsChunk'
make[1]: *** [Makefile:334: apps/cbr/CbrPacket_m.h] Error 1
make[1]: Leaving directory '/e/omnetpp-5.6.2-src-windows/omnetpp-5.6.2/samples/Simu5G-1.1.0/Simu5G-1.1.0/src'
make: *** [Makefile:2: all] Error 2
"make MODE=debug -j4 all" terminated with exit code 2. Build might be incomplete.

Alfonso Ariza Quintana

unread,
Jun 25, 2021, 5:45:30 AM6/25/21
to omn...@googlegroups.com
Which version of inet are you using?

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Shivani Nazare <shivanin...@gmail.com>
Enviado: jueves, 24 de junio de 2021 20:13
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] Re: Migrating to INET 4.2.5 - Sending a cMessage as a cPacketChunk
 
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/7212b38e-5516-414a-9da0-f1e166d265a8n%40googlegroups.com.

Shivani Nazare

unread,
Jun 25, 2021, 6:37:41 AM6/25/21
to omn...@googlegroups.com
Omnet version 5.6.2 and INET version 4.2.2 

Alfonso Ariza Quintana

unread,
Jun 25, 2021, 6:58:18 AM6/25/21
to omn...@googlegroups.com
I suspect that the project that you are using is for inet 4.3.2

Enviado: viernes, 25 de junio de 2021 12:37
Para: omn...@googlegroups.com <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] Re: Migrating to INET 4.2.5 - Sending a cMessage as a cPacketChunk
 

Shivani Nazare

unread,
Jun 25, 2021, 7:40:27 AM6/25/21
to omn...@googlegroups.com
The installation guide said that we require INETv4.2.2 

Screenshot_2021-06-25-17-09-00-51.jpg

Kamalluddeen Usman

unread,
Oct 11, 2023, 6:44:45 AM10/11/23
to OMNeT++ Users
Hello have you solved the problem?? because I am facing similar issue now.

veins_inet/VeinsInetSampleMessage.msg:27: Error: cannot resolve import 'inet.common.INETDefs'
veins_inet/VeinsInetSampleMessage.msg:28: Error: cannot resolve import 'inet.common.packet.chunk.Chunk'
veins_inet/VeinsInetSampleMessage.msg:34: Error: 'VeinsInetSampleMessage': unknown base class 'inet::FieldsChunk'
make[1]: *** [Makefile:145: veins_inet/VeinsInetSampleMessage_m.h] Error 1
make[1]: Leaving directory '/c/Vanet/Vanettest/src'

make: *** [Makefile:2: all] Error 2
"make MODE=release all" terminated with exit code 2. Build might be incomplete.
Reply all
Reply to author
Forward
0 new messages