Chunk error

93 views
Skip to first unread message

AB

unread,
Jul 11, 2022, 12:54:22 PM7/11/22
to OMNeT++ Users
Screenshot 2022-07-11 18:42:22.png

Hi,
I got the above packet at the app layer and am trying to run

Packet* pPacket = check_and_cast<Packet*>(msg);
auto voipHeader = pPacket->popAtFront<VoipPacket>();

which causes the following error:


A runtime error occurred:
Returning an empty chunk is not allowed according to the flags: 0 -- at t=6.077s, event #56870



Can anyone help? The Ipv4Header is  also stored in the content section.

Thanks!

Alfonso Ariza Quintana

unread,
Jul 12, 2022, 4:38:27 AM7/12/22
to omn...@googlegroups.com
The figure that are you showing only has the header LTE, IP, and UDP, it doesn't have VoipPacket header

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de AB <a.b...@web.de>
Enviado: lunes, 11 de julio de 2022 18:54
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] Chunk error
 
--
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/1d590fc9-ff9f-4428-9acf-e5e350e35fbdn%40googlegroups.com.
Message has been deleted

AB

unread,
Jul 12, 2022, 5:10:47 AM7/12/22
to OMNeT++ Users
Yes. I am sorry. I got confused by the popAtFront()  and the  section of the packet being called "front".
Please note that I am trying to run: popAtFront<VoipPacket>();
This is what a normal packet looks like that can be read with pPacket->popAtFront<VoipPacket>() :

It does not have a VoipHeader section either.
Instead the data section seems to carry the name "VoipPacket"

Screenshot 2022-07-12 11:08:30.png

AB

unread,
Jul 12, 2022, 5:15:30 AM7/12/22
to OMNeT++ Users

This is another picture of the packet that is causing the problems.
It has an identical name in the top line as well as in the data section.
I need to read (at least read, maybe change) the parameters stored in the data section.

Thank you for your help!
Screenshot 2022-07-12 11:12:40.png

Alfonso Ariza Quintana

unread,
Jul 12, 2022, 5:17:48 AM7/12/22
to omn...@googlegroups.com
You can imagine the packet like a queue of chunks where you can insert Chunks at the front or at the back.

You can extract the chunks at the front or at the back only
and you have the methods
peekAtFront (observe the front header)
popAtFront (observe and move to the next, but the chunk is not removed from the packet and cannot be modified)
removeAtFront (extract and remove the chunk, also all the chunk that could be in the packet before the chunk extracted are removed)

Enviado: martes, 12 de julio de 2022 11:06
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] Chunk error
 
Yes. I am sorry. I got confused by the popAtFront()  and the  section of the packet being called "front".
Please note that I am trying to run: pPacket->popAtFront<VoipPacket>();
This is what a normal packet looks like that can be read with pPacket->popAtFront<VoipPacket>() :

It does not have a VoipHeader section either.

Alfonso Ariza Quintana schrieb am Dienstag, 12. Juli 2022 um 10:38:27 UTC+2:

Alfonso Ariza Quintana

unread,
Jul 12, 2022, 5:20:07 AM7/12/22
to omn...@googlegroups.com
If it is the latest header and you don't need to modify and you will delete the packet it is better to use peekAtFront

Enviado: martes, 12 de julio de 2022 11:10
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] Chunk error
 

AB

unread,
Jul 12, 2022, 5:36:41 AM7/12/22
to OMNeT++ Users
Ok, but in the working case popAtFront<VoipPacket>()  is not reading a header, because there is non?

Alfonso Ariza Quintana

unread,
Jul 12, 2022, 6:19:45 AM7/12/22
to omn...@googlegroups.com
If the header is of the type VoipPacket pop will raise an error. If the length of the packet is 0, and you do pop, you will have an exception

Enviado: martes, 12 de julio de 2022 11:36

AB

unread,
Jul 12, 2022, 8:06:45 AM7/12/22
to OMNeT++ Users
Its working now.
Gracias
Reply all
Reply to author
Forward
0 new messages