Bugzilla – Bug 78
OLSR & ascii tracing triggers assertion: packet-metadata.cc, line=1043, cond="GetTotalSize () == data.GetSize ()"
Last modified: 2007-09-24 11:13:19 UTC
1. clone http://code.nsnam.org/gjc/ns-3-olsr/ 2. Go to examples/simple-point-to-point-olsr.cc, line 215, change #if 0 to #if 1 (to enable ascii tracing) 3. run the olsr example: NS_DEBUG=OlsrAgent waf --run simple-point-to-point-olsr Result: OLSR node 10.1.1.1 sending a OLSR packet assert failed. file=../src/common/packet-metadata.cc, line=1043, cond="GetTotalSize () == data.GetSize ()" It would be nice to not have to disable Ascii Tracing for OLSR...
It seems this bug in particular is caused by PacketMetadata::Enable () being called in the middle of a simulation, after the first packet was sent. In my example I was starting the OLSR agents before enabling ascii tracing. Explanation: the OLSR agent receives a packet, creates a subset of the packet, and later retransmits it to other nodes, it happens in this case that it receives a packet with no metadata, and tries to re-transmit it with new prepended headers, thereby triggering the assertion, because by then we have a packet with only partial metadata. I'll try to come up with a patch to detect this particular case and give a clear error message explaining what to do (calling PacketMetadata::Enable () at the top solves this problem).
Committed http://code.nsnam.org/ns-3-dev/rev/648048bca501