Message serialization

161 views
Skip to first unread message

Dragos Ilie

unread,
Feb 25, 2022, 5:09:04 PM2/25/22
to omn...@googlegroups.com
Hi,

I have defined an INET message that extends FieldsChunk. It appears to work fine as is. I have then written a message serializer extending FieldsChunkSerializer (public). The serializer is registered using Register_Serializer in the .cc file (trying to follow the approach from AODV and DSDV). I can compile the simulation without warnings and messages are being exchanged OK during simulation, as far I can tell. However, the serializer and deserializer methods do not appear to be invoked (I have a couple of EV_INFO and std:cout printouts that don’t show show either in the simulation output or in the console output).

Under which circumstances is serialization invoked? “Who" is calling my serialization methods? Do I need to do anything special to get enable serialization or should it just work automatically?

Thanks,
Dragos


Levente Mészáros

unread,
Feb 28, 2022, 2:36:43 AM2/28/22
to OMNeT++ Discussion List
Packet serialization is not used unless the actual bytes sent on the network are needed. The reason is that this operation is expensive and most of the time is not necessary for the simulation to conclude. There are two cases currently where serialization is used: emulation and recording a PCAP file. So unless you are using one or the other, your serialization code will not be called. You can find showcases that describe how to use emulation or PCAP recording. Besides, there are ways to serialize a packet explicitly from C++, you can find examples in the INET Developer's Guide.

Regards,
levy

--
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/C37CFEA3-0745-477B-843F-EF813CB05940%40gmail.com.

Dragos Ilie

unread,
Feb 28, 2022, 9:29:39 AM2/28/22
to omn...@googlegroups.com
Thanks Levy! I can stop now from banging my head against the wall over why serialization was not triggered. I was under the false impression that it is used during transmission

Best regards,
Dragos

Lakshmi Krishnaswamy

unread,
Feb 15, 2024, 12:33:30 PM2/15/24
to OMNeT++ Users
Thank you for this discussion! This is helpful, and wanted some guidance on something related. I am not explicitly invoking serialization part of my simulation - however in certain scenario, I get this error message which seems to be triggered from Ipv4HeaderSerializer.cc : "Cannot serialize Ipv4 Header without a properly computed CRC".
Now, my CRC through all simulations is set to 1, which translates to CRC_DECLARED_CORRECT (not serializable), so I dont know why this  Ipv4HeaderSerializer.cc is being called in the first place. Any guidance or steps to debug would be extremely helpful!!!! 

Reply all
Reply to author
Forward
0 new messages