Adding variable sized data and a header to packet

101 views
Skip to first unread message

kaisar

unread,
Sep 10, 2014, 10:05:59 AM9/10/14
to ns-3-...@googlegroups.com
Hi,

I am a trying to add variable sized payload data and my own header to a packet. I have implemented the packet header class separately. Whenever I try to add header or payload data separately, it works fine. However, if I try to add the data first and then later the header it seems somehow the header overwrites(!) the data as well. The size of the packet shows it has all the bytes written to. However, I can't access the data. I can only read the header portion. Any Suggestion ? I am working on a deadline so an early response would be much appreciated.

thanks
kaisar

Tommaso Pecorella

unread,
Sep 10, 2014, 10:33:54 AM9/10/14
to ns-3-...@googlegroups.com
Hi,

without the code I can only guess, and my guess is: your header Deserialize method is bugged.
A more precise guess is: you are deserializing the header and you "know" the header's size from the packet's length (a design flaw).

Cheers,

T.

kaisar

unread,
Sep 10, 2014, 10:21:39 PM9/10/14
to ns-3-...@googlegroups.com
Thanks a lot Tommaso. I found the bug. :) 
Reply all
Reply to author
Forward
0 new messages