[Ns-bugs] [Bug 572] New: Tag offsets not updated in Packet::PeekData ()
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Fri May 22 06:23:13 PDT 2009
http://www.nsnam.org/bugzilla/show_bug.cgi?id=572
Summary: Tag offsets not updated in Packet::PeekData ()
Product: ns-3
Version: ns-3-dev
Platform: All
OS/Version: All
Status: NEW
Severity: blocker
Priority: P5
Component: simulation core
AssignedTo: ns-bugs at isi.edu
ReportedBy: boyko at iitp.ru
Estimated Hours: 0.0
Created an attachment (id=444)
--> (http://www.nsnam.org/bugzilla/attachment.cgi?id=444)
fix for ns-3-dev
I'm using byte tags from http://code.nsnam.org/mathieu/ns-3-tags, but bug also
exist in ns-3-dev.
The mysterious problem, I have faced, is that PCAP writer attached to promisc
sniffer in YansWifiPhy sometimes destroys byte tags tagged on the packets.
Unfortunately I can't reproduce this behavior in simple isolated test case,
sorry.
As far as I can see, the reason is that PCAP writer calls harmless
Packet::PeekData() which calls harmless Buffer::PeekData() which is, actually,
not harmless and non-constant at all -- it can expand virtual payload to real
zero bytes if needed. Also Buffer::m_start and m_end offsets can change, in my
case of 20 byte payload I see:
Before PeekData(): m_start = 20, m_end = 116, m_zeroAreaStart = 92,
m_zeroAreaEnd = 112
After PeekData(): m_start = 0, m_end = 96, m_zeroAreaStart = 92, m_zeroAreaEnd
= 92
Since byte tags store offsets in packet buffer (don't ask me why), they must be
updated in Packet::PeekData().
Attached patch (adapted from ns-3-tags for ns-3-dev) fixes this, and now PCAP
writer doesn't spoil my tags.
Since buffer, packet and tags implementation still confuses me a lot, I'd like
to ask Mathieu to write corresponding unit test if I'm right.
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs
mailing list