I, too, faced a similar problem in my code albeit in a different 
scenario, but have been able to solve it after some thought. The root of 
the issue turned out to be a simple case of negligence on my part.

The error messages come from the file mac/phy.cc (line# 138 in ns-2.35), 
when the physical layer notices that the HDR_CMN(incoming_packet)-> 
direction is set to the value 0, even though you must have explicitly 
set the value to hdr_cmn::UP or hdr_cmn::DOWN. For me, this was 
happening because I did a free(packet) right after I called 
Scheduler::instance.schedule(...) to forward the packet. The 
schedule(...) function merely inserts an event in the event queue, so if 
the packet gets freed up by the time the event gets dispatched, its 
direction value would automatically disappear. I removed this line, and 
freed the packet in the receive action; consequently, the problem was 
removed.

Hope this helps,
Dhrubo.

-- 
Dhrubojyoti Roy
PhD Student (2nd year)
Department of Computer Science and Engineering,
The Ohio State University,
2015 Neil Avenue,
Columbus, OH-43210.
+1-740-417-5890

Reply via email to